Changeset 8f88beb7 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2012-11-25T21:34:07Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e1a27be
Parents:
150a2718 (diff), 7462674 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Location:
uspace/lib/c/include
Files:
1 added
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ddi.h

    r150a2718 r8f88beb7  
    5454extern int pio_enable(void *, size_t, void **);
    5555
    56 typedef void (*trace_fnc)(volatile void *place, uint32_t val,
     56typedef void (*trace_fnc)(const volatile void *place, uint32_t val,
    5757    volatile void* base, size_t size, void *data, bool write);
    5858
    5959extern int pio_trace_enable(void *, size_t, trace_fnc, void *);
    60 extern void pio_trace_log(volatile void *, uint32_t val, bool write);
     60extern void pio_trace_log(const volatile void *, uint32_t val, bool write);
    6161extern void pio_trace_disable(void *);
    6262
     
    6565extern void pio_write_32(ioport32_t *, uint32_t);
    6666
    67 extern uint8_t pio_read_8(ioport8_t *);
    68 extern uint16_t pio_read_16(ioport16_t *);
    69 extern uint32_t pio_read_32(ioport32_t *);
     67extern uint8_t pio_read_8(const ioport8_t *);
     68extern uint16_t pio_read_16(const ioport16_t *);
     69extern uint32_t pio_read_32(const ioport32_t *);
    7070
    7171static inline uint8_t pio_change_8(
  • uspace/lib/c/include/double_to_str.h

    r150a2718 r8f88beb7  
    11/*
    2  * Copyright (c) 2006 Martin Decky
    3  * Copyright (c) 2011 Martin Sucha
     2 * Copyright (c) 2012 Adam Hraska
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup fs
    31  * @{
    32  */
     29#ifndef DOUBLE_TO_STR_H_
     30#define DOUBLE_TO_STR_H_
    3331
    34 /**
    35  * @file        ext2.c
    36  * @brief       EXT2 file system driver for HelenOS.
     32#include <unistd.h>
     33
     34/** Maximum number of digits double_to_*_str conversion functions produce.
     35 *
     36 * Both double_to_short_str and double_to_fixed_str generate digits out
     37 * of a 64bit unsigned int number representation. The max number of
     38 * of digits is therefore 20. Add 1 to help users who forget to reserve
     39 * space for a null terminator.
    3740 */
     41#define MAX_DOUBLE_STR_LEN (20 + 1)
    3842
    39 #include "ext2fs.h"
    40 #include <ipc/services.h>
    41 #include <ns.h>
    42 #include <async.h>
    43 #include <errno.h>
    44 #include <unistd.h>
    45 #include <task.h>
    46 #include <stdio.h>
    47 #include <libfs.h>
    48 #include "../../vfs/vfs.h"
     43/** Maximum buffer size needed to store the output of double_to_*_str
     44 *  functions.
     45 */
     46#define MAX_DOUBLE_STR_BUF_SIZE  21
    4947
    50 #define NAME    "ext2fs"
     48/* Fwd decl.*/
     49struct ieee_double_t_tag;
    5150
    52 vfs_info_t ext2fs_vfs_info = {
    53         .name = NAME,
    54         .instance = 0,
    55 };
     51extern int double_to_short_str(struct ieee_double_t_tag, char *, size_t, int *);
     52extern int double_to_fixed_str(struct ieee_double_t_tag, int, int, char *,
     53    size_t, int *);
    5654
    57 int main(int argc, char **argv)
    58 {
    59         printf(NAME ": HelenOS EXT2 file system server\n");
    60 
    61         if (argc == 3) {
    62                 if (!str_cmp(argv[1], "--instance"))
    63                         ext2fs_vfs_info.instance = strtol(argv[2], NULL, 10);
    64                 else {
    65                         printf(NAME " Unrecognized parameters");
    66                         return -1;
    67                 }
    68         }
    69        
    70         async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    71             SERVICE_VFS, 0, 0);
    72         if (!vfs_sess) {
    73                 printf(NAME ": failed to connect to VFS\n");
    74                 return -1;
    75         }
    76 
    77         int rc = ext2fs_global_init();
    78         if (rc != EOK) {
    79                 printf(NAME ": Failed global initialization\n");
    80                 return 1;
    81         }       
    82                
    83         rc = fs_register(vfs_sess, &ext2fs_vfs_info, &ext2fs_ops,
    84             &ext2fs_libfs_ops);
    85         if (rc != EOK) {
    86                 fprintf(stdout, NAME ": Failed to register fs (%d)\n", rc);
    87                 return 1;
    88         }
    89        
    90         printf(NAME ": Accepting connections\n");
    91         task_retval(0);
    92         async_manager();
    93         /* not reached */
    94         return 0;
    95 }
    96 
    97 /**
    98  * @}
    99  */
     55#endif
  • uspace/lib/c/include/macros.h

    r150a2718 r8f88beb7  
    3838#define min(a, b)  ((a) < (b) ? (a) : (b))
    3939#define max(a, b)  ((a) > (b) ? (a) : (b))
     40#define abs(a)     ((a) >= 0 ? (a) : (-a))
     41
    4042
    4143#define KiB2SIZE(kb)  ((kb) << 10)
  • uspace/lib/c/include/stack.h

    r150a2718 r8f88beb7  
    11/*
    2  * Copyright (c) 2011 Martin Sucha
     2 * Copyright (c) 2012 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libext2
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /**
    33  * @file
     32/** @file
    3433 */
    3534
    36 #ifndef LIBEXT2_LIBEXT2_H_
    37 #define LIBEXT2_LIBEXT2_H_
     35#ifndef LIBC_STACK_H_
     36#define LIBC_STACK_H_
    3837
    39 #include "libext2_superblock.h"
    40 #include "libext2_block_group.h"
    41 #include "libext2_inode.h"
    42 #include "libext2_filesystem.h"
    43 #include "libext2_directory.h"
     38#include <libarch/types.h>
     39
     40extern size_t stack_size_get(void);
    4441
    4542#endif
Note: See TracChangeset for help on using the changeset viewer.