Changeset 357b5f5 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2011-01-23T20:09:13Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fdb9982c
Parents:
cead2aa (diff), 7e36c8d (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:
37 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/char_map.h

    rcead2aa r357b5f5  
    4141
    4242/** Invalid assigned value used also if an&nbsp;entry does not exist. */
    43 #define CHAR_MAP_NULL   (-1)
     43#define CHAR_MAP_NULL  (-1)
    4444
    4545/** Type definition of the character string to integer map.
    4646 *  @see char_map
    4747 */
    48 typedef struct char_map char_map_t;
     48typedef struct char_map char_map_t;
    4949
    5050/** Character string to integer map item.
     
    5656struct char_map {
    5757        /** Actually mapped character. */
    58         char c;
     58        uint8_t c;
    5959        /** Stored integral value. */
    6060        int value;
     
    7171extern int char_map_initialize(char_map_t *);
    7272extern void char_map_destroy(char_map_t *);
    73 extern int char_map_exclude(char_map_t *, const char *, size_t);
    74 extern int char_map_add(char_map_t *, const char *, size_t, const int);
    75 extern int char_map_find(const char_map_t *, const char *, size_t);
    76 extern int char_map_update(char_map_t *, const char *, size_t, const int);
     73extern int char_map_exclude(char_map_t *, const uint8_t *, size_t);
     74extern int char_map_add(char_map_t *, const uint8_t *, size_t, const int);
     75extern int char_map_find(const char_map_t *, const uint8_t *, size_t);
     76extern int char_map_update(char_map_t *, const uint8_t *, size_t, const int);
    7777
    7878#endif
  • uspace/lib/c/include/adt/generic_char_map.h

    rcead2aa r357b5f5  
    6262        }; \
    6363        \
    64         int name##_add(name##_t *, const char *, const size_t, type *); \
     64        int name##_add(name##_t *, const uint8_t *, const size_t, type *); \
    6565        int name##_count(name##_t *); \
    6666        void name##_destroy(name##_t *); \
    67         void name##_exclude(name##_t *, const char *, const size_t); \
    68         type *name##_find(name##_t *, const char *, const size_t); \
     67        void name##_exclude(name##_t *, const uint8_t *, const size_t); \
     68        type *name##_find(name##_t *, const uint8_t *, const size_t); \
    6969        int name##_initialize(name##_t *); \
    7070        int name##_is_valid(name##_t *);
     
    7474 * Should follow declaration with the same parameters.
    7575 *
    76  * @param[in] name      Name of the map.
    77  * @param[in] type      Inner object type.
     76 * @param[in] name Name of the map.
     77 * @param[in] type Inner object type.
     78 *
    7879 */
    7980#define GENERIC_CHAR_MAP_IMPLEMENT(name, type) \
    8081        GENERIC_FIELD_IMPLEMENT(name##_items, type) \
    8182        \
    82         int name##_add(name##_t *map, const char *name, const size_t length, \
     83        int name##_add(name##_t *map, const uint8_t *name, const size_t length, \
    8384             type *value) \
    8485        { \
     
    112113        } \
    113114        \
    114         void name##_exclude(name##_t *map, const char *name, \
     115        void name##_exclude(name##_t *map, const uint8_t *name, \
    115116            const size_t length) \
    116117        { \
     
    124125        } \
    125126        \
    126         type *name##_find(name##_t *map, const char *name, \
     127        type *name##_find(name##_t *map, const uint8_t *name, \
    127128            const size_t length) \
    128129        { \
  • uspace/lib/c/include/adt/generic_field.h

    rcead2aa r357b5f5  
    9191                        } \
    9292                        field->items[field->next] = value; \
    93                         ++field->next; \
     93                        field->next++; \
    9494                        field->items[field->next] = NULL; \
    9595                        return field->next - 1; \
     
    108108                        int index; \
    109109                        field->magic = 0; \
    110                         for (index = 0; index < field->next; ++ index) { \
     110                        for (index = 0; index < field->next; index++) { \
    111111                                if (field->items[index]) \
    112112                                        free(field->items[index]); \
  • uspace/lib/c/include/adt/hash_table.h

    rcead2aa r357b5f5  
    4141typedef unsigned long hash_count_t;
    4242typedef unsigned long hash_index_t;
    43 typedef struct hash_table hash_table_t;
    44 typedef struct hash_table_operations hash_table_operations_t;
     43
     44/** Set of operations for hash table. */
     45typedef struct {
     46        /** Hash function.
     47         *
     48         * @param key Array of keys needed to compute hash index.
     49         *            All keys must be passed.
     50         *
     51         * @return Index into hash table.
     52         *
     53         */
     54        hash_index_t (*hash)(unsigned long key[]);
     55       
     56        /** Hash table item comparison function.
     57         *
     58         * @param key Array of keys that will be compared with item. It is
     59         *            not necessary to pass all keys.
     60         *
     61         * @return True if the keys match, false otherwise.
     62         *
     63         */
     64        int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
     65       
     66        /** Hash table item removal callback.
     67         *
     68         * @param item Item that was removed from the hash table.
     69         *
     70         */
     71        void (*remove_callback)(link_t *item);
     72} hash_table_operations_t;
    4573
    4674/** Hash table structure. */
    47 struct hash_table {
     75typedef struct {
    4876        link_t *entry;
    4977        hash_count_t entries;
    5078        hash_count_t max_keys;
    5179        hash_table_operations_t *op;
    52 };
    53 
    54 /** Set of operations for hash table. */
    55 struct hash_table_operations {
    56         /** Hash function.
    57          *
    58          * @param key   Array of keys needed to compute hash index. All keys
    59          *              must be passed.
    60          *
    61          * @return      Index into hash table.
    62          */
    63         hash_index_t (* hash)(unsigned long key[]);
    64        
    65         /** Hash table item comparison function.
    66          *
    67          * @param key   Array of keys that will be compared with item. It is
    68          *              not necessary to pass all keys.
    69          *
    70          * @return      true if the keys match, false otherwise.
    71          */
    72         int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
    73 
    74         /** Hash table item removal callback.
    75          *
    76          * @param item  Item that was removed from the hash table.
    77          */
    78         void (*remove_callback)(link_t *item);
    79 };
     80} hash_table_t;
    8081
    8182#define hash_table_get_instance(item, type, member) \
  • uspace/lib/c/include/adt/measured_strings.h

    rcead2aa r357b5f5  
    5454struct measured_string {
    5555        /** Character string data. */
    56         char *value;
     56        uint8_t *value;
    5757        /** Character string length. */
    5858        size_t length;
    5959};
    6060
    61 extern measured_string_t *measured_string_create_bulk(const char *, size_t);
     61extern measured_string_t *measured_string_create_bulk(const uint8_t *, size_t);
    6262extern measured_string_t *measured_string_copy(measured_string_t *);
    63 extern int measured_strings_receive(measured_string_t **, char **, size_t);
     63extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t);
    6464extern int measured_strings_reply(const measured_string_t *, size_t);
    65 extern int measured_strings_return(int, measured_string_t **, char **, size_t);
     65extern int measured_strings_return(int, measured_string_t **, uint8_t **, size_t);
    6666extern int measured_strings_send(int, const measured_string_t *, size_t);
    6767
  • uspace/lib/c/include/async.h

    rcead2aa r357b5f5  
    3737
    3838#include <ipc/ipc.h>
     39#include <async_sess.h>
    3940#include <fibril.h>
    4041#include <sys/time.h>
     
    8485            (arg5), (dataptr))
    8586
    86 extern aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
    87     ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr);
    88 extern aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
    89     ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
     87extern aid_t async_send_fast(int phoneid, sysarg_t method, sysarg_t arg1,
     88    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr);
     89extern aid_t async_send_slow(int phoneid, sysarg_t method, sysarg_t arg1,
     90    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
    9091    ipc_call_t *dataptr);
    91 extern void async_wait_for(aid_t amsgid, ipcarg_t *result);
    92 extern int async_wait_timeout(aid_t amsgid, ipcarg_t *retval,
     92extern void async_wait_for(aid_t amsgid, sysarg_t *result);
     93extern int async_wait_timeout(aid_t amsgid, sysarg_t *retval,
    9394    suseconds_t timeout);
    9495
    95 extern fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
     96extern fid_t async_new_connection(sysarg_t in_phone_hash, ipc_callid_t callid,
    9697    ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *));
    9798extern void async_usleep(suseconds_t timeout);
     
    242243            (arg5), (rc1), (rc2), (rc3), (rc4), (rc5))
    243244
    244 extern ipcarg_t async_req_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
    245     ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t *r1, ipcarg_t *r2,
    246     ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5);
    247 extern ipcarg_t async_req_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
    248     ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *r1,
    249     ipcarg_t *r2, ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5);
     245extern sysarg_t async_req_fast(int phoneid, sysarg_t method, sysarg_t arg1,
     246    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t *r1, sysarg_t *r2,
     247    sysarg_t *r3, sysarg_t *r4, sysarg_t *r5);
     248extern sysarg_t async_req_slow(int phoneid, sysarg_t method, sysarg_t arg1,
     249    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *r1,
     250    sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5);
    250251
    251252static inline void async_serialize_start(void)
     
    259260}
    260261
    261 extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t);
    262 extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t);
     262extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
     263extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
    263264
    264265/*
     
    274275        async_share_in_start((phoneid), (dst), (size), (arg), (flags))
    275276
    276 extern int async_share_in_start(int, void *, size_t, ipcarg_t, int *);
     277extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
    277278extern int async_share_in_receive(ipc_callid_t *, size_t *);
    278279extern int async_share_in_finalize(ipc_callid_t, void *, int );
     
    314315extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    315316
    316 extern int async_data_read_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
    317     ipcarg_t, ipcarg_t, ipc_call_t *);
     317extern int async_data_read_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
     318    sysarg_t, sysarg_t, ipc_call_t *);
    318319
    319320/*
     
    356357extern void async_data_write_void(const int);
    357358
    358 extern int async_data_write_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t,
    359     ipcarg_t, ipcarg_t, ipc_call_t *);
     359extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
     360    sysarg_t, sysarg_t, ipc_call_t *);
    360361
    361362#endif
  • uspace/lib/c/include/async_sess.h

    rcead2aa r357b5f5  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2010 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 
    33 /**
    34  * @file
    35  * @brief Wrapper for explicit 64-bit arguments passed to syscalls.
     32/** @file
    3633 */
    3734
    38 #ifndef KERN_SYSARG64_H_
    39 #define KERN_SYSARG64_H_
     35#ifndef LIBC_ASYNC_SESS_H_
     36#define LIBC_ASYNC_SESS_H_
     37
     38#include <adt/list.h>
    4039
    4140typedef struct {
    42         unsigned long long value;
    43 } sysarg64_t;
     41        int sess_phone;         /**< Phone for cloning off the connections. */
     42        sysarg_t connect_arg1;  /**< Argument for CONNECT_ME_TO. */
     43        link_t conn_head;       /**< List of open data connections. */
     44        link_t sess_link;       /**< Link in global list of open sessions. */
     45} async_sess_t;
     46
     47extern void _async_sess_init(void);
     48extern void async_session_create(async_sess_t *, int, sysarg_t);
     49extern void async_session_destroy(async_sess_t *);
     50extern int async_exchange_begin(async_sess_t *);
     51extern void async_exchange_end(async_sess_t *, int);
    4452
    4553#endif
  • uspace/lib/c/include/ddi.h

    rcead2aa r357b5f5  
    4242extern int iospace_enable(task_id_t, void *, unsigned long);
    4343extern int pio_enable(void *, size_t, void **);
    44 extern int interrupt_enable(int);
    45 extern int interrupt_disable(int);
    4644
    4745#endif
  • uspace/lib/c/include/device/char_dev.h

    rcead2aa r357b5f5  
    2727 */
    2828
    29  /** @addtogroup libc
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef LIBC_DEVICE_HW_RES_H_
    36 #define LIBC_DEVICE_HW_RES_H_
     35#ifndef LIBC_DEVICE_CHAR_DEV_H_
     36#define LIBC_DEVICE_CHAR_DEV_H_
    3737
    3838typedef enum {
    39         CHAR_READ_DEV = 0,
    40         CHAR_WRITE_DEV
    41 } hw_res_funcs_t;
     39        CHAR_DEV_READ = 0,
     40        CHAR_DEV_WRITE
     41} char_dev_method_t;
    4242
    43 ssize_t read_dev(int dev_phone, void *buf, size_t len);
    44 ssize_t write_dev(int dev_phone, void *buf, size_t len);
     43ssize_t char_dev_read(int dev_phone, void *buf, size_t len);
     44ssize_t char_dev_write(int dev_phone, void *buf, size_t len);
    4545
    4646#endif
  • uspace/lib/c/include/device/hw_res.h

    rcead2aa r357b5f5  
    2727 */
    2828 
    29  /** @addtogroup libc
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3939#include <bool.h>
    4040
    41 // HW resource provider interface
     41/** HW resource provider interface */
     42typedef enum {
     43        HW_RES_GET_RESOURCE_LIST = 0,
     44        HW_RES_ENABLE_INTERRUPT
     45} hw_res_method_t;
    4246
    43 typedef enum {
    44         GET_RESOURCE_LIST = 0,
    45         ENABLE_INTERRUPT       
    46 } hw_res_funcs_t;
    47 
    48 /** HW resource types. */
     47/** HW resource types */
    4948typedef enum {
    5049        INTERRUPT,
     
    5857} endianness_t;
    5958
    60 
    61 /** HW resource (e.g. interrupt, memory register, i/o register etc.). */
    62 typedef struct hw_resource {
     59/** HW resource (e.g. interrupt, memory register, i/o register etc.) */
     60typedef struct {
    6361        hw_res_type_t type;
    6462        union {
    6563                struct {
    6664                        uint64_t address;
    67                         endianness_t endianness;                       
    68                         size_t size;                   
     65                        endianness_t endianness;
     66                        size_t size;
    6967                } mem_range;
     68
    7069                struct {
    7170                        uint64_t address;
    72                         endianness_t endianness;                       
    73                         size_t size;                   
     71                        endianness_t endianness;
     72                        size_t size;
    7473                } io_range;
     74
    7575                struct {
    76                         int irq;                       
    77                 } interrupt;           
    78         } res; 
     76                        int irq;
     77                } interrupt;
     78        } res;
    7979} hw_resource_t;
    8080
    81 typedef struct hw_resource_list {
     81typedef struct {
    8282        size_t count;
    83         hw_resource_t *resources;       
     83        hw_resource_t *resources;
    8484} hw_resource_list_t;
    8585
    86 static inline void clean_hw_resource_list(hw_resource_list_t *hw_res)
     86static inline void hw_res_clean_resource_list(hw_resource_list_t *hw_res)
    8787{
    88         if(NULL != hw_res->resources) {
     88        if (hw_res->resources != NULL) {
    8989                free(hw_res->resources);
     90
    9091                hw_res->resources = NULL;
    9192        }
    92         hw_res->count = 0;     
     93
     94        hw_res->count = 0;
    9395}
    9496
    95 
    96 
    97 bool get_hw_resources(int dev_phone, hw_resource_list_t *hw_resources);
    98 
    99 bool enable_interrupt(int dev_phone);
    100 
     97extern int hw_res_get_resource_list(int, hw_resource_list_t *);
     98extern bool hw_res_enable_interrupt(int);
    10199
    102100#endif
  • uspace/lib/c/include/devmap.h

    rcead2aa r357b5f5  
    4545extern int devmap_driver_register(const char *, async_client_conn_t);
    4646extern int devmap_device_register(const char *, devmap_handle_t *);
     47extern int devmap_device_register_with_iface(const char *, devmap_handle_t *, sysarg_t);
    4748
    4849extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
  • uspace/lib/c/include/errno.h

    rcead2aa r357b5f5  
    8383#define ENOTCONN        (-10057)
    8484
    85 /** The requested operation was not performed.
    86  *  Try again later.
    87  */
    88 #define TRY_AGAIN       (-11002)
     85/** The requested operation was not performed. Try again later. */
     86#define EAGAIN          (-11002)
    8987
    9088/** No data.
  • uspace/lib/c/include/event.h

    rcead2aa r357b5f5  
    3939#include <ipc/ipc.h>
    4040
    41 extern int event_subscribe(event_type_t, ipcarg_t);
     41extern int event_subscribe(event_type_t, sysarg_t);
    4242
    4343#endif
  • uspace/lib/c/include/fibril.h

    rcead2aa r357b5f5  
    9494extern void fibril_inc_sercount(void);
    9595extern void fibril_dec_sercount(void);
     96extern int fibril_get_sercount(void);
    9697
    9798static inline int fibril_yield(void)
  • uspace/lib/c/include/fibril_synch.h

    rcead2aa r357b5f5  
    105105extern bool fibril_mutex_trylock(fibril_mutex_t *);
    106106extern void fibril_mutex_unlock(fibril_mutex_t *);
     107extern bool fibril_mutex_is_locked(fibril_mutex_t *);
    107108
    108109extern void fibril_rwlock_initialize(fibril_rwlock_t *);
     
    111112extern void fibril_rwlock_read_unlock(fibril_rwlock_t *);
    112113extern void fibril_rwlock_write_unlock(fibril_rwlock_t *);
     114extern bool fibril_rwlock_is_read_locked(fibril_rwlock_t *);
     115extern bool fibril_rwlock_is_write_locked(fibril_rwlock_t *);
     116extern bool fibril_rwlock_is_locked(fibril_rwlock_t *);
    113117
    114118extern void fibril_condvar_initialize(fibril_condvar_t *);
  • uspace/lib/c/include/io/console.h

    rcead2aa r357b5f5  
    6868extern void console_clear(int phone);
    6969
    70 extern int console_get_size(int phone, ipcarg_t *cols, ipcarg_t *rows);
    71 extern int console_get_pos(int phone, ipcarg_t *col, ipcarg_t *row);
    72 extern void console_set_pos(int phone, ipcarg_t col, ipcarg_t row);
     70extern int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows);
     71extern int console_get_pos(int phone, sysarg_t *col, sysarg_t *row);
     72extern void console_set_pos(int phone, sysarg_t col, sysarg_t row);
    7373
    7474extern void console_set_style(int phone, uint8_t style);
     
    7878
    7979extern void console_cursor_visibility(int phone, bool show);
    80 extern int console_get_color_cap(int phone, ipcarg_t *ccap);
     80extern int console_get_color_cap(int phone, sysarg_t *ccap);
    8181extern void console_kcon_enable(int phone);
    8282
  • uspace/lib/c/include/io/screenbuffer.h

    rcead2aa r357b5f5  
    8484        keyfield_t *buffer;      /**< Screen content - characters and
    8585                                      their attributes (used as a circular buffer) */
    86         ipcarg_t size_x;         /**< Number of columns  */
    87         ipcarg_t size_y;         /**< Number of rows */
     86        sysarg_t size_x;         /**< Number of columns  */
     87        sysarg_t size_y;         /**< Number of rows */
    8888       
    8989        /** Coordinates of last printed character for determining cursor position */
    90         ipcarg_t position_x;
    91         ipcarg_t position_y;
     90        sysarg_t position_x;
     91        sysarg_t position_y;
    9292       
    9393        attrs_t attrs;           /**< Current attributes. */
     
    109109 *
    110110 */
    111 static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
     111static inline keyfield_t *get_field_at(screenbuffer_t *scr, sysarg_t x, sysarg_t y)
    112112{
    113113        return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
     
    143143
    144144extern void screenbuffer_putchar(screenbuffer_t *, wchar_t);
    145 extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t);
     145extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, sysarg_t, sysarg_t);
    146146
    147147extern void screenbuffer_clear(screenbuffer_t *);
    148 extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t);
     148extern void screenbuffer_clear_line(screenbuffer_t *, sysarg_t);
    149149extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *);
    150 extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t);
     150extern void screenbuffer_goto(screenbuffer_t *, sysarg_t, sysarg_t);
    151151extern void screenbuffer_set_style(screenbuffer_t *, uint8_t);
    152152extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t);
  • uspace/lib/c/include/ipc/arp.h

    rcead2aa r357b5f5  
    6969/*@{*/
    7070
    71 /** Returns the protocol service message parameter.
    72  * @param[in] call The message call structure.
     71/** Return the protocol service message parameter.
     72 *
     73 * @param[in] call Message call structure.
     74 *
    7375 */
    74 #define ARP_GET_NETIF(call) \
    75         ({ \
    76                 services_t service = (services_t) IPC_GET_ARG2(*call); \
    77                 service; \
    78         })
     76#define ARP_GET_NETIF(call) ((services_t) IPC_GET_ARG2(call))
    7977
    8078/*@}*/
  • uspace/lib/c/include/ipc/dev_iface.h

    rcead2aa r357b5f5  
    3535#include <libarch/types.h>
    3636
    37 typedef enum { 
    38         HW_RES_DEV_IFACE = 0,   
     37typedef enum {
     38        HW_RES_DEV_IFACE = 0,
    3939        CHAR_DEV_IFACE,
    40         // TODO add more interfaces
    4140        DEV_IFACE_MAX
    4241} dev_inferface_idx_t;
  • uspace/lib/c/include/ipc/devman.h

    rcead2aa r357b5f5  
    4242#define DEVMAN_NAME_MAXLEN 256
    4343
    44 typedef ipcarg_t devman_handle_t;
     44typedef sysarg_t devman_handle_t;
    4545
    4646/** Ids of device models used for device-to-driver matching.
     
    123123        DEVMAN_CLIENT,
    124124        DEVMAN_CONNECT_TO_DEVICE,
     125        DEVMAN_CONNECT_FROM_DEVMAP,
    125126        DEVMAN_CONNECT_TO_PARENTS_DEVICE
    126127} devman_interface_t;
  • uspace/lib/c/include/ipc/devmap.h

    rcead2aa r357b5f5  
    4040#define DEVMAP_NAME_MAXLEN  255
    4141
    42 typedef ipcarg_t devmap_handle_t;
     42typedef sysarg_t devmap_handle_t;
    4343
    4444typedef enum {
  • uspace/lib/c/include/ipc/icmp.h

    rcead2aa r357b5f5  
    3333/** @file
    3434 * ICMP module messages.
    35  * @see icmp_interface.h
     35 * @see icmp_remote.h
    3636 */
    3737
     
    4848/** ICMP module messages. */
    4949typedef enum {
    50         /** Sends echo request. @see icmp_echo() */
     50        /** Send echo request. @see icmp_echo() */
    5151        NET_ICMP_ECHO = NET_ICMP_FIRST,
    5252       
    5353        /**
    54          * Sends destination unreachable error message.
     54         * Send destination unreachable error message.
    5555         * @see icmp_destination_unreachable_msg()
    5656         */
     
    5858       
    5959        /**
    60          * Sends source quench error message.
     60         * Send source quench error message.
    6161         * @see icmp_source_quench_msg()
    6262         */
     
    6464       
    6565        /**
    66          * Sends time exceeded error message.
     66         * Send time exceeded error message.
    6767         * @see icmp_time_exceeded_msg()
    6868         */
     
    7070       
    7171        /**
    72          * Sends parameter problem error message.
     72         * Send parameter problem error message.
    7373         * @see icmp_parameter_problem_msg()
    7474         */
    75         NET_ICMP_PARAMETERPROB,
    76        
    77         /** Initializes new connection. */
    78         NET_ICMP_INIT
    79 } icmp_messages;
     75        NET_ICMP_PARAMETERPROB
     76} icmp_messages_t;
    8077
    8178/** @name ICMP specific message parameters definitions */
    8279/*@{*/
    8380
    84 /** Returns the ICMP code message parameter.
     81/** Return the ICMP code message parameter.
    8582 *
    86  * @param[in] call      The message call structure.
     83 * @param[in] call Message call structure.
     84 *
    8785 */
    88 #define ICMP_GET_CODE(call) \
    89         ({ \
    90                 icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); \
    91                 code; \
    92         })
     86#define ICMP_GET_CODE(call)  ((icmp_code_t) IPC_GET_ARG1(call))
    9387
    94 /** Returns the ICMP link MTU message parameter.
     88/** Return the ICMP link MTU message parameter.
    9589 *
    96  * @param[in] call      The message call structure.
     90 * @param[in] call Message call structure.
     91 *
    9792 */
    98 #define ICMP_GET_MTU(call) \
    99         ({ \
    100                 icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); \
    101                 mtu; \
    102         })
     93#define ICMP_GET_MTU(call)  ((icmp_param_t) IPC_GET_ARG3(call))
    10394
    104 /** Returns the pointer message parameter.
     95/** Return the pointer message parameter.
    10596 *
    106  * @param[in] call      The message call structure.
     97 * @param[in] call Message call structure.
     98 *
    10799 */
    108 #define ICMP_GET_POINTER(call) \
    109         ({ \
    110                 icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); \
    111                 pointer; \
    112         })
     100#define ICMP_GET_POINTER(call)  ((icmp_param_t) IPC_GET_ARG3(call))
    113101
    114 /** Returns the size message parameter.
     102/** Return the size message parameter.
    115103 *
    116  * @param[in] call      The message call structure.
     104 * @param[in] call Message call structure.
     105 *
    117106 */
    118 #define ICMP_GET_SIZE(call) \
    119         ({ \
    120                 size_t size = (size_t) IPC_GET_ARG1(call); \
    121                 size; \
    122         })
     107#define ICMP_GET_SIZE(call)  ((size_t) IPC_GET_ARG1(call))
    123108
    124 /** Returns the timeout message parameter.
     109/** Return the timeout message parameter.
    125110 *
    126  * @param[in] call      The message call structure.
     111 * @param[in] call Message call structure.
     112 *
    127113 */
    128 #define ICMP_GET_TIMEOUT(call) \
    129         ({ \
    130                 suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); \
    131                 timeout; \
    132         })
     114#define ICMP_GET_TIMEOUT(call)  ((suseconds_t) IPC_GET_ARG2(call))
    133115
    134 /** Returns the time to live message parameter.
     116/** Return the time to live message parameter.
    135117 *
    136  * @param[in] call      The message call structure.
     118 * @param[in] call Message call structure.
     119 *
    137120 */
    138 #define ICMP_GET_TTL(call) \
    139         ({ \
    140                 ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); \
    141                 ttl; \
    142         })
     121#define ICMP_GET_TTL(call)  ((ip_ttl_t) IPC_GET_ARG3(call))
    143122
    144 /** Returns the type of service message parameter.
     123/** Return the type of service message parameter.
    145124 *
    146  * @param[in] call      The message call structure.
     125 * @param[in] call Message call structure.
     126 *
    147127 */
    148 #define ICMP_GET_TOS(call) \
    149         ({ \
    150                 ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); \
    151                 tos; \
    152         })
     128#define ICMP_GET_TOS(call)  ((ip_tos_t) IPC_GET_ARG4(call))
    153129
    154 /** Returns the dont fragment message parameter.
     130/** Return the dont fragment message parameter.
    155131 *
    156  * @param[in] call      The message call structure.
     132 * @param[in] call Message call structure.
    157133 */
    158 #define ICMP_GET_DONT_FRAGMENT(call) \
    159         ({ \
    160                 int dont_fragment = (int) IPC_GET_ARG5(call); \
    161                 dont_fragment; \
    162         })
     134#define ICMP_GET_DONT_FRAGMENT(call)  ((int) IPC_GET_ARG5(call))
    163135
    164136/*@}*/
  • uspace/lib/c/include/ipc/il.h

    rcead2aa r357b5f5  
    3333/** @file
    3434 * Internetwork layer modules messages.
    35  * @see il_interface.h
     35 * @see il_remote.h
    3636 * @see ip_interface.h
    3737 */
     
    4545/** Internet layer modules messages. */
    4646typedef enum {
    47         /** New device message.
    48          * @see ip_device_req()
    49          */
    50         NET_IL_DEVICE = NET_IL_FIRST,
    5147        /** Device state changed message.
    5248         * @see il_device_state_msg()
    5349         */
    54         NET_IL_DEVICE_STATE,
     50        NET_IL_DEVICE_STATE = NET_IL_FIRST,
     51       
    5552        /** Device MTU changed message.
    5653         * @see il_mtu_changed_msg()
    5754         */
    5855        NET_IL_MTU_CHANGED,
    59         /** Packet size message.
    60          * @see il_packet_size_req()
    61          */
    62         NET_IL_PACKET_SPACE,
     56       
    6357        /** Packet received message.
    6458         * @see il_received_msg()
    6559         */
    66         NET_IL_RECEIVED,
    67         /** Packet send message.
    68          * @see il_send_msg()
    69          */
    70         NET_IL_SEND
     60        NET_IL_RECEIVED
    7161} il_messages;
    7262
     
    7565
    7666/** Return the protocol number message parameter.
    77  * @param[in] call The message call structure.
     67 *
     68 * @param[in] call Message call structure.
     69 *
    7870 */
    79 #define IL_GET_PROTO(call)      (int) IPC_GET_ARG1(*call)
     71#define IL_GET_PROTO(call)  ((int) IPC_GET_ARG1(call))
    8072
    8173/** Return the registering service message parameter.
    82  * @param[in] call The message call structure.
     74 *
     75 * @param[in] call Message call structure.
     76 *
    8377 */
    84 #define IL_GET_SERVICE(call)    (services_t) IPC_GET_ARG2(*call)
     78#define IL_GET_SERVICE(call)  ((services_t) IPC_GET_ARG2(call))
    8579
    8680/*@}*/
  • uspace/lib/c/include/ipc/ip.h

    rcead2aa r357b5f5  
    4747/** IP module messages. */
    4848typedef enum {
     49        /** New device message.
     50         * @see ip_device_req()
     51         */
     52        NET_IP_DEVICE = NET_IP_FIRST,
     53       
    4954        /** Adds the routing entry.
    5055         * @see ip_add_route()
    5156         */
    52         NET_IP_ADD_ROUTE = NET_IP_FIRST,
     57        NET_IP_ADD_ROUTE,
     58       
    5359        /** Gets the actual route information.
    5460         * @see ip_get_route()
    5561         */
    5662        NET_IP_GET_ROUTE,
     63       
    5764        /** Processes the received error notification.
    5865         * @see ip_received_error_msg()
    5966         */
    6067        NET_IP_RECEIVED_ERROR,
     68       
    6169        /** Sets the default gateway.
    6270         * @see ip_set_default_gateway()
    6371         */
    64         NET_IP_SET_GATEWAY
     72        NET_IP_SET_GATEWAY,
     73       
     74        /** Packet size message.
     75         * @see ip_packet_size_req()
     76         */
     77        NET_IP_PACKET_SPACE,
     78       
     79        /** Packet send message.
     80         * @see ip_send_msg()
     81         */
     82        NET_IP_SEND
    6583} ip_messages;
    6684
     
    6886/*@{*/
    6987
    70 /** Returns the address message parameter.
    71  * @param[in] call The message call structure.
     88/** Return the address message parameter.
     89 *
     90 * @param[in] call Message call structure.
     91 *
    7292 */
    7393#define IP_GET_ADDRESS(call) \
    7494        ({ \
    7595                in_addr_t addr; \
    76                 addr.s_addr = IPC_GET_ARG3(*call); \
     96                addr.s_addr = IPC_GET_ARG3(call); \
    7797                addr; \
    7898        })
    7999
    80 /** Returns the gateway message parameter.
    81  * @param[in] call The message call structure.
     100/** Return the gateway message parameter.
     101 *
     102 * @param[in] call Message call structure.
     103 *
    82104 */
    83105#define IP_GET_GATEWAY(call) \
    84106        ({ \
    85107                in_addr_t addr; \
    86                 addr.s_addr = IPC_GET_ARG2(*call); \
     108                addr.s_addr = IPC_GET_ARG2(call); \
    87109                addr; \
    88110        })
    89111
    90 /** Sets the header length in the message answer.
    91  * @param[out] answer The message answer structure.
     112/** Set the header length in the message answer.
     113 *
     114 * @param[out] answer Message answer structure.
     115 *
    92116 */
    93 #define IP_SET_HEADERLEN(answer, value) \
    94         do { \
    95                 ipcarg_t argument = (ipcarg_t) (value); \
    96                 IPC_SET_ARG2(*answer, argument); \
    97         } while (0)
     117#define IP_SET_HEADERLEN(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
    98118
    99 /** Returns the network mask message parameter.
    100  * @param[in] call The message call structure.
     119/** Return the network mask message parameter.
     120 *
     121 * @param[in] call Message call structure.
     122 *
    101123 */
    102124#define IP_GET_NETMASK(call) \
    103125        ({ \
    104126                in_addr_t addr; \
    105                 addr.s_addr = IPC_GET_ARG4(*call); \
     127                addr.s_addr = IPC_GET_ARG4(call); \
    106128                addr; \
    107129        })
    108130
    109 /** Returns the protocol message parameter.
    110  * @param[in] call The message call structure.
     131/** Return the protocol message parameter.
     132 *
     133 * @param[in] call Message call structure.
     134 *
    111135 */
    112 #define IP_GET_PROTOCOL(call) \
    113         ({ \
    114                 ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); \
    115                 protocol; \
    116         })
     136#define IP_GET_PROTOCOL(call)  ((ip_protocol_t) IPC_GET_ARG1(call))
    117137
    118138/*@}*/
  • uspace/lib/c/include/ipc/ipc.h

    rcead2aa r357b5f5  
    4444#define IPC_FLAG_BLOCKING  0x01
    4545
    46 typedef sysarg_t ipcarg_t;
    47 
    4846typedef struct {
    49         ipcarg_t args[IPC_CALL_LEN];
    50         ipcarg_t in_phone_hash;
     47        sysarg_t args[IPC_CALL_LEN];
     48        sysarg_t in_phone_hash;
    5149} ipc_call_t;
    5250
     
    183181            (arg4), (arg5), (res1), (res2), (res3), (res4), (res5))
    184182
    185 extern int ipc_call_sync_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
    186     ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *);
    187 
    188 extern int ipc_call_sync_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
    189     ipcarg_t, ipcarg_t, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *,
    190     ipcarg_t *);
     183extern int ipc_call_sync_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     184    sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
     185
     186extern int ipc_call_sync_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     187    sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
     188    sysarg_t *);
    191189
    192190extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
     
    220218        ipc_answer_slow((callid), (retval), (arg1), (arg2), (arg3), (arg4), (arg5))
    221219
    222 extern ipcarg_t ipc_answer_fast(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t,
    223     ipcarg_t, ipcarg_t);
    224 extern ipcarg_t ipc_answer_slow(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t,
    225     ipcarg_t, ipcarg_t, ipcarg_t);
     220extern sysarg_t ipc_answer_fast(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     221    sysarg_t, sysarg_t);
     222extern sysarg_t ipc_answer_slow(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
     223    sysarg_t, sysarg_t, sysarg_t);
    226224
    227225/*
     
    255253            (arg4), (arg5), (private), (callback), (can_preempt))
    256254
    257 extern void ipc_call_async_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
    258     ipcarg_t, void *, ipc_async_callback_t, int);
    259 extern void ipc_call_async_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t,
    260     ipcarg_t, ipcarg_t, void *, ipc_async_callback_t, int);
    261 
    262 extern int ipc_connect_to_me(int, int, int, int, ipcarg_t *);
     255extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     256    sysarg_t, void *, ipc_async_callback_t, int);
     257extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     258    sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
     259
     260extern int ipc_connect_to_me(int, int, int, int, sysarg_t *);
    263261extern int ipc_connect_me_to(int, int, int, int);
    264262extern int ipc_connect_me_to_blocking(int, int, int, int);
     
    266264extern int ipc_register_irq(int, int, int, irq_code_t *);
    267265extern int ipc_unregister_irq(int, int);
    268 extern int ipc_forward_fast(ipc_callid_t, int, int, ipcarg_t, ipcarg_t, int);
    269 extern int ipc_forward_slow(ipc_callid_t, int, int, ipcarg_t, ipcarg_t,
    270     ipcarg_t, ipcarg_t, ipcarg_t, int);
     266extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
     267extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
     268    sysarg_t, sysarg_t, sysarg_t, int);
    271269
    272270/*
     
    282280        ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    283281
    284 extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *);
     282extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
    285283extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
    286284extern int ipc_share_out_start(int, void *, int);
  • uspace/lib/c/include/ipc/irc.h

    rcead2aa r357b5f5  
    3131 */
    3232/** @file
    33  */ 
     33 */
    3434
    35 #ifndef LIBC_BUS_H_
    36 #define LIBC_BUS_H_
     35#ifndef LIBC_IRC_H_
     36#define LIBC_IRC_H_
    3737
    3838#include <ipc/ipc.h>
    3939
    4040typedef enum {
    41         BUS_CLEAR_INTERRUPT = IPC_FIRST_USER_METHOD
    42 } bus_request_t;
     41        IRC_ENABLE_INTERRUPT = IPC_FIRST_USER_METHOD,
     42        IRC_CLEAR_INTERRUPT
     43} irc_request_t;
    4344
    4445#endif
  • uspace/lib/c/include/ipc/net.h

    rcead2aa r357b5f5  
    4444#include <net/packet.h>
    4545
    46 /** Returns a value indicating whether the value is in the interval.
    47  * @param[in] item      The value to be checked.
    48  * @param[in] first_inclusive The first value in the interval inclusive.
    49  * @param[in] last_exclusive The first value after the interval.
     46/** Return a value indicating whether the value is in the interval.
     47 *
     48 * @param[in] item            Value to be checked.
     49 * @param[in] first_inclusive First value in the interval inclusive.
     50 * @param[in] last_exclusive  First value after the interval.
     51 *
    5052 */
    5153#define IS_IN_INTERVAL(item, first_inclusive, last_exclusive) \
     
    5557/*@{*/
    5658
    57 /** The number of ARP messages. */
    58 #define NET_ARP_COUNT           5
    59 
    60 /** The number of Ethernet messages. */
    61 #define NET_ETH_COUNT           0
    62 
    63 /** The number of ICMP messages. */
    64 #define NET_ICMP_COUNT          6
    65 
    66 /** The number of inter-network messages. */
    67 #define NET_IL_COUNT            6
    68 
    69 /** The number of IP messages. */
    70 #define NET_IP_COUNT            4
    71 
    72 /** The number of general networking messages. */
    73 #define NET_NET_COUNT           3
    74 
    75 /** The number of network interface driver messages. */
    76 #define NET_NETIF_COUNT         6
    77 
    78 /** The number of network interface layer messages. */
    79 #define NET_NIL_COUNT           7
    80 
    81 /** The number of packet management system messages. */
    82 #define NET_PACKET_COUNT        5
    83 
    84 /** The number of socket messages. */
    85 #define NET_SOCKET_COUNT        14
    86 
    87 /** The number of TCP messages. */
    88 #define NET_TCP_COUNT           0
    89 
    90 /** The number of transport layer messages. */
    91 #define NET_TL_COUNT            1
    92 
    93 /** The number of UDP messages. */
    94 #define NET_UDP_COUNT           0
     59#define NET_ARP_COUNT     5   /**< Number of ARP messages. */
     60#define NET_ETH_COUNT     0   /**< Number of Ethernet messages. */
     61#define NET_ICMP_COUNT    6   /**< Number of ICMP messages. */
     62#define NET_IL_COUNT      6   /**< Number of inter-network messages. */
     63#define NET_IP_COUNT      4   /**< Number of IP messages. */
     64#define NET_NET_COUNT     3   /**< Number of general networking messages. */
     65#define NET_NETIF_COUNT   6   /**< Number of network interface driver messages. */
     66#define NET_NIL_COUNT     7   /**< Number of network interface layer messages. */
     67#define NET_PACKET_COUNT  5   /**< Number of packet management system messages. */
     68#define NET_SOCKET_COUNT  14  /**< Number of socket messages. */
     69#define NET_TCP_COUNT     0   /**< Number of TCP messages. */
     70#define NET_TL_COUNT      1   /**< Number of transport layer messages. */
     71#define NET_UDP_COUNT     0   /**< Number of UDP messages. */
    9572
    9673/*@}*/
     
    10077/*@{*/
    10178
    102 /** The first networking message. */
    103 #define NET_FIRST               2000
    104 
    105 /** The first network interface layer message. */
    106 #define NET_NETIF_FIRST         NET_FIRST
    107 
    108 /** The last network interface layer message. */
    109 #define NET_NETIF_LAST          (NET_NETIF_FIRST + NET_NETIF_COUNT)
    110 
    111 /** The first general networking message. */
    112 #define NET_NET_FIRST           (NET_NETIF_LAST + 0)
    113 
    114 /** The last general networking message. */
    115 #define NET_NET_LAST            (NET_NET_FIRST + NET_NET_COUNT)
    116 
    117 /** The first network interface layer message. */
    118 #define NET_NIL_FIRST           (NET_NET_LAST + 0)
    119 
    120 /** The last network interface layer message. */
    121 #define NET_NIL_LAST            (NET_NIL_FIRST + NET_NIL_COUNT)
    122 
    123 /** The first Ethernet message. */
    124 #define NET_ETH_FIRST           (NET_NIL_LAST + 0)
    125 
    126 /** The last Ethernet message. */
    127 #define NET_ETH_LAST            (NET_ETH_FIRST + NET_ETH_COUNT)
    128 
    129 /** The first inter-network message. */
    130 #define NET_IL_FIRST            (NET_ETH_LAST + 0)
    131 
    132 /** The last inter-network message. */
    133 #define NET_IL_LAST             (NET_IL_FIRST + NET_IL_COUNT)
    134 
    135 /** The first IP message. */
    136 #define NET_IP_FIRST            (NET_IL_LAST + 0)
    137 
    138 /** The last IP message. */
    139 #define NET_IP_LAST             (NET_IP_FIRST + NET_IP_COUNT)
    140 
    141 /** The first ARP message. */
    142 #define NET_ARP_FIRST           (NET_IP_LAST + 0)
    143 
    144 /** The last ARP message. */
    145 #define NET_ARP_LAST            (NET_ARP_FIRST + NET_ARP_COUNT)
    146 
    147 /** The first ICMP message. */
    148 #define NET_ICMP_FIRST          (NET_ARP_LAST + 0)
    149 
    150 /** The last ICMP message. */
    151 #define NET_ICMP_LAST           (NET_ICMP_FIRST + NET_ICMP_COUNT)
    152 
    153 /** The first ICMP message. */
    154 #define NET_TL_FIRST            (NET_ICMP_LAST + 0)
    155 
    156 /** The last ICMP message. */
    157 #define NET_TL_LAST             (NET_TL_FIRST + NET_TL_COUNT)
    158 
    159 /** The first UDP message. */
    160 #define NET_UDP_FIRST           (NET_TL_LAST + 0)
    161 
    162 /** The last UDP message. */
    163 #define NET_UDP_LAST            (NET_UDP_FIRST + NET_UDP_COUNT)
    164 
    165 /** The first TCP message. */
    166 #define NET_TCP_FIRST           (NET_UDP_LAST + 0)
    167 
    168 /** The last TCP message. */
    169 #define NET_TCP_LAST            (NET_TCP_FIRST + NET_TCP_COUNT)
    170 
    171 /** The first socket message. */
    172 #define NET_SOCKET_FIRST        (NET_TCP_LAST + 0)
    173 
    174 /** The last socket message. */
    175 #define NET_SOCKET_LAST         (NET_SOCKET_FIRST + NET_SOCKET_COUNT)
    176 
    177 /** The first packet management system message. */
    178 #define NET_PACKET_FIRST        (NET_SOCKET_LAST + 0)
    179 
    180 /** The last packet management system message. */
    181 #define NET_PACKET_LAST         (NET_PACKET_FIRST + NET_PACKET_COUNT)
    182 
    183 /** The last networking message. */
    184 #define NET_LAST                NET_PACKET_LAST
    185 
    186 /** The number of networking messages. */
    187 #define NET_COUNT               (NET_LAST - NET_FIRST)
    188 
    189 /** Returns a value indicating whether the IPC call is a generic networking
    190  * message.
    191  * @param[in] call The IPC call to be checked.
     79
     80/** First networking message. */
     81#define NET_FIRST  2000
     82
     83/** First network interface layer message. */
     84#define NET_NETIF_FIRST  NET_FIRST
     85
     86/** Last network interface layer message. */
     87#define NET_NETIF_LAST  (NET_NETIF_FIRST + NET_NETIF_COUNT)
     88
     89/** First general networking message. */
     90#define NET_NET_FIRST  (NET_NETIF_LAST + 0)
     91
     92/** Last general networking message. */
     93#define NET_NET_LAST  (NET_NET_FIRST + NET_NET_COUNT)
     94
     95/** First network interface layer message. */
     96#define NET_NIL_FIRST  (NET_NET_LAST + 0)
     97
     98/** Last network interface layer message. */
     99#define NET_NIL_LAST  (NET_NIL_FIRST + NET_NIL_COUNT)
     100
     101/** First Ethernet message. */
     102#define NET_ETH_FIRST  (NET_NIL_LAST + 0)
     103
     104/** Last Ethernet message. */
     105#define NET_ETH_LAST  (NET_ETH_FIRST + NET_ETH_COUNT)
     106
     107/** First inter-network message. */
     108#define NET_IL_FIRST  (NET_ETH_LAST + 0)
     109
     110/** Last inter-network message. */
     111#define NET_IL_LAST  (NET_IL_FIRST + NET_IL_COUNT)
     112
     113/** First IP message. */
     114#define NET_IP_FIRST  (NET_IL_LAST + 0)
     115
     116/** Last IP message. */
     117#define NET_IP_LAST  (NET_IP_FIRST + NET_IP_COUNT)
     118
     119/** First ARP message. */
     120#define NET_ARP_FIRST  (NET_IP_LAST + 0)
     121
     122/** Last ARP message. */
     123#define NET_ARP_LAST  (NET_ARP_FIRST + NET_ARP_COUNT)
     124
     125/** First ICMP message. */
     126#define NET_ICMP_FIRST  (NET_ARP_LAST + 0)
     127
     128/** Last ICMP message. */
     129#define NET_ICMP_LAST  (NET_ICMP_FIRST + NET_ICMP_COUNT)
     130
     131/** First ICMP message. */
     132#define NET_TL_FIRST  (NET_ICMP_LAST + 0)
     133
     134/** Last ICMP message. */
     135#define NET_TL_LAST  (NET_TL_FIRST + NET_TL_COUNT)
     136
     137/** First UDP message. */
     138#define NET_UDP_FIRST  (NET_TL_LAST + 0)
     139
     140/** Last UDP message. */
     141#define NET_UDP_LAST  (NET_UDP_FIRST + NET_UDP_COUNT)
     142
     143/** First TCP message. */
     144#define NET_TCP_FIRST  (NET_UDP_LAST + 0)
     145
     146/** Last TCP message. */
     147#define NET_TCP_LAST  (NET_TCP_FIRST + NET_TCP_COUNT)
     148
     149/** First socket message. */
     150#define NET_SOCKET_FIRST  (NET_TCP_LAST + 0)
     151
     152/** Last socket message. */
     153#define NET_SOCKET_LAST  (NET_SOCKET_FIRST + NET_SOCKET_COUNT)
     154
     155/** First packet management system message. */
     156#define NET_PACKET_FIRST  (NET_SOCKET_LAST + 0)
     157
     158/** Last packet management system message. */
     159#define NET_PACKET_LAST  (NET_PACKET_FIRST + NET_PACKET_COUNT)
     160
     161/** Last networking message. */
     162#define NET_LAST  NET_PACKET_LAST
     163
     164/** Number of networking messages. */
     165#define NET_COUNT  (NET_LAST - NET_FIRST)
     166
     167/** Check if the IPC call is a generic networking message.
     168 *
     169 * @param[in] call IPC call to be checked.
     170 *
    192171 */
    193172#define IS_NET_MESSAGE(call) \
    194         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
    195 
    196 /** Returns a value indicating whether the IPC call is an ARP message.
    197  * @param[in] call The IPC call to be checked.
     173        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_FIRST, NET_LAST)
     174
     175/** Check if the IPC call is an ARP message.
     176 *
     177 * @param[in] call IPC call to be checked.
     178 *
    198179 */
    199180#define IS_NET_ARP_MESSAGE(call) \
    200         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
    201 
    202 /** Returns a value indicating whether the IPC call is an Ethernet message.
    203  * @param[in] call The IPC call to be checked.
     181        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ARP_FIRST, NET_ARP_LAST)
     182
     183/** Check if the IPC call is an Ethernet message.
     184 *
     185 * @param[in] call IPC call to be checked.
     186 *
    204187 */
    205188#define IS_NET_ETH_MESSAGE(call) \
    206         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
    207 
    208 /** Returns a value indicating whether the IPC call is an ICMP message.
    209  * @param[in] call The IPC call to be checked.
     189        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ETH_FIRST, NET_ETH_LAST)
     190
     191/** Check if the IPC call is an ICMP message.
     192 *
     193 * @param[in] call IPC call to be checked.
     194 *
    210195 */
    211196#define IS_NET_ICMP_MESSAGE(call) \
    212         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
    213 
    214 /** Returns a value indicating whether the IPC call is an inter-network layer
    215  * message.
    216  * @param[in] call The IPC call to be checked.
     197        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_ICMP_FIRST, NET_ICMP_LAST)
     198
     199/** Check if the IPC call is an inter-network layer message.
     200 *
     201 * @param[in] call IPC call to be checked.
     202 *
    217203 */
    218204#define IS_NET_IL_MESSAGE(call) \
    219         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
    220 
    221 /** Returns a value indicating whether the IPC call is an IP message.
    222  * @param[in] call The IPC call to be checked.
     205        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IL_FIRST, NET_IL_LAST)
     206
     207/** Check if the IPC call is an IP message.
     208 *
     209 * @param[in] call IPC call to be checked.
     210 *
    223211 */
    224212#define IS_NET_IP_MESSAGE(call) \
    225         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
    226 
    227 /** Returns a value indicating whether the IPC call is a generic networking
    228  * message.
    229  * @param[in] call The IPC call to be checked.
     213        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_IP_FIRST, NET_IP_LAST)
     214
     215/** Check if the IPC call is a generic networking message.
     216 *
     217 * @param[in] call IPC call to be checked.
     218 *
    230219 */
    231220#define IS_NET_NET_MESSAGE(call) \
    232         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST)
    233 
    234 /** Returns a value indicating whether the IPC call is a network interface layer
    235  * message.
    236  * @param[in] call The IPC call to be checked.
     221        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NET_FIRST, NET_NET_LAST)
     222
     223/** Check if the IPC call is a network interface layer message.
     224 *
     225 * @param[in] call IPC call to be checked.
     226 *
    237227 */
    238228#define IS_NET_NIL_MESSAGE(call) \
    239         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
    240 
    241 /** Returns a value indicating whether the IPC call is a packet manaagement
    242  * system message.
    243  * @param[in] call The IPC call to be checked.
     229        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_NIL_FIRST, NET_NIL_LAST)
     230
     231/** Check if the IPC call is a packet manaagement system message.
     232 *
     233 * @param[in] call IPC call to be checked.
     234 *
    244235 */
    245236#define IS_NET_PACKET_MESSAGE(call) \
    246         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
    247 
    248 /** Returns a value indicating whether the IPC call is a socket message.
    249  * @param[in] call The IPC call to be checked.
     237        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_PACKET_FIRST, NET_PACKET_LAST)
     238
     239/** Check if the IPC call is a socket message.
     240 *
     241 * @param[in] call IPC call to be checked.
     242 *
    250243 */
    251244#define IS_NET_SOCKET_MESSAGE(call) \
    252         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
    253 
    254 /** Returns a value indicating whether the IPC call is a TCP message.
    255  * @param[in] call The IPC call to be checked.
     245        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
     246
     247/** Check if the IPC call is a TCP message.
     248 *
     249 * @param[in] call IPC call to be checked.
     250 *
    256251 */
    257252#define IS_NET_TCP_MESSAGE(call) \
    258         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
    259 
    260 /** Returns a value indicating whether the IPC call is a transport layer message.
    261  * @param[in] call The IPC call to be checked.
     253        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TCP_FIRST, NET_TCP_LAST)
     254
     255/** Check if the IPC call is a transport layer message.
     256 *
     257 * @param[in] call IPC call to be checked.
     258 *
    262259 */
    263260#define IS_NET_TL_MESSAGE(call) \
    264         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST)
    265 
    266 /** Returns a value indicating whether the IPC call is a UDP message.
    267  * @param[in] call The IPC call to be checked.
     261        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_TL_FIRST, NET_TL_LAST)
     262
     263/** Check if the IPC call is a UDP message.
     264 *
     265 * @param[in] call IPC call to be checked.
     266 *
    268267 */
    269268#define IS_NET_UDP_MESSAGE(call) \
    270         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
     269        IS_IN_INTERVAL(IPC_GET_IMETHOD(call), NET_UDP_FIRST, NET_UDP_LAST)
    271270
    272271/*@}*/
     
    275274/*@{*/
    276275
    277 /** Returns the device identifier message argument.
    278  * @param[in] call The message call structure.
    279  */
    280 #define IPC_GET_DEVICE(call) \
    281         ({ \
    282                 device_id_t device_id = (device_id_t) IPC_GET_ARG1(*call); \
    283                 device_id; \
    284         })
    285 
    286 /** Returns the packet identifier message argument.
    287  * @param[in] call The message call structure.
    288  */
    289 #define IPC_GET_PACKET(call) \
    290         ({ \
    291                 packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); \
    292                 packet_id; \
    293         })
    294 
    295 /** Returns the count message argument.
    296  * @param[in] call The message call structure.
    297  */
    298 #define IPC_GET_COUNT(call) \
    299         ({ \
    300                 size_t size = (size_t) IPC_GET_ARG2(*call); \
    301                 size; \
    302         })
    303 
    304 /** Returns the device state message argument.
    305  * @param[in] call The message call structure.
    306  */
    307 #define IPC_GET_STATE(call) \
    308         ({ \
    309                 device_state_t state = (device_state_t) IPC_GET_ARG2(*call); \
    310                 state; \
    311         })
    312 
    313 /** Returns the maximum transmission unit message argument.
    314  * @param[in] call The message call structure.
    315  */
    316 #define IPC_GET_MTU(call) \
    317         ({ \
    318                 size_t size = (size_t) IPC_GET_ARG2(*call); \
    319                 size; \
    320         })
    321 
    322 /** Returns the device driver service message argument.
    323  * @param[in] call The message call structure.
    324  */
    325 #define IPC_GET_SERVICE(call) \
    326         ({ \
    327                 services_t service = (services_t) IPC_GET_ARG3(*call); \
    328                 service; \
    329         })
    330 
    331 /** Returns the target service message argument.
    332  * @param[in] call The message call structure.
    333  */
    334 #define IPC_GET_TARGET(call) \
    335         ({ \
    336                 services_t service = (services_t) IPC_GET_ARG3(*call); \
    337                 service; \
    338         })
    339 
    340 /** Returns the sender service message argument.
    341  * @param[in] call The message call structure.
    342  */
    343 #define IPC_GET_SENDER(call) \
    344         ({ \
    345                 services_t service = (services_t) IPC_GET_ARG3(*call); \
    346                 service; \
    347         })
    348 
    349 /** Returns the error service message argument.
    350  * @param[in] call The message call structure.
    351  */
    352 #define IPC_GET_ERROR(call) \
    353         ({ \
    354                 services_t service = (services_t) IPC_GET_ARG4(*call); \
    355                 service; \
    356         })
    357 
    358 /** Returns the phone message argument.
    359  * @param[in] call The message call structure.
    360  */
    361 #define IPC_GET_PHONE(call) \
    362         ({ \
    363                 int phone = (int) IPC_GET_ARG5(*call); \
    364                 phone; \
    365         })
    366 
    367 /** Sets the device identifier in the message answer.
    368  * @param[out] answer The message answer structure.
    369  */
    370 #define IPC_SET_DEVICE(answer, value) \
    371         do { \
    372                 ipcarg_t argument = (ipcarg_t) (value); \
    373                 IPC_SET_ARG1(*answer, argument); \
    374         } while (0)
    375 
    376 /** Sets the minimum address length in the message answer.
    377  * @param[out] answer The message answer structure.
    378  */
    379 #define IPC_SET_ADDR(answer, value) \
    380         do { \
    381                 ipcarg_t argument = (ipcarg_t) (value); \
    382                 IPC_SET_ARG1(*answer, argument); \
    383         } while (0)
    384 
    385 /** Sets the minimum prefix size in the message answer.
    386  * @param[out] answer The message answer structure.
    387  */
    388 #define IPC_SET_PREFIX(answer, value) \
    389         do { \
    390                 ipcarg_t argument = (ipcarg_t) (value); \
    391                 IPC_SET_ARG2(*answer, argument); \
    392         } while (0)
    393 
    394 /** Sets the maximum content size in the message answer.
    395  * @param[out] answer The message answer structure.
    396  */
    397 #define IPC_SET_CONTENT(answer, value) \
    398         do { \
    399                 ipcarg_t argument = (ipcarg_t) (value); \
    400                 IPC_SET_ARG3(*answer, argument); \
    401         } while (0)
    402 
    403 /** Sets the minimum suffix size in the message answer.
    404  * @param[out] answer The message answer structure.
    405  */
    406 #define IPC_SET_SUFFIX(answer, value) \
    407         do { \
    408                 ipcarg_t argument = (ipcarg_t) (value); \
    409                 IPC_SET_ARG4(*answer, argument); \
    410         } while (0)
     276/** Return the device identifier message argument.
     277 *
     278 * @param[in] call Message call structure.
     279 *
     280 */
     281#define IPC_GET_DEVICE(call)  ((device_id_t) IPC_GET_ARG1(call))
     282
     283/** Return the packet identifier message argument.
     284 *
     285 * @param[in] call Message call structure.
     286 *
     287 */
     288#define IPC_GET_PACKET(call)  ((packet_id_t) IPC_GET_ARG2(call))
     289
     290/** Return the count message argument.
     291 *
     292 * @param[in] call Message call structure.
     293 *
     294 */
     295#define IPC_GET_COUNT(call)  ((size_t) IPC_GET_ARG2(call))
     296
     297/** Return the device state message argument.
     298 *
     299 * @param[in] call Message call structure.
     300 *
     301 */
     302#define IPC_GET_STATE(call)  ((device_state_t) IPC_GET_ARG2(call))
     303
     304/** Return the maximum transmission unit message argument.
     305 *
     306 * @param[in] call Message call structure.
     307 *
     308 */
     309#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG2(call))
     310
     311/** Return the device driver service message argument.
     312 *
     313 * @param[in] call Message call structure.
     314 *
     315 */
     316#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
     317
     318/** Return the target service message argument.
     319 *
     320 * @param[in] call Message call structure.
     321 *
     322 */
     323#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
     324
     325/** Return the sender service message argument.
     326 *
     327 * @param[in] call Message call structure.
     328 *
     329 */
     330#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
     331
     332/** Return the error service message argument.
     333 &
     334 * @param[in] call Message call structure.
     335 *
     336 */
     337#define IPC_GET_ERROR(call)  ((services_t) IPC_GET_ARG4(call))
     338
     339/** Return the phone message argument.
     340 *
     341 * @param[in] call Message call structure.
     342 *
     343 */
     344#define IPC_GET_PHONE(call)  ((int) IPC_GET_ARG5(call))
     345
     346/** Set the device identifier in the message answer.
     347 *
     348 * @param[out] answer Message answer structure.
     349 * @param[in]  value  Value to set.
     350 *
     351 */
     352#define IPC_SET_DEVICE(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
     353
     354/** Set the minimum address length in the message answer.
     355 *
     356 * @param[out] answer Message answer structure.
     357 * @param[in]  value  Value to set.
     358 *
     359 */
     360#define IPC_SET_ADDR(answer, value)  IPC_SET_ARG1(answer, (sysarg_t) (value))
     361
     362/** Set the minimum prefix size in the message answer.
     363 *
     364 * @param[out] answer Message answer structure.
     365 * @param[in]  value  Value to set.
     366 *
     367 */
     368#define IPC_SET_PREFIX(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
     369
     370/** Set the maximum content size in the message answer.
     371 *
     372 * @param[out] answer Message answer structure.
     373 * @param[in]  value  Value to set.
     374 *
     375 */
     376#define IPC_SET_CONTENT(answer, value)  IPC_SET_ARG3(answer, (sysarg_t) (value))
     377
     378/** Set the minimum suffix size in the message answer.
     379 *
     380 * @param[out] answer Message answer structure.
     381 * @param[in]  value  Value to set.
     382 *
     383 */
     384#define IPC_SET_SUFFIX(answer, value)  IPC_SET_ARG4(answer, (sysarg_t) (value))
    411385
    412386/*@}*/
  • uspace/lib/c/include/ipc/netif.h

    rcead2aa r357b5f5  
    4747         */
    4848        NET_NETIF_PROBE = NET_NETIF_FIRST,
     49       
    4950        /** Send packet message.
    5051         * @see netif_send_msg()
    5152         */
    5253        NET_NETIF_SEND,
     54       
    5355        /** Start device message.
    5456         * @see netif_start_req()
    5557         */
    5658        NET_NETIF_START,
     59       
    5760        /** Get device usage statistics message.
    5861         * @see netif_stats_req()
    5962         */
    6063        NET_NETIF_STATS,
     64       
    6165        /** Stop device message.
    6266         * @see netif_stop_req()
    6367         */
    6468        NET_NETIF_STOP,
     69       
    6570        /** Get device address message.
    6671         * @see netif_get_addr_req()
     
    7378
    7479/** Return the interrupt number message parameter.
    75  * @param[in] call The message call structure.
     80 *
     81 * @param[in] call Mmessage call structure.
     82 *
    7683 */
    77 #define NETIF_GET_IRQ(call) \
    78         ({ \
    79                 int irq = (int) IPC_GET_ARG2(*call); \
    80                 irq; \
    81         })
     84#define NETIF_GET_IRQ(call) ((int) IPC_GET_ARG2(call))
    8285
    8386/** Return the input/output address message parameter.
    84  * @param[in] call The message call structure.
     87 *
     88 * @param[in] call Message call structure.
     89 *
    8590 */
    86 #define NETIF_GET_IO(call) \
    87         ({ \
    88                 int io = (int) IPC_GET_ARG3(*call); \
    89                 io; \
    90         })
     91#define NETIF_GET_IO(call) ((void *) IPC_GET_ARG3(call))
    9192
    9293/*@}*/
  • uspace/lib/c/include/ipc/nil.h

    rcead2aa r357b5f5  
    7777
    7878/** Return the protocol service message parameter. */
    79 #define NIL_GET_PROTO(call) \
    80         ({ \
    81                 services_t service = (services_t) IPC_GET_ARG2(*call); \
    82                 service; \
    83         })
     79#define NIL_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
    8480
    8581/*@}*/
  • uspace/lib/c/include/ipc/packet.h

    rcead2aa r357b5f5  
    7070} packet_messages;
    7171
    72 /** Returns the protocol service message parameter. */
    73 #define ARP_GET_PROTO(call)     (services_t) IPC_GET_ARG2(*call)
     72/** Return the protocol service message parameter. */
     73#define ARP_GET_PROTO(call)  ((services_t) IPC_GET_ARG2(call))
    7474
    75 /** Returns the packet identifier message parameter. */
    76 #define IPC_GET_ID(call)        (packet_id_t) IPC_GET_ARG1(*call)
     75/** Return the packet identifier message parameter. */
     76#define IPC_GET_ID(call)  ((packet_id_t) IPC_GET_ARG1(call))
    7777
    78 /** Returns the maximal content length message parameter. */
    79 #define IPC_GET_CONTENT(call)   (size_t) IPC_GET_ARG1(*call)
     78/** Return the maximal content length message parameter. */
     79#define IPC_GET_CONTENT(call)  ((size_t) IPC_GET_ARG1(call))
    8080
    81 /** Returns the maximal address length message parameter. */
    82 #define IPC_GET_ADDR_LEN(call)  (size_t) IPC_GET_ARG2(*call)
     81/** Return the maximal address length message parameter. */
     82#define IPC_GET_ADDR_LEN(call)  ((size_t) IPC_GET_ARG2(call))
    8383
    84 /** Returns the maximal prefix length message parameter. */
    85 #define IPC_GET_PREFIX(call)    (size_t) IPC_GET_ARG3(*call)
     84/** Return the maximal prefix length message parameter. */
     85#define IPC_GET_PREFIX(call)  ((size_t) IPC_GET_ARG3(call))
    8686
    87 /** Returns the maximal suffix length message parameter. */
    88 #define IPC_GET_SUFFIX(call)    (size_t) IPC_GET_ARG4(*call)
     87/** Return the maximal suffix length message parameter. */
     88#define IPC_GET_SUFFIX(call)  ((size_t) IPC_GET_ARG4(call))
    8989
    9090#endif
  • uspace/lib/c/include/ipc/services.h

    rcead2aa r357b5f5  
    4949        SERVICE_FHC,
    5050        SERVICE_OBIO,
     51        SERVICE_APIC,
     52        SERVICE_I8259,
    5153        SERVICE_CLIPBOARD,
    5254        SERVICE_NETWORKING,
    5355        SERVICE_LO,
    54         SERVICE_DP8390,
     56        SERVICE_NE2000,
    5557        SERVICE_ETHERNET,
    5658        SERVICE_NILDUMMY,
  • uspace/lib/c/include/ipc/socket.h

    rcead2aa r357b5f5  
    8484#define SOCKET_SET_SOCKET_ID(answer, value) \
    8585        do { \
    86                 ipcarg_t argument = (ipcarg_t) (value); \
     86                sysarg_t argument = (sysarg_t) (value); \
    8787                IPC_SET_ARG1(answer, argument); \
    8888        } while (0)
     
    102102#define SOCKET_SET_READ_DATA_LENGTH(answer, value) \
    103103        do { \
    104                 ipcarg_t argument = (ipcarg_t) (value); \
     104                sysarg_t argument = (sysarg_t) (value); \
    105105                IPC_SET_ARG1(answer, argument); \
    106106        } while (0)
     
    147147#define SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) \
    148148        do { \
    149                 ipcarg_t argument = (ipcarg_t) (value); \
     149                sysarg_t argument = (sysarg_t) (value); \
    150150                IPC_SET_ARG2(answer, argument); \
    151151        } while (0)
     
    156156#define SOCKET_SET_ADDRESS_LENGTH(answer, value) \
    157157        do { \
    158                 ipcarg_t argument = (ipcarg_t) (value); \
     158                sysarg_t argument = (sysarg_t) (value); \
    159159                IPC_SET_ARG3(answer, argument);\
    160160        } while (0)
     
    174174#define SOCKET_SET_HEADER_SIZE(answer, value) \
    175175        do { \
    176                 ipcarg_t argument = (ipcarg_t) (value); \
     176                sysarg_t argument = (sysarg_t) (value); \
    177177                IPC_SET_ARG3(answer, argument); \
    178178        } while (0)
  • uspace/lib/c/include/libc.h

    rcead2aa r357b5f5  
    4040#include <libarch/syscall.h>
    4141
     42#ifdef __32_BITS__
     43
     44/** Explicit 64-bit arguments passed to syscalls. */
     45typedef uint64_t sysarg64_t;
     46
     47#endif /* __32_BITS__ */
     48
    4249#define __SYSCALL0(id) \
    4350        __syscall0(0, 0, 0, 0, 0, 0, id)
     
    5360        __syscall5(p1, p2, p3, p4, p5, 0, id)
    5461#define __SYSCALL6(id, p1, p2, p3, p4, p5, p6) \
    55     __syscall6(p1, p2, p3, p4, p5, p6, id)
     62        __syscall6(p1, p2, p3, p4, p5, p6, id)
    5663
    5764extern void __main(void *pcb_ptr);
  • uspace/lib/c/include/mem.h

    rcead2aa r357b5f5  
    4444extern void *memmove(void *, const void *, size_t);
    4545
    46 extern int bcmp(const char *, const char *, size_t);
     46extern int bcmp(const void *, const void *, size_t);
    4747
    4848#endif
  • uspace/lib/c/include/net/icmp_common.h

    rcead2aa r357b5f5  
    4141#include <sys/time.h>
    4242
    43 /** Default timeout for incoming connections in microseconds. */
    44 #define ICMP_CONNECT_TIMEOUT    (1 * 1000 * 1000)
     43/** Default timeout for incoming connections in microseconds (1 sec). */
     44#define ICMP_CONNECT_TIMEOUT  1000000
    4545
    46 extern int icmp_connect_module(services_t, suseconds_t);
     46extern int icmp_connect_module(suseconds_t);
    4747
    4848#endif
  • uspace/lib/c/include/net/in.h

    rcead2aa r357b5f5  
    4343
    4444/** INET string address maximum length. */
    45 #define INET_ADDRSTRLEN         (4 * 3 + 3 + 1)
     45#define INET_ADDRSTRLEN  (4 * 3 + 3 + 1)
    4646
    4747/** Type definition of the INET address.
    4848 * @see in_addr
    4949 */
    50 typedef struct in_addr          in_addr_t;
     50typedef struct in_addr in_addr_t;
    5151
    5252/** Type definition of the INET socket address.
  • uspace/lib/c/include/net/modules.h

    rcead2aa r357b5f5  
    4949#include <sys/time.h>
    5050
    51 /** Converts the data length between different types.
    52  *
    53  * @param[in] type_from The source type.
    54  * @param[in] type_to   The destination type.
    55  * @param[in] count     The number units of the source type size.
    56  */
    57 #define CONVERT_SIZE(type_from, type_to, count) \
    58         ((sizeof(type_from) / sizeof(type_to)) * (count))
    59 
    60 /** Registers the module service at the name server.
    61  *
    62  * @param[in] me        The module service.
    63  * @param[out] phonehash The created phone hash.
    64  */
    65 #define REGISTER_ME(me, phonehash) \
    66         ipc_connect_to_me(PHONE_NS, (me), 0, 0, (phonehash))
    67 
    6851/** Connect to the needed module function type definition.
    6952 *
    70  * @param[in] need      The needed module service.
    71  * @return              The phone of the needed service.
     53 * @param[in] need The needed module service.
     54 *
     55 * @return The phone of the needed service.
     56 *
    7257 */
    7358typedef int connect_module_t(services_t need);
    7459
    75 extern void answer_call(ipc_callid_t, int, ipc_call_t *, int);
    76 extern int bind_service(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
     60extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t);
     61extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
    7762    async_client_conn_t);
    78 extern int bind_service_timeout(services_t, ipcarg_t, ipcarg_t, ipcarg_t,
     63extern int bind_service_timeout(services_t, sysarg_t, sysarg_t, sysarg_t,
    7964    async_client_conn_t, suseconds_t);
    8065extern int connect_to_service(services_t);
    8166extern int connect_to_service_timeout(services_t, suseconds_t);
    82 extern int data_receive(void **, size_t *);
    8367extern int data_reply(void *, size_t);
    84 extern void refresh_answer(ipc_call_t *, int *);
     68extern void refresh_answer(ipc_call_t *, size_t *);
    8569
    8670#endif
  • uspace/lib/c/include/net/socket.h

    rcead2aa r357b5f5  
    6060extern int sendto(int, const void *, size_t, int, const struct sockaddr *,
    6161    socklen_t);
    62 extern int recv(int, void *, size_t, int);
    63 extern int recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
     62extern ssize_t recv(int, void *, size_t, int);
     63extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
    6464extern int getsockopt(int, int, int, void *, size_t *);
    6565extern int setsockopt(int, int, int, const void *, size_t);
  • uspace/lib/c/include/stdlib.h

    rcead2aa r357b5f5  
    4646        } while (0)
    4747
     48#define core() \
     49        *((int *) 0) = 0xbadbad;
     50
    4851#define exit(status)  _exit((status))
    4952
  • uspace/lib/c/include/task.h

    rcead2aa r357b5f5  
    4747extern task_id_t task_get_id(void);
    4848extern int task_set_name(const char *);
     49extern int task_kill(task_id_t);
     50
    4951extern task_id_t task_spawn(const char *, const char *const[], int *);
    5052extern int task_spawnv(task_id_t *, const char *path, const char *const []);
Note: See TracChangeset for help on using the changeset viewer.