Changeset b0f00a9 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2011-11-06T22:21:05Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
898e847
Parents:
2bdf8313 (diff), 7b5f4c9 (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:
13 added
1 deleted
58 edited
5 moved

Legend:

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

    r2bdf8313 rb0f00a9  
    3838#include <adt/list.h>
    3939#include <unistd.h>
     40#include <bool.h>
    4041
    4142typedef unsigned long hash_count_t;
     
    7475/** Hash table structure. */
    7576typedef struct {
    76         link_t *entry;
     77        list_t *entry;
    7778        hash_count_t entries;
    7879        hash_count_t max_keys;
     
    8384    list_get_instance((item), type, member)
    8485
    85 extern int hash_table_create(hash_table_t *, hash_count_t, hash_count_t,
     86extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t,
    8687    hash_table_operations_t *);
     88extern void hash_table_clear(hash_table_t *);
    8789extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *);
    8890extern link_t *hash_table_find(hash_table_t *, unsigned long []);
  • uspace/lib/c/include/adt/list.h

    r2bdf8313 rb0f00a9  
    11/*
    22 * Copyright (c) 2001-2004 Jakub Jermar
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3637#define LIBC_LIST_H_
    3738
     39#include <assert.h>
    3840#include <unistd.h>
    3941
    40 /** Doubly linked list head and link type. */
     42/** Doubly linked list link. */
    4143typedef struct link {
    4244        struct link *prev;  /**< Pointer to the previous item in the list. */
     
    4446} link_t;
    4547
     48/** Doubly linked list. */
     49typedef struct list {
     50        link_t head;  /**< List head. Does not have any data. */
     51} list_t;
     52
    4653/** Declare and initialize statically allocated list.
    4754 *
     
    5057 */
    5158#define LIST_INITIALIZE(name) \
    52         link_t name = { \
    53                 .prev = &name, \
    54                 .next = &name \
     59        list_t name = { \
     60                .head = { \
     61                        .prev = &(name).head, \
     62                        .next = &(name).head \
     63                } \
    5564        }
    5665
     
    5968
    6069#define list_foreach(list, iterator) \
    61         for (link_t *iterator = (list).next; \
    62             iterator != &(list); iterator = iterator->next)
     70        for (link_t *iterator = (list).head.next; \
     71            iterator != &(list).head; iterator = iterator->next)
     72
     73#define assert_link_not_used(link) \
     74        assert(((link)->prev == NULL) && ((link)->next == NULL))
    6375
    6476/** Initialize doubly-linked circular list link
     
    7991 * Initialize doubly-linked circular list.
    8092 *
    81  * @param list Pointer to link_t structure representing the list.
    82  *
    83  */
    84 static inline void list_initialize(link_t *list)
    85 {
    86         list->prev = list;
    87         list->next = list;
     93 * @param list Pointer to list_t structure.
     94 *
     95 */
     96static inline void list_initialize(list_t *list)
     97{
     98        list->head.prev = &list->head;
     99        list->head.next = &list->head;
     100}
     101
     102/** Insert item before another item in doubly-linked circular list.
     103 *
     104 */
     105static inline void list_insert_before(link_t *lnew, link_t *lold)
     106{
     107        lnew->next = lold;
     108        lnew->prev = lold->prev;
     109        lold->prev->next = lnew;
     110        lold->prev = lnew;
     111}
     112
     113/** Insert item after another item in doubly-linked circular list.
     114 *
     115 */
     116static inline void list_insert_after(link_t *lnew, link_t *lold)
     117{
     118        lnew->prev = lold;
     119        lnew->next = lold->next;
     120        lold->next->prev = lnew;
     121        lold->next = lnew;
    88122}
    89123
     
    93127 *
    94128 * @param link Pointer to link_t structure to be added.
    95  * @param list Pointer to link_t structure representing the list.
    96  *
    97  */
    98 static inline void list_prepend(link_t *link, link_t *list)
    99 {
    100         link->next = list->next;
    101         link->prev = list;
    102         list->next->prev = link;
    103         list->next = link;
     129 * @param list Pointer to list_t structure.
     130 *
     131 */
     132static inline void list_prepend(link_t *link, list_t *list)
     133{
     134        list_insert_after(link, &list->head);
    104135}
    105136
     
    109140 *
    110141 * @param link Pointer to link_t structure to be added.
    111  * @param list Pointer to link_t structure representing the list.
    112  *
    113  */
    114 static inline void list_append(link_t *link, link_t *list)
    115 {
    116         link->prev = list->prev;
    117         link->next = list;
    118         list->prev->next = link;
    119         list->prev = link;
    120 }
    121 
    122 /** Insert item before another item in doubly-linked circular list.
    123  *
    124  */
    125 static inline void list_insert_before(link_t *link, link_t *list)
    126 {
    127         list_append(link, list);
    128 }
    129 
    130 /** Insert item after another item in doubly-linked circular list.
    131  *
    132  */
    133 static inline void list_insert_after(link_t *link, link_t *list)
    134 {
    135         list_prepend(list, link);
     142 * @param list Pointer to list_t structure.
     143 *
     144 */
     145static inline void list_append(link_t *link, list_t *list)
     146{
     147        list_insert_before(link, &list->head);
    136148}
    137149
     
    146158static inline void list_remove(link_t *link)
    147159{
    148         link->next->prev = link->prev;
    149         link->prev->next = link->next;
     160        if ((link->prev != NULL) && (link->next != NULL)) {
     161                link->next->prev = link->prev;
     162                link->prev->next = link->next;
     163        }
     164       
    150165        link_initialize(link);
    151166}
     
    155170 * Query emptiness of doubly-linked circular list.
    156171 *
    157  * @param list Pointer to link_t structure representing the list.
    158  *
    159  */
    160 static inline int list_empty(link_t *list)
    161 {
    162         return (list->next == list);
    163 }
    164 
    165 /** Get head item of a list.
    166  *
    167  * @param list Pointer to link_t structure representing the list.
     172 * @param list Pointer to lins_t structure.
     173 *
     174 */
     175static inline int list_empty(const list_t *list)
     176{
     177        return (list->head.next == &list->head);
     178}
     179
     180/** Get first item in list.
     181 *
     182 * @param list Pointer to list_t structure.
    168183 *
    169184 * @return Head item of the list.
     
    171186 *
    172187 */
    173 static inline link_t *list_head(link_t *list)
    174 {
    175         return ((list->next == list) ? NULL : list->next);
     188static inline link_t *list_first(const list_t *list)
     189{
     190        return ((list->head.next == &list->head) ? NULL : list->head.next);
     191}
     192
     193/** Get last item in list.
     194 *
     195 * @param list Pointer to list_t structure.
     196 *
     197 * @return Head item of the list.
     198 * @return NULL if the list is empty.
     199 *
     200 */
     201static inline link_t *list_last(list_t *list)
     202{
     203        return ((list->head.prev == &list->head) ? NULL : list->head.prev);
    176204}
    177205
     
    230258}
    231259
    232 /** Get n-th item of a list.
     260/** Get n-th item in a list.
    233261 *
    234262 * @param list Pointer to link_t structure representing the list.
     
    239267 *
    240268 */
    241 static inline link_t *list_nth(link_t *list, unsigned int n)
     269static inline link_t *list_nth(list_t *list, unsigned int n)
    242270{
    243271        unsigned int cnt = 0;
     
    253281}
    254282
    255 extern int list_member(const link_t *, const link_t *);
    256 extern void list_concat(link_t *, link_t *);
    257 extern unsigned int list_count(const link_t *);
     283extern int list_member(const link_t *, const list_t *);
     284extern void list_concat(list_t *, list_t *);
     285extern unsigned int list_count(const list_t *);
    258286
    259287#endif
  • uspace/lib/c/include/adt/measured_strings.h

    r2bdf8313 rb0f00a9  
    4141
    4242#include <sys/types.h>
     43#include <async.h>
    4344
    4445/** Type definition of the character string with measured length.
     
    6465extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t);
    6566extern int measured_strings_reply(const measured_string_t *, size_t);
    66 extern int measured_strings_return(int, measured_string_t **, uint8_t **, size_t);
    67 extern int measured_strings_send(int, const measured_string_t *, size_t);
     67
     68extern int measured_strings_return(async_exch_t *, measured_string_t **,
     69    uint8_t **, size_t);
     70extern int measured_strings_send(async_exch_t *, const measured_string_t *,
     71    size_t);
    6872
    6973#endif
  • uspace/lib/c/include/adt/prodcons.h

    r2bdf8313 rb0f00a9  
    4242        fibril_mutex_t mtx;
    4343        fibril_condvar_t cv;
    44         link_t list;
     44        list_t list;
    4545} prodcons_t;
    4646
  • uspace/lib/c/include/as.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
     39#include <abi/mm/as.h>
    3940#include <task.h>
    40 #include <kernel/mm/as.h>
    4141#include <libarch/config.h>
    4242
     
    6060extern void *set_maxheapsize(size_t);
    6161extern void *as_get_mappable_page(size_t);
     62extern int as_get_physical_mapping(const void *, uintptr_t *);
    6263
    6364#endif
  • uspace/lib/c/include/assert.h

    r2bdf8313 rb0f00a9  
    4747 */
    4848
    49 #define STR(l)  #l
    50 #define STR2(l) STR(l)
    51 
    5249#ifndef NDEBUG
    5350
     
    5552        do { \
    5653                if (!(expr)) \
    57                         assert_abort(#expr, __FILE__, STR2(__LINE__)); \
     54                        assert_abort(#expr, __FILE__, __LINE__); \
    5855        } while (0)
    5956
     
    6461#endif /* NDEBUG */
    6562
    66 extern void assert_abort(const char *, const char *, const char *)
     63extern void assert_abort(const char *, const char *, unsigned int)
    6764    __attribute__((noreturn));
    68 
    6965
    7066#endif
  • uspace/lib/c/include/async.h

    r2bdf8313 rb0f00a9  
    4141
    4242#include <ipc/common.h>
    43 #include <async_sess.h>
    4443#include <fibril.h>
    4544#include <sys/time.h>
     
    5352typedef void (*async_client_data_dtor_t)(void *);
    5453
    55 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
     54/** Client connection handler
     55 *
     56 * @param callid ID of incoming call or 0 if connection initiated from
     57 *               inside using async_connect_to_me()
     58 * @param call   Incoming call or 0 if connection initiated from inside
     59 * @param arg    Local argument passed from async_new_connection() or
     60 *               async_connect_to_me()
     61 */
     62typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *);
     63
     64/** Interrupt handler */
     65typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *);
     66
     67/** Exchange management style
     68 *
     69 */
     70typedef enum {
     71        /** No explicit exchange management
     72         *
     73         * Suitable for protocols which use a single
     74         * IPC message per exchange only.
     75         *
     76         */
     77        EXCHANGE_ATOMIC = 0,
     78       
     79        /** Exchange management via phone cloning
     80         *
     81         * Suitable for servers which support client
     82         * data tracking by task hashes and do not
     83         * mind cloned phones.
     84         *
     85         */
     86        EXCHANGE_PARALLEL,
     87       
     88        /** Exchange management via mutual exclusion
     89         *
     90         * Suitable for any kind of client/server communication,
     91         * but can limit parallelism.
     92         *
     93         */
     94        EXCHANGE_SERIALIZE
     95} exch_mgmt_t;
     96
     97/** Forward declarations */
     98struct async_exch;
     99struct async_sess;
     100
     101typedef struct async_sess async_sess_t;
     102typedef struct async_exch async_exch_t;
    56103
    57104extern atomic_t threads_in_ipc_wait;
     
    68115 * User-friendly wrappers for async_send_fast() and async_send_slow(). The
    69116 * macros are in the form async_send_m(), where m denotes the number of payload
    70  * arguments.  Each macros chooses between the fast and the slow version based
     117 * arguments. Each macros chooses between the fast and the slow version based
    71118 * on m.
    72119 */
    73120
    74 #define async_send_0(phoneid, method, dataptr) \
    75         async_send_fast((phoneid), (method), 0, 0, 0, 0, (dataptr))
    76 #define async_send_1(phoneid, method, arg1, dataptr) \
    77         async_send_fast((phoneid), (method), (arg1), 0, 0, 0, (dataptr))
    78 #define async_send_2(phoneid, method, arg1, arg2, dataptr) \
    79         async_send_fast((phoneid), (method), (arg1), (arg2), 0, 0, (dataptr))
    80 #define async_send_3(phoneid, method, arg1, arg2, arg3, dataptr) \
    81         async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (dataptr))
    82 #define async_send_4(phoneid, method, arg1, arg2, arg3, arg4, dataptr) \
    83         async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    84             (dataptr))
    85 #define async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
    86         async_send_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    87             (arg5), (dataptr))
    88 
    89 extern aid_t async_send_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    90     sysarg_t, ipc_call_t *);
    91 extern aid_t async_send_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     121#define async_send_0(exch, method, dataptr) \
     122        async_send_fast(exch, method, 0, 0, 0, 0, dataptr)
     123#define async_send_1(exch, method, arg1, dataptr) \
     124        async_send_fast(exch, method, arg1, 0, 0, 0, dataptr)
     125#define async_send_2(exch, method, arg1, arg2, dataptr) \
     126        async_send_fast(exch, method, arg1, arg2, 0, 0, dataptr)
     127#define async_send_3(exch, method, arg1, arg2, arg3, dataptr) \
     128        async_send_fast(exch, method, arg1, arg2, arg3, 0, dataptr)
     129#define async_send_4(exch, method, arg1, arg2, arg3, arg4, dataptr) \
     130        async_send_fast(exch, method, arg1, arg2, arg3, arg4, dataptr)
     131#define async_send_5(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
     132        async_send_slow(exch, method, arg1, arg2, arg3, arg4, arg5, dataptr)
     133
     134extern aid_t async_send_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
    92135    sysarg_t, sysarg_t, ipc_call_t *);
     136extern aid_t async_send_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     137    sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
     138
    93139extern void async_wait_for(aid_t, sysarg_t *);
    94140extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
    95141
    96 extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t,
    97     ipc_call_t *, void (*)(ipc_callid_t, ipc_call_t *));
     142extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t,
     143    ipc_call_t *, async_client_conn_t, void *);
     144
    98145extern void async_usleep(suseconds_t);
    99146extern void async_create_manager(void);
     
    102149extern void async_set_client_data_constructor(async_client_data_ctor_t);
    103150extern void async_set_client_data_destructor(async_client_data_dtor_t);
    104 
    105 extern void *async_client_data_get(void);
     151extern void *async_get_client_data(void);
     152extern void *async_get_client_data_by_id(task_id_t);
     153extern void async_put_client_data_by_id(task_id_t);
    106154
    107155extern void async_set_client_connection(async_client_conn_t);
    108 extern void async_set_interrupt_received(async_client_conn_t);
     156extern void async_set_interrupt_received(async_interrupt_handler_t);
    109157
    110158/*
     
    112160 */
    113161
    114 extern void async_msg_0(int, sysarg_t);
    115 extern void async_msg_1(int, sysarg_t, sysarg_t);
    116 extern void async_msg_2(int, sysarg_t, sysarg_t, sysarg_t);
    117 extern void async_msg_3(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
    118 extern void async_msg_4(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
    119 extern void async_msg_5(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     162extern void async_msg_0(async_exch_t *, sysarg_t);
     163extern void async_msg_1(async_exch_t *, sysarg_t, sysarg_t);
     164extern void async_msg_2(async_exch_t *, sysarg_t, sysarg_t, sysarg_t);
     165extern void async_msg_3(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
     166extern void async_msg_4(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    120167    sysarg_t);
     168extern void async_msg_5(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     169    sysarg_t, sysarg_t);
    121170
    122171/*
     
    138187 */
    139188
    140 extern int async_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    141     unsigned int);
    142 extern int async_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
    143     sysarg_t, sysarg_t, sysarg_t, unsigned int);
     189extern int async_forward_fast(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
     190    sysarg_t, unsigned int);
     191extern int async_forward_slow(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t,
     192    sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
    144193
    145194/*
     
    150199 */
    151200
    152 #define async_req_0_0(phoneid, method) \
    153         async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
    154             NULL)
    155 #define async_req_0_1(phoneid, method, r1) \
    156         async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), NULL, NULL, NULL, \
    157             NULL)
    158 #define async_req_0_2(phoneid, method, r1, r2) \
    159         async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), NULL, NULL, \
    160             NULL)
    161 #define async_req_0_3(phoneid, method, r1, r2, r3) \
    162         async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), NULL, \
    163             NULL)
    164 #define async_req_0_4(phoneid, method, r1, r2, r3, r4) \
    165         async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
    166             NULL)
    167 #define async_req_0_5(phoneid, method, r1, r2, r3, r4, r5) \
    168         async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \
    169             (r5))
    170 #define async_req_1_0(phoneid, method, arg1) \
    171         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, NULL, NULL, NULL, \
    172             NULL, NULL)
    173 #define async_req_1_1(phoneid, method, arg1, rc1) \
    174         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), NULL, NULL, \
    175             NULL, NULL)
    176 #define async_req_1_2(phoneid, method, arg1, rc1, rc2) \
    177         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), NULL, \
    178             NULL, NULL)
    179 #define async_req_1_3(phoneid, method, arg1, rc1, rc2, rc3) \
    180         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
    181             NULL, NULL)
    182 #define async_req_1_4(phoneid, method, arg1, rc1, rc2, rc3, rc4) \
    183         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
    184             (rc4), NULL)
    185 #define async_req_1_5(phoneid, method, arg1, rc1, rc2, rc3, rc4, rc5) \
    186         async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \
    187             (rc4), (rc5))
    188 #define async_req_2_0(phoneid, method, arg1, arg2) \
    189         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL, NULL, \
     201#define async_req_0_0(exch, method) \
     202        async_req_fast(exch, method, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)
     203#define async_req_0_1(exch, method, r1) \
     204        async_req_fast(exch, method, 0, 0, 0, 0, r1, NULL, NULL, NULL, NULL)
     205#define async_req_0_2(exch, method, r1, r2) \
     206        async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, NULL, NULL, NULL)
     207#define async_req_0_3(exch, method, r1, r2, r3) \
     208        async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, NULL, NULL)
     209#define async_req_0_4(exch, method, r1, r2, r3, r4) \
     210        async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, NULL)
     211#define async_req_0_5(exch, method, r1, r2, r3, r4, r5) \
     212        async_req_fast(exch, method, 0, 0, 0, 0, r1, r2, r3, r4, r5)
     213
     214#define async_req_1_0(exch, method, arg1) \
     215        async_req_fast(exch, method, arg1, 0, 0, 0, NULL, NULL, NULL, NULL, \
     216            NULL)
     217#define async_req_1_1(exch, method, arg1, rc1) \
     218        async_req_fast(exch, method, arg1, 0, 0, 0, rc1, NULL, NULL, NULL, \
     219            NULL)
     220#define async_req_1_2(exch, method, arg1, rc1, rc2) \
     221        async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, NULL, NULL, \
     222            NULL)
     223#define async_req_1_3(exch, method, arg1, rc1, rc2, rc3) \
     224        async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, NULL, \
     225            NULL)
     226#define async_req_1_4(exch, method, arg1, rc1, rc2, rc3, rc4) \
     227        async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
     228            NULL)
     229#define async_req_1_5(exch, method, arg1, rc1, rc2, rc3, rc4, rc5) \
     230        async_req_fast(exch, method, arg1, 0, 0, 0, rc1, rc2, rc3, rc4, \
     231            rc5)
     232
     233#define async_req_2_0(exch, method, arg1, arg2) \
     234        async_req_fast(exch, method, arg1, arg2, 0, 0, NULL, NULL, NULL, \
     235            NULL, NULL)
     236#define async_req_2_1(exch, method, arg1, arg2, rc1) \
     237        async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, NULL, NULL, \
     238            NULL, NULL)
     239#define async_req_2_2(exch, method, arg1, arg2, rc1, rc2) \
     240        async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, NULL, NULL, \
     241            NULL)
     242#define async_req_2_3(exch, method, arg1, arg2, rc1, rc2, rc3) \
     243        async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, NULL, \
     244            NULL)
     245#define async_req_2_4(exch, method, arg1, arg2, rc1, rc2, rc3, rc4) \
     246        async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
     247            NULL)
     248#define async_req_2_5(exch, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
     249        async_req_fast(exch, method, arg1, arg2, 0, 0, rc1, rc2, rc3, rc4, \
     250            rc5)
     251
     252#define async_req_3_0(exch, method, arg1, arg2, arg3) \
     253        async_req_fast(exch, method, arg1, arg2, arg3, 0, NULL, NULL, NULL, \
     254            NULL, NULL)
     255#define async_req_3_1(exch, method, arg1, arg2, arg3, rc1) \
     256        async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, NULL, NULL, \
     257            NULL, NULL)
     258#define async_req_3_2(exch, method, arg1, arg2, arg3, rc1, rc2) \
     259        async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, NULL, \
     260            NULL, NULL)
     261#define async_req_3_3(exch, method, arg1, arg2, arg3, rc1, rc2, rc3) \
     262        async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
     263            NULL, NULL)
     264#define async_req_3_4(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
     265        async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
     266            rc4, NULL)
     267#define async_req_3_5(exch, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
     268    rc5) \
     269        async_req_fast(exch, method, arg1, arg2, arg3, 0, rc1, rc2, rc3, \
     270            rc4, rc5)
     271
     272#define async_req_4_0(exch, method, arg1, arg2, arg3, arg4) \
     273        async_req_fast(exch, method, arg1, arg2, arg3, arg4, NULL, NULL, \
    190274            NULL, NULL, NULL)
    191 #define async_req_2_1(phoneid, method, arg1, arg2, rc1) \
    192         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), NULL, \
     275#define async_req_4_1(exch, method, arg1, arg2, arg3, arg4, rc1) \
     276        async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, NULL, \
    193277            NULL, NULL, NULL)
    194 #define async_req_2_2(phoneid, method, arg1, arg2, rc1, rc2) \
    195         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
     278#define async_req_4_2(exch, method, arg1, arg2, arg3, arg4, rc1, rc2) \
     279        async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, NULL, \
     280            NULL, NULL)
     281#define async_req_4_3(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
     282        async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
     283            NULL, NULL)
     284#define async_req_4_4(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
     285    rc4) \
     286        async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
     287            rc4, NULL)
     288#define async_req_4_5(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
     289    rc4, rc5) \
     290        async_req_fast(exch, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
     291            rc4, rc5)
     292
     293#define async_req_5_0(exch, method, arg1, arg2, arg3, arg4, arg5) \
     294        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, NULL, \
     295            NULL, NULL, NULL, NULL)
     296#define async_req_5_1(exch, method, arg1, arg2, arg3, arg4, arg5, rc1) \
     297        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, \
     298            NULL, NULL, NULL, NULL)
     299#define async_req_5_2(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
     300        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
    196301            NULL, NULL, NULL)
    197 #define async_req_2_3(phoneid, method, arg1, arg2, rc1, rc2, rc3) \
    198         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
    199             (rc3), NULL, NULL)
    200 #define async_req_2_4(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4) \
    201         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
    202             (rc3), (rc4), NULL)
    203 #define async_req_2_5(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \
    204         async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \
    205             (rc3), (rc4), (rc5))
    206 #define async_req_3_0(phoneid, method, arg1, arg2, arg3) \
    207         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, NULL, NULL, \
    208             NULL, NULL, NULL)
    209 #define async_req_3_1(phoneid, method, arg1, arg2, arg3, rc1) \
    210         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
    211             NULL, NULL, NULL, NULL)
    212 #define async_req_3_2(phoneid, method, arg1, arg2, arg3, rc1, rc2) \
    213         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
    214             (rc2), NULL, NULL, NULL)
    215 #define async_req_3_3(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3) \
    216         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
    217             (rc2), (rc3), NULL, NULL)
    218 #define async_req_3_4(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \
    219         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
    220             (rc2), (rc3), (rc4), NULL)
    221 #define async_req_3_5(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \
    222     rc5) \
    223         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \
    224             (rc2), (rc3), (rc4), (rc5))
    225 #define async_req_4_0(phoneid, method, arg1, arg2, arg3, arg4) \
    226         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
    227             NULL, NULL, NULL, NULL)
    228 #define async_req_4_1(phoneid, method, arg1, arg2, arg3, arg4, rc1) \
    229         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
    230             NULL, NULL, NULL, NULL)
    231 #define async_req_4_2(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2) \
    232         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
    233             (rc2), NULL, NULL, NULL)
    234 #define async_req_4_3(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \
    235         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \
    236             (rc2), (rc3), NULL, NULL)
    237 #define async_req_4_4(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
    238     rc4) \
    239         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    240             (rc1), (rc2), (rc3), (rc4), NULL)
    241 #define async_req_4_5(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \
    242     rc4, rc5) \
    243         async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    244             (rc1), (rc2), (rc3), (rc4), (rc5))
    245 #define async_req_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \
    246         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    247             (arg5), NULL, NULL, NULL, NULL, NULL)
    248 #define async_req_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1) \
    249         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    250             (arg5), (rc1), NULL, NULL, NULL, NULL)
    251 #define async_req_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \
    252         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    253             (arg5), (rc1), (rc2), NULL, NULL, NULL)
    254 #define async_req_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     302#define async_req_5_3(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
    255303    rc3) \
    256         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    257             (arg5), (rc1), (rc2), (rc3), NULL, NULL)
    258 #define async_req_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     304        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     305            rc3, NULL, NULL)
     306#define async_req_5_4(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
    259307    rc3, rc4) \
    260         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    261             (arg5), (rc1), (rc2), (rc3), (rc4), NULL)
    262 #define async_req_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     308        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     309            rc3, rc4, NULL)
     310#define async_req_5_5(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
    263311    rc3, rc4, rc5) \
    264         async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
    265             (arg5), (rc1), (rc2), (rc3), (rc4), (rc5))
    266 
    267 extern sysarg_t async_req_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
    268     sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
    269 extern sysarg_t async_req_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
     312        async_req_slow(exch, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \
     313            rc3, rc4, rc5)
     314
     315extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
    270316    sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
    271317    sysarg_t *);
    272 
    273 static inline void async_serialize_start(void)
    274 {
    275         fibril_inc_sercount();
    276 }
    277 
    278 static inline void async_serialize_end(void)
    279 {
    280         fibril_dec_sercount();
    281 }
    282 
    283 extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t,
    284     async_client_conn_t);
    285 extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    286 extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
    287 extern int async_connect_kbox(task_id_t);
    288 extern int async_hangup(int);
     318extern sysarg_t async_req_slow(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     319    sysarg_t, sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *,
     320    sysarg_t *, sysarg_t *);
     321
     322extern async_sess_t *async_connect_me(exch_mgmt_t, async_exch_t *);
     323extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
     324    sysarg_t, sysarg_t);
     325extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *,
     326    sysarg_t, sysarg_t, sysarg_t);
     327extern async_sess_t *async_connect_kbox(task_id_t);
     328
     329extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t,
     330    async_client_conn_t, void *);
     331
     332extern int async_hangup(async_sess_t *);
    289333extern void async_poke(void);
    290334
     335extern async_exch_t *async_exchange_begin(async_sess_t *);
     336extern void async_exchange_end(async_exch_t *);
     337
     338/*
     339 * FIXME These functions just work around problems with parallel exchange
     340 * management. Proper solution needs to be implemented.
     341 */
     342void async_sess_args_set(async_sess_t *sess, sysarg_t, sysarg_t, sysarg_t);
     343
    291344/*
    292345 * User-friendly wrappers for async_share_in_start().
    293346 */
    294347
    295 #define async_share_in_start_0_0(phoneid, dst, size) \
    296         async_share_in_start((phoneid), (dst), (size), 0, NULL)
    297 #define async_share_in_start_0_1(phoneid, dst, size, flags) \
    298         async_share_in_start((phoneid), (dst), (size), 0, (flags))
    299 #define async_share_in_start_1_0(phoneid, dst, size, arg) \
    300         async_share_in_start((phoneid), (dst), (size), (arg), NULL)
    301 #define async_share_in_start_1_1(phoneid, dst, size, arg, flags) \
    302         async_share_in_start((phoneid), (dst), (size), (arg), (flags))
    303 
    304 extern int async_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
     348#define async_share_in_start_0_0(exch, dst, size) \
     349        async_share_in_start(exch, dst, size, 0, NULL)
     350#define async_share_in_start_0_1(exch, dst, size, flags) \
     351        async_share_in_start(exch, dst, size, 0, flags)
     352#define async_share_in_start_1_0(exch, dst, size, arg) \
     353        async_share_in_start(exch, dst, size, arg, NULL)
     354#define async_share_in_start_1_1(exch, dst, size, arg, flags) \
     355        async_share_in_start(exch, dst, size, arg, flags)
     356
     357extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t,
     358    unsigned int *);
    305359extern bool async_share_in_receive(ipc_callid_t *, size_t *);
    306360extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
    307361
    308 extern int async_share_out_start(int, void *, unsigned int);
     362extern int async_share_out_start(async_exch_t *, void *, unsigned int);
    309363extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
    310364extern int async_share_out_finalize(ipc_callid_t, void *);
     
    314368 */
    315369
    316 #define async_data_read_forward_0_0(phoneid, method, answer) \
    317         async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
    318 #define async_data_read_forward_0_1(phoneid, method, answer) \
    319         async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
    320 #define async_data_read_forward_1_0(phoneid, method, arg1, answer) \
    321         async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
    322 #define async_data_read_forward_1_1(phoneid, method, arg1, answer) \
    323         async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer))
    324 #define async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) \
    325         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL)
    326 #define async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) \
    327         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
    328             (answer))
    329 #define async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
    330         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
    331             NULL)
    332 #define async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
    333         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \
    334             (answer))
    335 #define async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
    336         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    337             (arg4), NULL)
    338 #define async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
    339         async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    340             (arg4), (answer))
    341 
    342 #define async_data_read_start(p, buf, len) \
    343         async_data_read_start_generic((p), (buf), (len), IPC_XF_NONE)
    344 
    345 extern int async_data_read_start_generic(int, void *, size_t, int);
     370#define async_data_read_forward_0_0(exch, method, answer) \
     371        async_data_read_forward_fast(exch, method, 0, 0, 0, 0, NULL)
     372#define async_data_read_forward_0_1(exch, method, answer) \
     373        async_data_read_forward_fast(exch, method, 0, 0, 0, 0, answer)
     374#define async_data_read_forward_1_0(exch, method, arg1, answer) \
     375        async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
     376#define async_data_read_forward_1_1(exch, method, arg1, answer) \
     377        async_data_read_forward_fast(exch, method, arg1, 0, 0, 0, answer)
     378#define async_data_read_forward_2_0(exch, method, arg1, arg2, answer) \
     379        async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
     380#define async_data_read_forward_2_1(exch, method, arg1, arg2, answer) \
     381        async_data_read_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
     382#define async_data_read_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
     383        async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, NULL)
     384#define async_data_read_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
     385        async_data_read_forward_fast(exch, method, arg1, arg2, arg3, 0, \
     386            answer)
     387#define async_data_read_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
     388    answer) \
     389        async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
     390            NULL)
     391#define async_data_read_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
     392    answer) \
     393        async_data_read_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
     394            answer)
     395
     396extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *);
     397extern int async_data_read_start(async_exch_t *, void *, size_t);
    346398extern bool async_data_read_receive(ipc_callid_t *, size_t *);
    347399extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    348400
    349 extern int async_data_read_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
    350     sysarg_t, sysarg_t, ipc_call_t *);
     401extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
     402    sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
    351403
    352404/*
     
    354406 */
    355407
    356 #define async_data_write_forward_0_0(phoneid, method, answer) \
    357         async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
    358 #define async_data_write_forward_0_1(phoneid, method, answer) \
    359         async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer))
    360 #define async_data_write_forward_1_0(phoneid, method, arg1, answer) \
    361         async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL)
    362 #define async_data_write_forward_1_1(phoneid, method, arg1, answer) \
    363         async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, \
    364             (answer))
    365 #define async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) \
    366         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
    367             NULL)
    368 #define async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) \
    369         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \
    370             (answer))
    371 #define async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \
    372         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    373             0, NULL)
    374 #define async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \
    375         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    376             0, (answer))
    377 #define async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \
    378         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    379             (arg4), NULL)
    380 #define async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \
    381         async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \
    382             (arg4), (answer))
    383 
    384 #define async_data_write_start(p, buf, len) \
    385         async_data_write_start_generic((p), (buf), (len), IPC_XF_NONE)
    386 
    387 extern int async_data_write_start_generic(int, const void *, size_t, int);
     408#define async_data_write_forward_0_0(exch, method, answer) \
     409        async_data_write_forward_fast(exch, method, 0, 0, 0, 0, NULL)
     410#define async_data_write_forward_0_1(exch, method, answer) \
     411        async_data_write_forward_fast(exch, method, 0, 0, 0, 0, answer)
     412#define async_data_write_forward_1_0(exch, method, arg1, answer) \
     413        async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, NULL)
     414#define async_data_write_forward_1_1(exch, method, arg1, answer) \
     415        async_data_write_forward_fast(exch, method, arg1, 0, 0, 0, answer)
     416#define async_data_write_forward_2_0(exch, method, arg1, arg2, answer) \
     417        async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, NULL)
     418#define async_data_write_forward_2_1(exch, method, arg1, arg2, answer) \
     419        async_data_write_forward_fast(exch, method, arg1, arg2, 0, 0, answer)
     420#define async_data_write_forward_3_0(exch, method, arg1, arg2, arg3, answer) \
     421        async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
     422            NULL)
     423#define async_data_write_forward_3_1(exch, method, arg1, arg2, arg3, answer) \
     424        async_data_write_forward_fast(exch, method, arg1, arg2, arg3, 0, \
     425            answer)
     426#define async_data_write_forward_4_0(exch, method, arg1, arg2, arg3, arg4, \
     427    answer) \
     428        async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
     429            NULL)
     430#define async_data_write_forward_4_1(exch, method, arg1, arg2, arg3, arg4, \
     431    answer) \
     432        async_data_write_forward_fast(exch, method, arg1, arg2, arg3, arg4, \
     433            answer)
     434
     435extern int async_data_write_start(async_exch_t *, const void *, size_t);
    388436extern bool async_data_write_receive(ipc_callid_t *, size_t *);
    389437extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
     
    393441extern void async_data_write_void(sysarg_t);
    394442
    395 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
    396     sysarg_t, sysarg_t, ipc_call_t *);
     443extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t,
     444    sysarg_t, sysarg_t, sysarg_t, ipc_call_t *);
     445
     446extern int async_exchange_clone(async_exch_t *, async_exch_t *);
     447extern async_sess_t *async_clone_receive(exch_mgmt_t);
     448extern async_sess_t *async_callback_receive(exch_mgmt_t);
     449extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *);
     450
     451extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t,
     452    sysarg_t, async_exch_t *);
     453extern bool async_state_change_receive(ipc_callid_t *, sysarg_t *, sysarg_t *,
     454    sysarg_t *);
     455extern int async_state_change_finalize(ipc_callid_t, async_exch_t *);
     456
     457extern void *async_remote_state_acquire(async_sess_t *);
     458extern void async_remote_state_update(async_sess_t *, void *);
     459extern void async_remote_state_release(async_sess_t *);
     460extern void async_remote_state_release_exchange(async_exch_t *);
    397461
    398462#endif
  • uspace/lib/c/include/bitops.h

    r2bdf8313 rb0f00a9  
    3838#include <sys/types.h>
    3939
     40/** Mask with bit @a n set. */
     41#define BIT_V(type, n) \
     42    ((type)1 << ((n) - 1))
     43
     44/** Mask with rightmost @a n bits set. */
     45#define BIT_RRANGE(type, n) \
     46    (BIT_V(type, (n) + 1) - 1)
     47
     48/** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */
     49#define BIT_RANGE(type, hi, lo) \
     50    (BIT_RRANGE(type, (hi) - (lo) + 1) << (lo))
     51
     52/** Extract range of bits @a hi .. @a lo from @a value. */
     53#define BIT_RANGE_EXTRACT(type, hi, lo, value) \
     54    (((value) >> (lo)) & BIT_RRANGE(type, (hi) - (lo) + 1))
    4055
    4156/** Return position of first non-zero bit from left (i.e. [log_2(arg)]).
  • uspace/lib/c/include/bool.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <libarch/types.h>
     39#include <abi/bool.h>
    3940
    4041#define false  0
    4142#define true   1
    42 
    43 typedef uint8_t bool;
    4443
    4544#endif
  • uspace/lib/c/include/ddi.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
    39 #include <kernel/ddi/irq.h>
     39#include <abi/ddi/irq.h>
    4040#include <task.h>
    4141
  • uspace/lib/c/include/device/char_dev.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_DEVICE_CHAR_DEV_H_
    3737
     38#include <async.h>
     39
    3840typedef enum {
    3941        CHAR_DEV_READ = 0,
     
    4143} char_dev_method_t;
    4244
    43 ssize_t char_dev_read(int dev_phone, void *buf, size_t len);
    44 ssize_t char_dev_write(int dev_phone, void *buf, size_t len);
     45extern ssize_t char_dev_read(async_sess_t *, void *, size_t);
     46extern ssize_t char_dev_write(async_sess_t *, void *, size_t);
    4547
    4648#endif
  • uspace/lib/c/include/device/hw_res.h

    r2bdf8313 rb0f00a9  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28  
     28
    2929/** @addtogroup libc
    3030 * @{
     
    3232/** @file
    3333 */
    34  
     34
    3535#ifndef LIBC_DEVICE_HW_RES_H_
    3636#define LIBC_DEVICE_HW_RES_H_
    3737
    3838#include <ipc/dev_iface.h>
     39#include <async.h>
    3940#include <bool.h>
    4041
     
    4849typedef enum {
    4950        INTERRUPT,
    50         IO_RANGE, 
     51        IO_RANGE,
    5152        MEM_RANGE
    5253} hw_res_type_t;
     
    6667                        size_t size;
    6768                } mem_range;
    68 
     69               
    6970                struct {
    7071                        uint64_t address;
     
    7273                        size_t size;
    7374                } io_range;
    74 
     75               
    7576                struct {
    7677                        int irq;
     
    8889        if (hw_res->resources != NULL) {
    8990                free(hw_res->resources);
    90 
    9191                hw_res->resources = NULL;
    9292        }
    93 
     93       
    9494        hw_res->count = 0;
    9595}
    9696
    97 extern int hw_res_get_resource_list(int, hw_resource_list_t *);
    98 extern bool hw_res_enable_interrupt(int);
     97extern int hw_res_get_resource_list(async_sess_t *, hw_resource_list_t *);
     98extern bool hw_res_enable_interrupt(async_sess_t *);
    9999
    100100#endif
  • uspace/lib/c/include/devman.h

    r2bdf8313 rb0f00a9  
    3838
    3939#include <ipc/devman.h>
     40#include <ipc/loc.h>
    4041#include <async.h>
    4142#include <bool.h>
    4243
    43 extern int devman_get_phone(devman_interface_t, unsigned int);
    44 extern void devman_hangup_phone(devman_interface_t);
     44extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t);
     45extern async_exch_t *devman_exchange_begin(devman_interface_t);
     46extern void devman_exchange_end(async_exch_t *);
    4547
    4648extern int devman_driver_register(const char *, async_client_conn_t);
    4749extern int devman_add_function(const char *, fun_type_t, match_id_list_t *,
    4850    devman_handle_t, devman_handle_t *);
     51extern int devman_remove_function(devman_handle_t);
     52extern int devman_drv_fun_online(devman_handle_t);
     53extern int devman_drv_fun_offline(devman_handle_t);
    4954
    50 extern int devman_device_connect(devman_handle_t, unsigned int);
    51 extern int devman_parent_device_connect(devman_handle_t, unsigned int);
     55extern async_sess_t *devman_device_connect(exch_mgmt_t, devman_handle_t,
     56    unsigned int);
     57extern async_sess_t *devman_parent_device_connect(exch_mgmt_t, devman_handle_t,
     58    unsigned int);
    5259
    53 extern int devman_device_get_handle(const char *, devman_handle_t *,
     60extern int devman_fun_get_handle(const char *, devman_handle_t *,
    5461    unsigned int);
    55 extern int devman_device_get_handle_by_class(const char *, const char *,
    56     devman_handle_t *, unsigned int);
     62extern int devman_fun_get_child(devman_handle_t, devman_handle_t *);
     63extern int devman_dev_get_functions(devman_handle_t, devman_handle_t **,
     64    size_t *);
     65extern int devman_fun_get_name(devman_handle_t, char *, size_t);
     66extern int devman_fun_get_path(devman_handle_t, char *, size_t);
     67extern int devman_fun_online(devman_handle_t);
     68extern int devman_fun_offline(devman_handle_t);
    5769
    58 extern int devman_add_device_to_class(devman_handle_t, const char *);
     70extern int devman_add_device_to_category(devman_handle_t, const char *);
     71extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *);
    5972
    6073#endif
  • uspace/lib/c/include/elf/elf.h

    r2bdf8313 rb0f00a9  
    11/*
    2  * Copyright (c) 2010 Jiri Svoboda
     2 * Copyright (c) 2011 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mouse
    30  * @brief
     29/** @addtogroup generic
    3130 * @{
    3231 */
     
    3433 */
    3534
    36 #ifndef ADBDEV_H_
    37 #define ADBDEV_H_
     35#ifndef LIBC_ELF_H_
     36#define LIBC_ELF_H_
    3837
    3938#include <sys/types.h>
    40 
    41 extern int adb_dev_init(void);
     39#include <abi/elf.h>
     40#include <libarch/elf.h>
    4241
    4342#endif
    4443
    45 /**
    46  * @}
    47  */
    48 
     44/** @}
     45 */
  • uspace/lib/c/include/elf/elf_load.h

    r2bdf8313 rb0f00a9  
    11/*
     2 * Copyright (c) 2006 Sergey Bondari
    23 * Copyright (c) 2008 Jiri Svoboda
    34 * All rights reserved.
     
    3738#define ELF_LOAD_H_
    3839
    39 #include <arch/elf.h>
     40#include <elf/elf.h>
    4041#include <sys/types.h>
    4142#include <loader/pcb.h>
    4243
    43 #include "elf.h"
     44/**
     45 * ELF error return codes
     46 */
     47#define EE_OK                   0       /* No error */
     48#define EE_INVALID              1       /* Invalid ELF image */
     49#define EE_MEMORY               2       /* Cannot allocate address space */
     50#define EE_INCOMPATIBLE         3       /* ELF image is not compatible with current architecture */
     51#define EE_UNSUPPORTED          4       /* Non-supported ELF (e.g. dynamic ELFs) */
     52#define EE_LOADER               5       /* The image is actually a program loader. */
     53#define EE_IRRECOVERABLE        6
    4454
    4555typedef enum {
     
    8292} elf_ld_t;
    8393
    84 int elf_load_file(const char *file_name, size_t so_bias, eld_flags_t flags,
    85     elf_info_t *info);
    86 void elf_create_pcb(elf_info_t *info, pcb_t *pcb);
     94extern const char *elf_error(unsigned int);
     95extern int elf_load_file(const char *, size_t, eld_flags_t, elf_info_t *);
     96extern void elf_create_pcb(elf_info_t *, pcb_t *);
    8797
    8898#endif
  • uspace/lib/c/include/errno.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_ERRNO_H_
    3737
    38 #include <kernel/errno.h>
     38#include <abi/errno.h>
    3939#include <fibril.h>
    4040
     
    5555#define EIO           (-265)
    5656#define EMLINK        (-266)
     57#define ENXIO         (-267)
     58
     59/** Bad checksum. */
     60#define EBADCHECKSUM  (-300)
     61
     62/** USB: stalled operation. */
     63#define ESTALL (-301)
     64
     65/** Empty resource (no data). */
     66#define EEMPTY (-302)
     67
     68/** Negative acknowledgment. */
     69#define ENAK (-303)
    5770
    5871/** An API function is called while another blocking function is in progress. */
  • uspace/lib/c/include/event.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_EVENT_H_
    3737
    38 #include <kernel/ipc/event_types.h>
     38#include <abi/ipc/event.h>
     39#include <libarch/types.h>
    3940
    4041extern int event_subscribe(event_type_t, sysarg_t);
     42extern int event_task_subscribe(event_task_type_t, sysarg_t);
    4143extern int event_unmask(event_type_t);
     44extern int event_task_unmask(event_task_type_t);
    4245
    4346#endif
  • uspace/lib/c/include/fibril_synch.h

    r2bdf8313 rb0f00a9  
    4545        fibril_owner_info_t oi;  /**< Keep this the first thing. */
    4646        int counter;
    47         link_t waiters;
     47        list_t waiters;
    4848} fibril_mutex_t;
    4949
     
    5555                .counter = 1, \
    5656                .waiters = { \
    57                         .prev = &name.waiters, \
    58                         .next = &name.waiters, \
     57                        .head = { \
     58                                .prev = &(name).waiters.head, \
     59                                .next = &(name).waiters.head, \
     60                        } \
    5961                } \
    6062        }
     
    6769        unsigned writers;
    6870        unsigned readers;
    69         link_t waiters;
     71        list_t waiters;
    7072} fibril_rwlock_t;
    7173
     
    7880                .writers = 0, \
    7981                .waiters = { \
    80                         .prev = &name.waiters, \
    81                         .next = &name.waiters, \
     82                        .head = { \
     83                                .prev = &(name).waiters.head, \
     84                                .next = &(name).waiters.head, \
     85                        } \
    8286                } \
    8387        }
     
    8791
    8892typedef struct {
    89         link_t waiters;
     93        list_t waiters;
    9094} fibril_condvar_t;
    9195
     
    9397        { \
    9498                .waiters = { \
    95                         .next = &name.waiters, \
    96                         .prev = &name.waiters, \
     99                        .head = { \
     100                                .next = &(name).waiters.head, \
     101                                .prev = &(name).waiters.head, \
     102                        } \
    97103                } \
    98104        }
  • uspace/lib/c/include/io/color.h

    r2bdf8313 rb0f00a9  
    4444        COLOR_MAGENTA = 5,
    4545        COLOR_YELLOW  = 6,
    46         COLOR_WHITE   = 7,
    47        
    48         CATTR_BRIGHT  = 8,
    49         CATTR_BLINK   = 8
     46        COLOR_WHITE   = 7
    5047} console_color_t;
     48
     49typedef enum {
     50        CATTR_NORMAL = 0,
     51        CATTR_BRIGHT = 8,
     52        CATTR_BLINK  = 16
     53} console_color_attr_t;
    5154
    5255#endif
  • uspace/lib/c/include/io/console.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_IO_CONSOLE_H_
    3737
     38#include <sys/time.h>
     39#include <io/keycode.h>
     40#include <async.h>
    3841#include <bool.h>
     42#include <stdio.h>
     43
     44typedef enum {
     45        CONSOLE_CAP_NONE = 0,
     46        CONSOLE_CAP_STYLE = 1,
     47        CONSOLE_CAP_INDEXED = 2,
     48        CONSOLE_CAP_RGB = 4
     49} console_caps_t;
     50
     51/** Console control structure. */
     52typedef struct {
     53        /** Console input file */
     54        FILE *input;
     55       
     56        /** Console output file */
     57        FILE *output;
     58       
     59        /** Console input session */
     60        async_sess_t *input_sess;
     61       
     62        /** Console output session */
     63        async_sess_t *output_sess;
     64       
     65        /** Input request call with timeout */
     66        ipc_call_t input_call;
     67       
     68        /** Input response with timeout */
     69        aid_t input_aid;
     70} console_ctrl_t;
    3971
    4072typedef enum {
    4173        KEY_PRESS,
    4274        KEY_RELEASE
    43 } console_ev_type_t;
    44 
    45 typedef enum {
    46         CONSOLE_CCAP_NONE = 0,
    47         CONSOLE_CCAP_STYLE,
    48         CONSOLE_CCAP_INDEXED,
    49         CONSOLE_CCAP_RGB
    50 } console_caps_t;
     75} kbd_event_type_t;
    5176
    5277/** Console event structure. */
    5378typedef struct {
     79        /** List handle */
     80        link_t link;
     81       
    5482        /** Press or release event. */
    55         console_ev_type_t type;
     83        kbd_event_type_t type;
    5684       
    5785        /** Keycode of the key that was pressed or released. */
    58         unsigned int key;
     86        keycode_t key;
    5987       
    6088        /** Bitmask of modifiers held. */
    61         unsigned int mods;
     89        keymod_t mods;
    6290       
    6391        /** The character that was generated or '\0' for none. */
    6492        wchar_t c;
    65 } console_event_t;
     93} kbd_event_t;
    6694
    67 extern void console_clear(int phone);
     95extern console_ctrl_t *console_init(FILE *, FILE *);
     96extern void console_done(console_ctrl_t *);
     97extern bool console_kcon(void);
    6898
    69 extern int console_get_size(int phone, sysarg_t *cols, sysarg_t *rows);
    70 extern int console_get_pos(int phone, sysarg_t *col, sysarg_t *row);
    71 extern void console_set_pos(int phone, sysarg_t col, sysarg_t row);
     99extern void console_flush(console_ctrl_t *);
     100extern void console_clear(console_ctrl_t *);
    72101
    73 extern void console_set_style(int phone, uint8_t style);
    74 extern void console_set_color(int phone, uint8_t fg_color, uint8_t bg_color,
    75     uint8_t flags);
    76 extern void console_set_rgb_color(int phone, uint32_t fg_color, uint32_t bg_color);
     102extern int console_get_size(console_ctrl_t *, sysarg_t *, sysarg_t *);
     103extern int console_get_pos(console_ctrl_t *, sysarg_t *, sysarg_t *);
     104extern void console_set_pos(console_ctrl_t *, sysarg_t, sysarg_t);
    77105
    78 extern void console_cursor_visibility(int phone, bool show);
    79 extern int console_get_color_cap(int phone, sysarg_t *ccap);
    80 extern void console_kcon_enable(int phone);
     106extern void console_set_style(console_ctrl_t *, uint8_t);
     107extern void console_set_color(console_ctrl_t *, uint8_t, uint8_t, uint8_t);
     108extern void console_set_rgb_color(console_ctrl_t *, uint32_t, uint32_t);
    81109
    82 extern bool console_get_event(int phone, console_event_t *event);
     110extern void console_cursor_visibility(console_ctrl_t *, bool);
     111extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
     112extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
     113extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
     114    suseconds_t *);
    83115
    84116#endif
  • uspace/lib/c/include/io/klog.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
     39#include <stdarg.h>
    3940
    4041extern size_t klog_write(const void *, size_t);
    4142extern void klog_update(void);
     43extern int klog_printf(const char *, ...);
     44extern int klog_vprintf(const char *, va_list);
    4245
    4346#endif
  • uspace/lib/c/include/ipc/bd.h

    r2bdf8313 rb0f00a9  
    4242        BD_GET_NUM_BLOCKS,
    4343        BD_READ_BLOCKS,
    44         BD_WRITE_BLOCKS
     44        BD_WRITE_BLOCKS,
     45        BD_READ_TOC
    4546} bd_request_t;
    4647
  • uspace/lib/c/include/ipc/clipboard.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_IPC_CLIPBOARD_H_
    3737
     38#include <ipc/common.h>
     39
    3840typedef enum {
    3941        CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD,
  • uspace/lib/c/include/ipc/common.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
     39#include <abi/ipc/ipc.h>
    3940#include <atomic.h>
    40 #include <kernel/ipc/ipc.h>
     41#include <task.h>
    4142
    4243#define IPC_FLAG_BLOCKING  0x01
     
    4445typedef struct {
    4546        sysarg_t args[IPC_CALL_LEN];
    46         sysarg_t in_task_hash;
     47        task_id_t in_task_id;
    4748        sysarg_t in_phone_hash;
    4849} ipc_call_t;
  • uspace/lib/c/include/ipc/console.h

    r2bdf8313 rb0f00a9  
    4848        CONSOLE_SET_COLOR,
    4949        CONSOLE_SET_RGB_COLOR,
    50         CONSOLE_CURSOR_VISIBILITY,
    51         CONSOLE_KCON_ENABLE
     50        CONSOLE_CURSOR_VISIBILITY
    5251} console_request_t;
    5352
  • uspace/lib/c/include/ipc/dev_iface.h

    r2bdf8313 rb0f00a9  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
     38        /** Character device interface */
    3839        CHAR_DEV_IFACE,
     40       
     41        /** Network interface controller interface */
     42        NIC_DEV_IFACE,
     43       
     44        /** Interface provided by any PCI device. */
     45        PCI_DEV_IFACE,
     46
     47        /** Interface provided by any USB device. */
     48        USB_DEV_IFACE,
     49        /** Interface provided by USB host controller. */
     50        USBHC_DEV_IFACE,
     51        /** Interface provided by USB HID devices. */
     52        USBHID_DEV_IFACE,
     53
    3954        DEV_IFACE_MAX
    4055} dev_inferface_idx_t;
     
    4863        DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX)
    4964
     65/*
     66 * The first argument is actually method (as the "real" method is used
     67 * for indexing into interfaces.
     68 */
     69
     70#define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call))
     71#define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call))
     72#define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call))
     73#define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call))
     74
    5075
    5176#endif
  • uspace/lib/c/include/ipc/devman.h

    r2bdf8313 rb0f00a9  
    7272 */
    7373typedef struct match_id_list {
    74         link_t ids;
     74        list_t ids;
    7575} match_id_list_t;
    7676
     
    9595{
    9696        match_id_t *mid = NULL;
    97         link_t *link = ids->ids.next;
     97        link_t *link = ids->ids.head.next;
    9898       
    99         while (link != &ids->ids) {
     99        while (link != &ids->ids.head) {
    100100                mid = list_get_instance(link, match_id_t,link);
    101101                if (mid->score < id->score) {
    102102                        break;
    103                 }       
     103                }
    104104                link = link->next;
    105105        }
     
    118118        match_id_t *id;
    119119       
    120         while(!list_empty(&ids->ids)) {
    121                 link = ids->ids.next;
    122                 list_remove(link);             
     120        while (!list_empty(&ids->ids)) {
     121                link = list_first(&ids->ids);
     122                list_remove(link);
    123123                id = list_get_instance(link, match_id_t, link);
    124                 delete_match_id(id);           
    125         }       
     124                delete_match_id(id);
     125        }
    126126}
    127127
     
    130130        DEVMAN_CLIENT,
    131131        DEVMAN_CONNECT_TO_DEVICE,
    132         DEVMAN_CONNECT_FROM_DEVMAP,
     132        DEVMAN_CONNECT_FROM_LOC,
    133133        DEVMAN_CONNECT_TO_PARENTS_DEVICE
    134134} devman_interface_t;
     
    138138        DEVMAN_ADD_FUNCTION,
    139139        DEVMAN_ADD_MATCH_ID,
    140         DEVMAN_ADD_DEVICE_TO_CLASS
    141 
     140        DEVMAN_ADD_DEVICE_TO_CATEGORY,
     141        DEVMAN_DRV_FUN_ONLINE,
     142        DEVMAN_DRV_FUN_OFFLINE,
     143        DEVMAN_REMOVE_FUNCTION
    142144} driver_to_devman_t;
    143145
    144146typedef enum {
    145         DRIVER_ADD_DEVICE = IPC_FIRST_USER_METHOD
    146 
     147        DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD,
     148        DRIVER_DEV_ADDED,
     149        DRIVER_DEV_REMOVE,
     150        DRIVER_DEV_GONE,
     151        DRIVER_FUN_ONLINE,
     152        DRIVER_FUN_OFFLINE,
    147153} devman_to_driver_t;
    148154
    149155typedef enum {
    150156        DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD,
    151         DEVMAN_DEVICE_GET_HANDLE_BY_CLASS
     157        DEVMAN_DEV_GET_FUNCTIONS,
     158        DEVMAN_FUN_GET_CHILD,
     159        DEVMAN_FUN_GET_NAME,
     160        DEVMAN_FUN_ONLINE,
     161        DEVMAN_FUN_OFFLINE,
     162        DEVMAN_FUN_GET_PATH,
     163        DEVMAN_FUN_SID_TO_HANDLE
    152164} client_to_devman_t;
    153165
  • uspace/lib/c/include/ipc/il.h

    r2bdf8313 rb0f00a9  
    5454        NET_IL_MTU_CHANGED,
    5555       
     56        /**
     57         * Device address changed message
     58         * @see il_addr_changed_msg()
     59         */
     60        NET_IL_ADDR_CHANGED,
     61
    5662        /** Packet received message.
    5763         * @see il_received_msg()
  • uspace/lib/c/include/ipc/ipc.h

    r2bdf8313 rb0f00a9  
    4242#include <sys/types.h>
    4343#include <ipc/common.h>
    44 #include <kernel/synch/synch.h>
     44#include <abi/ipc/methods.h>
     45#include <abi/synch.h>
    4546#include <task.h>
    4647
     
    253254    sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
    254255
    255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,
     256extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *,
    256257    sysarg_t *);
     258extern int ipc_connect_me(int);
    257259extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    258260extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
  • uspace/lib/c/include/ipc/loc.h

    r2bdf8313 rb0f00a9  
    11/*
    22 * Copyright (c) 2007 Josef Cejka
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    2728 */
    2829
    29 /** @addtogroup devmap
     30/** @addtogroup loc
    3031 * @{
    3132 */
    3233
    33 #ifndef DEVMAP_DEVMAP_H_
    34 #define DEVMAP_DEVMAP_H_
     34#ifndef LIBC_IPC_LOC_H_
     35#define LIBC_IPC_LOC_H_
    3536
    3637#include <ipc/common.h>
    3738
    38 #define DEVMAP_NAME_MAXLEN  255
     39#define LOC_NAME_MAXLEN  255
    3940
    40 typedef sysarg_t devmap_handle_t;
     41typedef sysarg_t service_id_t;
     42typedef sysarg_t category_id_t;
    4143
    4244typedef enum {
    43         DEV_HANDLE_NONE,
    44         DEV_HANDLE_NAMESPACE,
    45         DEV_HANDLE_DEVICE
    46 } devmap_handle_type_t;
     45        LOC_OBJECT_NONE,
     46        LOC_OBJECT_NAMESPACE,
     47        LOC_OBJECT_SERVICE
     48} loc_object_type_t;
    4749
    4850typedef enum {
    49         DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD,
    50         DEVMAP_DRIVER_UNREGISTER,
    51         DEVMAP_DEVICE_REGISTER,
    52         DEVMAP_DEVICE_UNREGISTER,
    53         DEVMAP_DEVICE_GET_HANDLE,
    54         DEVMAP_NAMESPACE_GET_HANDLE,
    55         DEVMAP_HANDLE_PROBE,
    56         DEVMAP_NULL_CREATE,
    57         DEVMAP_NULL_DESTROY,
    58         DEVMAP_GET_NAMESPACE_COUNT,
    59         DEVMAP_GET_DEVICE_COUNT,
    60         DEVMAP_GET_NAMESPACES,
    61         DEVMAP_GET_DEVICES
    62 } devmap_request_t;
     51        LOC_SERVER_REGISTER = IPC_FIRST_USER_METHOD,
     52        LOC_SERVER_UNREGISTER,
     53        LOC_SERVICE_ADD_TO_CAT,
     54        LOC_SERVICE_REGISTER,
     55        LOC_SERVICE_UNREGISTER,
     56        LOC_SERVICE_GET_ID,
     57        LOC_SERVICE_GET_NAME,
     58        LOC_NAMESPACE_GET_ID,
     59        LOC_CALLBACK_CREATE,
     60        LOC_CATEGORY_GET_ID,
     61        LOC_CATEGORY_GET_NAME,
     62        LOC_CATEGORY_GET_SVCS,
     63        LOC_ID_PROBE,
     64        LOC_NULL_CREATE,
     65        LOC_NULL_DESTROY,
     66        LOC_GET_NAMESPACE_COUNT,
     67        LOC_GET_SERVICE_COUNT,
     68        LOC_GET_CATEGORIES,
     69        LOC_GET_NAMESPACES,
     70        LOC_GET_SERVICES
     71} loc_request_t;
    6372
    64 /** Interface provided by devmap.
     73typedef enum {
     74        LOC_EVENT_CAT_CHANGE = IPC_FIRST_USER_METHOD
     75} loc_event_t;
     76
     77/** Ports provided by location service.
    6578 *
    66  * Every process that connects to devmap must ask one of following
    67  * interfaces otherwise connection will be refused.
     79 * Every process that connects to loc must ask one of following
     80 * ports, otherwise connection will be refused.
    6881 *
    6982 */
    7083typedef enum {
    71         /** Connect as device driver */
    72         DEVMAP_DRIVER = 1,
    73         /** Connect as client */
    74         DEVMAP_CLIENT,
     84        /** Service supplier (server) port */
     85        LOC_PORT_SUPPLIER = 1,
     86        /** Service consumer (client) port */
     87        LOC_PORT_CONSUMER,
    7588        /** Create new connection to instance of device that
    7689            is specified by second argument of call. */
    77         DEVMAP_CONNECT_TO_DEVICE
    78 } devmap_interface_t;
     90        LOC_CONNECT_TO_SERVICE
     91} loc_interface_t;
    7992
    8093typedef struct {
    81         devmap_handle_t handle;
    82         char name[DEVMAP_NAME_MAXLEN + 1];
    83 } dev_desc_t;
     94        service_id_t id;
     95        char name[LOC_NAME_MAXLEN + 1];
     96} loc_sdesc_t;
    8497
    8598#endif
     99
     100/** @}
     101 */
  • uspace/lib/c/include/ipc/mouseev.h

    r2bdf8313 rb0f00a9  
    2727 */
    2828
    29 /** @addtogroup kbdgen generic
    30  * @brief HelenOS generic uspace keyboard handler.
    31  * @ingroup kbd
     29/** @addtogroup mouse
     30 * @brief
    3231 * @{
    3332 */
     
    3534 */
    3635
    37 #ifndef LIBC_IPC_KBD_H_
    38 #define LIBC_IPC_KBD_H_
     36#ifndef LIBC_IPC_MOUSEEV_H_
     37#define LIBC_IPC_MOUSEEV_H_
    3938
    4039#include <ipc/common.h>
     40#include <ipc/dev_iface.h>
    4141
    4242typedef enum {
    43         KBD_YIELD = IPC_FIRST_USER_METHOD,
    44         KBD_RECLAIM
    45 } kbd_request_t;
     43        MOUSEEV_YIELD = DEV_FIRST_CUSTOM_METHOD,
     44        MOUSEEV_RECLAIM
     45} mouseev_request_t;
    4646
    4747typedef enum {
    48         KBD_EVENT = IPC_FIRST_USER_METHOD
    49 } kbd_notif_t;
     48        MOUSEEV_MOVE_EVENT = IPC_FIRST_USER_METHOD,
     49        MOUSEEV_BUTTON_EVENT
     50} mouseev_notif_t;
    5051
    5152#endif
  • uspace/lib/c/include/ipc/net.h

    r2bdf8313 rb0f00a9  
    277277 *
    278278 */
    279 #define IPC_GET_DEVICE(call)  ((device_id_t) IPC_GET_ARG1(call))
     279#define IPC_GET_DEVICE(call)  ((nic_device_id_t) IPC_GET_ARG1(call))
    280280
    281281/** Return the packet identifier message argument.
     
    298298 *
    299299 */
    300 #define IPC_GET_STATE(call)  ((device_state_t) IPC_GET_ARG2(call))
     300#define IPC_GET_STATE(call)  ((nic_device_state_t) IPC_GET_ARG2(call))
     301
     302/** Return the device handle argument
     303 *
     304 * @param[in] call Message call structure
     305 *
     306 */
     307#define IPC_GET_DEVICE_HANDLE(call) ((devman_handle_t) IPC_GET_ARG2(call))
     308
     309/** Return the device driver service message argument.
     310 *
     311 * @param[in] call Message call structure.
     312 *
     313 */
     314#define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
     315
     316/** Return the target service message argument.
     317 *
     318 * @param[in] call Message call structure.
     319 *
     320 */
     321#define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
     322
     323/** Return the sender service message argument.
     324 *
     325 * @param[in] call Message call structure.
     326 *
     327 */
     328#define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
    301329
    302330/** Return the maximum transmission unit message argument.
     
    305333 *
    306334 */
    307 #define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG2(call))
    308 
    309 /** Return the device driver service message argument.
    310  *
    311  * @param[in] call Message call structure.
    312  *
    313  */
    314 #define IPC_GET_SERVICE(call)  ((services_t) IPC_GET_ARG3(call))
    315 
    316 /** Return the target service message argument.
    317  *
    318  * @param[in] call Message call structure.
    319  *
    320  */
    321 #define IPC_GET_TARGET(call)  ((services_t) IPC_GET_ARG3(call))
    322 
    323 /** Return the sender service message argument.
    324  *
    325  * @param[in] call Message call structure.
    326  *
    327  */
    328 #define IPC_GET_SENDER(call)  ((services_t) IPC_GET_ARG3(call))
     335#define IPC_GET_MTU(call)  ((size_t) IPC_GET_ARG3(call))
    329336
    330337/** Return the error service message argument.
     
    335342#define IPC_GET_ERROR(call)  ((services_t) IPC_GET_ARG4(call))
    336343
    337 /** Return the phone message argument.
    338  *
    339  * @param[in] call Message call structure.
    340  *
    341  */
    342 #define IPC_GET_PHONE(call)  ((int) IPC_GET_ARG5(call))
    343 
    344344/** Set the device identifier in the message answer.
    345345 *
  • uspace/lib/c/include/ipc/net_net.h

    r2bdf8313 rb0f00a9  
    4343/** Networking subsystem central module messages. */
    4444typedef enum {
    45         /** Returns the general configuration
     45        /** Return general configuration
    4646         * @see net_get_conf_req()
    4747         */
    4848        NET_NET_GET_CONF = NET_FIRST,
    49         /** Returns the device specific configuration
     49        /** Return device specific configuration
    5050         * @see net_get_device_conf_req()
    5151         */
    5252        NET_NET_GET_DEVICE_CONF,
    53         /** Starts the networking stack. */
    54         NET_NET_STARTUP,
     53        /** Return number of mastered devices */
     54        NET_NET_GET_DEVICES_COUNT,
     55        /** Return names and device IDs of all devices */
     56        NET_NET_GET_DEVICES,
     57        /** Notify the networking service about a ready device */
     58        NET_NET_DRIVER_READY
    5559} net_messages;
    5660
  • uspace/lib/c/include/ipc/nil.h

    r2bdf8313 rb0f00a9  
    7070         */
    7171        NET_NIL_BROADCAST_ADDR,
     72        /** Device has changed address
     73         * @see nil_addr_changed_msg()
     74         */
     75        NET_NIL_ADDR_CHANGED
    7276} nil_messages;
    7377
  • uspace/lib/c/include/ipc/ns.h

    r2bdf8313 rb0f00a9  
    3333 */
    3434
    35 #ifndef LIBC_NS_H_
    36 #define LIBC_NS_H_
     35#ifndef LIBC_IPC_NS_H_
     36#define LIBC_IPC_NS_H_
    3737
    38 #include <sys/types.h>
    3938#include <ipc/common.h>
    4039
     
    4645} ns_request_t;
    4746
    48 extern int service_register(sysarg_t);
    49 extern int service_connect(sysarg_t, sysarg_t, sysarg_t);
    50 extern int service_connect_blocking(sysarg_t, sysarg_t, sysarg_t);
    51 
    5247#endif
    5348
  • uspace/lib/c/include/ipc/serial_ctl.h

    r2bdf8313 rb0f00a9  
    3232#include <ipc/dev_iface.h>
    3333
    34 /** ipc methods for getting/setting serial communication properties
    35  *      1st ipc arg: baud rate
    36  *      2nd ipc arg: parity
    37  *      3rd ipc arg: number of bits in one word
    38  *      4th ipc arg: number of stop bits
     34/** IPC methods for getting/setting serial communication properties
     35 *
     36 * 1st IPC arg: baud rate
     37 * 2nd IPC arg: parity
     38 * 3rd IPC arg: number of bits in one word
     39 * 4th IPC arg: number of stop bits
     40 *
    3941 */
    40 typedef enum { 
     42typedef enum {
    4143        SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD,
    4244        SERIAL_SET_COM_PROPS
     
    4850        SERIAL_EVEN_PARITY = 3,
    4951        SERIAL_MARK_PARITY = 5,
    50         SERIAL_SPACE_PARITY = 7 
     52        SERIAL_SPACE_PARITY = 7
    5153} serial_parity_t;
    5254
  • uspace/lib/c/include/ipc/services.h

    r2bdf8313 rb0f00a9  
    3838#define LIBC_SERVICES_H_
    3939
     40#include <fourcc.h>
     41
    4042typedef enum {
    41         SERVICE_NONE = 0,
    42         SERVICE_LOAD,
    43         SERVICE_PCI,
    44         SERVICE_VIDEO,
    45         SERVICE_CONSOLE,
    46         SERVICE_VFS,
    47         SERVICE_DEVMAP,
    48         SERVICE_DEVMAN,
    49         SERVICE_IRC,
    50         SERVICE_CLIPBOARD,
    51         SERVICE_NETWORKING,
    52         SERVICE_LO,
    53         SERVICE_NE2000,
    54         SERVICE_ETHERNET,
    55         SERVICE_NILDUMMY,
    56         SERVICE_IP,
    57         SERVICE_ARP,
    58         SERVICE_RARP,
    59         SERVICE_ICMP,
    60         SERVICE_UDP,
    61         SERVICE_TCP,
    62         SERVICE_SOCKET
     43        SERVICE_NONE       = 0,
     44        SERVICE_LOAD       = FOURCC('l', 'o', 'a', 'd'),
     45        SERVICE_VFS        = FOURCC('v', 'f', 's', ' '),
     46        SERVICE_LOC        = FOURCC('l', 'o', 'c', ' '),
     47        SERVICE_DEVMAN     = FOURCC('d', 'e', 'v', 'n'),
     48        SERVICE_IRC        = FOURCC('i', 'r', 'c', ' '),
     49        SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
     50        SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
     51        SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
     52        SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
     53        SERVICE_IP         = FOURCC('i', 'p', 'v', '4'),
     54        SERVICE_ARP        = FOURCC('a', 'r', 'p', ' '),
     55        SERVICE_ICMP       = FOURCC('i', 'c', 'm', 'p'),
     56        SERVICE_UDP        = FOURCC('u', 'd', 'p', ' '),
     57        SERVICE_TCP        = FOURCC('t', 'c', 'p', ' ')
    6358} services_t;
    6459
  • uspace/lib/c/include/ipc/vfs.h

    r2bdf8313 rb0f00a9  
    4242#define FS_NAME_MAXLEN  20
    4343#define MAX_PATH_LEN    (64 * 1024)
     44#define MAX_MNTOPTS_LEN 256
    4445#define PLB_SIZE        (2 * MAX_PATH_LEN)
    4546
     
    5657        /** Unique identifier of the fs. */
    5758        char name[FS_NAME_MAXLEN + 1];
     59        unsigned int instance;
    5860        bool concurrent_read_write;
    5961        bool write_retains_size;
     
    6264typedef enum {
    6365        VFS_IN_OPEN = IPC_FIRST_USER_METHOD,
    64         VFS_IN_OPEN_NODE,
    6566        VFS_IN_READ,
    6667        VFS_IN_WRITE,
     
    6970        VFS_IN_FSTAT,
    7071        VFS_IN_CLOSE,
     72        VFS_IN_PING,
    7173        VFS_IN_MOUNT,
    7274        VFS_IN_UNMOUNT,
     
    7779        VFS_IN_RENAME,
    7880        VFS_IN_STAT,
    79         VFS_IN_DUP
     81        VFS_IN_DUP,
     82        VFS_IN_WAIT_HANDLE,
     83        VFS_IN_MTAB_GET,
    8084} vfs_in_request_t;
    8185
  • uspace/lib/c/include/libc.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
    39 #include <kernel/syscall/syscall.h>
     39#include <abi/syscall.h>
    4040#include <libarch/syscall.h>
    4141
  • uspace/lib/c/include/loader/loader.h

    r2bdf8313 rb0f00a9  
    3838
    3939#include <task.h>
    40 #include <vfs/vfs.h>
    4140
    42 /** Abstraction of a loader connection */
    43 typedef struct {
    44         /** ID of the phone connected to the loader. */
    45         int phone_id;
    46 } loader_t;
     41/** Forward declararion */
     42struct loader;
     43typedef struct loader loader_t;
    4744
    4845extern int loader_spawn(const char *);
     
    5249extern int loader_set_pathname(loader_t *, const char *);
    5350extern int loader_set_args(loader_t *, const char *const[]);
    54 extern int loader_set_files(loader_t *, fdi_node_t *const[]);
     51extern int loader_set_files(loader_t *, int *const[]);
    5552extern int loader_load_program(loader_t *);
    5653extern int loader_run(loader_t *);
  • uspace/lib/c/include/loader/pcb.h

    r2bdf8313 rb0f00a9  
    3838
    3939#include <sys/types.h>
    40 #include <vfs/vfs.h>
    4140
    4241typedef void (*entry_point_t)(void);
     
    6261       
    6362        /** Number of preset files. */
    64         int filc;
    65         /** Preset files. */
    66         fdi_node_t **filv;
     63        unsigned int filc;
    6764       
    6865        /*
  • uspace/lib/c/include/net/device.h

    r2bdf8313 rb0f00a9  
    11/*
    22 * Copyright (c) 2009 Lukas Mejdrech
     3 * Copyright (c) 2011 Radim Vansa
    34 * All rights reserved.
    45 *
     
    3940
    4041#include <adt/int_map.h>
     42#include <net/eth_phys.h>
     43#include <bool.h>
     44
     45/** Ethernet address length. */
     46#define ETH_ADDR  6
     47
     48/** MAC printing format */
     49#define PRIMAC  "%02x:%02x:%02x:%02x:%02x:%02x"
     50
     51/** MAC arguments */
     52#define ARGSMAC(__a) \
     53        (__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5]
     54
     55/* Compare MAC address with specific value */
     56#define MAC_EQUALS_VALUE(__a, __a0, __a1, __a2, __a3, __a4, __a5) \
     57        ((__a)[0] == (__a0) && (__a)[1] == (__a1) && (__a)[2] == (__a2) \
     58        && (__a)[3] == (__a3) && (__a)[4] == (__a4) && (__a)[5] == (__a5))
     59
     60#define MAC_IS_ZERO(__x) \
     61        MAC_EQUALS_VALUE(__x, 0, 0, 0, 0, 0, 0)
    4162
    4263/** Device identifier to generic type map declaration. */
    43 #define DEVICE_MAP_DECLARE      INT_MAP_DECLARE
     64#define DEVICE_MAP_DECLARE  INT_MAP_DECLARE
    4465
    4566/** Device identifier to generic type map implementation. */
    46 #define DEVICE_MAP_IMPLEMENT    INT_MAP_IMPLEMENT
     67#define DEVICE_MAP_IMPLEMENT  INT_MAP_IMPLEMENT
     68
     69/** Max length of any hw nic address (currently only eth) */
     70#define NIC_MAX_ADDRESS_LENGTH  16
    4771
    4872/** Invalid device identifier. */
    49 #define DEVICE_INVALID_ID       (-1)
     73#define NIC_DEVICE_INVALID_ID  (-1)
     74
     75#define NIC_VENDOR_MAX_LENGTH         64
     76#define NIC_MODEL_MAX_LENGTH          64
     77#define NIC_PART_NUMBER_MAX_LENGTH    64
     78#define NIC_SERIAL_NUMBER_MAX_LENGTH  64
     79
     80/**
     81 * The bitmap uses single bit for each of the 2^12 = 4096 possible VLAN tags.
     82 * This means its size is 4096/8 = 512 bytes.
     83 */
     84#define NIC_VLAN_BITMAP_SIZE  512
     85
     86#define NIC_DEVICE_PRINT_FMT  "%x"
    5087
    5188/** Device identifier type. */
    52 typedef int device_id_t;
    53 
    54 /** Device state type. */
    55 typedef enum device_state device_state_t;
    56 
    57 /** Type definition of the device usage statistics.
    58  * @see device_stats
    59  */
    60 typedef struct device_stats device_stats_t;
     89typedef int nic_device_id_t;
     90
     91/**
     92 * Structure covering the MAC address.
     93 */
     94typedef struct nic_address {
     95        uint8_t address[ETH_ADDR];
     96} nic_address_t;
    6197
    6298/** Device state. */
    63 enum device_state {
    64         /** Device not present or not initialized. */
    65         NETIF_NULL = 0,
    66         /** Device present and stopped. */
    67         NETIF_STOPPED,
    68         /** Device present and active. */
    69         NETIF_ACTIVE,
    70         /** Device present but unable to transmit. */
    71         NETIF_CARRIER_LOST
    72 };
     99typedef enum nic_device_state {
     100        /**
     101         * Device present and stopped. Moving device to this state means to discard
     102         * all settings and WOL virtues, rebooting the NIC to state as if the
     103         * computer just booted (or the NIC was just inserted in case of removable
     104         * NIC).
     105         */
     106        NIC_STATE_STOPPED,
     107        /**
     108         * If the NIC is in this state no packets (frames) are transmitted nor
     109         * received. However, the settings are not restarted. You can use this state
     110         * to temporarily disable transmition/reception or atomically (with respect
     111         * to incoming/outcoming packets) change frames acceptance etc.
     112         */
     113        NIC_STATE_DOWN,
     114        /** Device is normally operating. */
     115        NIC_STATE_ACTIVE,
     116        /** Just a constant to limit the state numbers */
     117        NIC_STATE_MAX,
     118} nic_device_state_t;
     119
     120/**
     121 * Channel operating mode used on the medium.
     122 */
     123typedef enum {
     124        NIC_CM_UNKNOWN,
     125        NIC_CM_FULL_DUPLEX,
     126        NIC_CM_HALF_DUPLEX,
     127        NIC_CM_SIMPLEX
     128} nic_channel_mode_t;
     129
     130/**
     131 * Role for the device (used e.g. for 1000Gb ethernet)
     132 */
     133typedef enum {
     134        NIC_ROLE_UNKNOWN,
     135        NIC_ROLE_AUTO,
     136        NIC_ROLE_MASTER,
     137        NIC_ROLE_SLAVE
     138} nic_role_t;
     139
     140/**
     141 * Current state of the cable in the device
     142 */
     143typedef enum {
     144        NIC_CS_UNKNOWN,
     145        NIC_CS_PLUGGED,
     146        NIC_CS_UNPLUGGED
     147} nic_cable_state_t;
     148
     149/**
     150 * Result of the requested operation
     151 */
     152typedef enum {
     153        /** Successfully disabled */
     154        NIC_RESULT_DISABLED,
     155        /** Successfully enabled */
     156        NIC_RESULT_ENABLED,
     157        /** Not supported at all */
     158        NIC_RESULT_NOT_SUPPORTED,
     159        /** Temporarily not available */
     160        NIC_RESULT_NOT_AVAILABLE,
     161        /** Result extensions */
     162        NIC_RESULT_FIRST_EXTENSION
     163} nic_result_t;
    73164
    74165/** Device usage statistics. */
    75 struct device_stats {
    76         /** Total packets received. */
     166typedef struct nic_device_stats {
     167        /** Total packets received (accepted). */
    77168        unsigned long receive_packets;
    78169        /** Total packets transmitted. */
    79170        unsigned long send_packets;
    80         /** Total bytes received. */
     171        /** Total bytes received (accepted). */
    81172        unsigned long receive_bytes;
    82173        /** Total bytes transmitted. */
     
    86177        /** Packet transmition problems counter. */
    87178        unsigned long send_errors;
    88         /** No space in buffers counter. */
     179        /** Number of frames dropped due to insufficient space in RX buffers */
    89180        unsigned long receive_dropped;
    90         /** No space available counter. */
     181        /** Number of frames dropped due to insufficient space in TX buffers */
    91182        unsigned long send_dropped;
    92         /** Total multicast packets received. */
    93         unsigned long multicast;
     183        /** Total multicast packets received (accepted). */
     184        unsigned long receive_multicast;
     185        /** Total broadcast packets received (accepted). */
     186        unsigned long receive_broadcast;
    94187        /** The number of collisions due to congestion on the medium. */
    95188        unsigned long collisions;
     189        /** Unicast packets received but not accepted (filtered) */
     190        unsigned long receive_filtered_unicast;
     191        /** Multicast packets received but not accepted (filtered) */
     192        unsigned long receive_filtered_multicast;
     193        /** Broadcast packets received but not accepted (filtered) */
     194        unsigned long receive_filtered_broadcast;
    96195
    97196        /* detailed receive_errors */
     
    129228        /** Total compressed packet transmitted. */
    130229        unsigned long send_compressed;
    131 };
     230} nic_device_stats_t;
     231
     232/** Errors corresponding to those in the nic_device_stats_t */
     233typedef enum {
     234        NIC_SEC_BUFFER_FULL,
     235        NIC_SEC_ABORTED,
     236        NIC_SEC_CARRIER_LOST,
     237        NIC_SEC_FIFO_OVERRUN,
     238        NIC_SEC_HEARTBEAT,
     239        NIC_SEC_WINDOW_ERROR,
     240        /* Error encountered during TX but with other type of error */
     241        NIC_SEC_OTHER
     242} nic_send_error_cause_t;
     243
     244/** Errors corresponding to those in the nic_device_stats_t */
     245typedef enum {
     246        NIC_REC_BUFFER_FULL,
     247        NIC_REC_LENGTH,
     248        NIC_REC_BUFFER_OVERFLOW,
     249        NIC_REC_CRC,
     250        NIC_REC_FRAME_ALIGNMENT,
     251        NIC_REC_FIFO_OVERRUN,
     252        NIC_REC_MISSED,
     253        /* Error encountered during RX but with other type of error */
     254        NIC_REC_OTHER
     255} nic_receive_error_cause_t;
     256
     257/**
     258 * Information about the NIC that never changes - name, vendor, model,
     259 * capabilites and so on.
     260 */
     261typedef struct nic_device_info {
     262        /* Device identification */
     263        char vendor_name[NIC_VENDOR_MAX_LENGTH];
     264        char model_name[NIC_MODEL_MAX_LENGTH];
     265        char part_number[NIC_PART_NUMBER_MAX_LENGTH];
     266        char serial_number[NIC_SERIAL_NUMBER_MAX_LENGTH];
     267        uint16_t vendor_id;
     268        uint16_t device_id;
     269        uint16_t subsystem_vendor_id;
     270        uint16_t subsystem_id;
     271        /* Device capabilities */
     272        uint16_t ethernet_support[ETH_PHYS_LAYERS];
     273
     274        /** The mask of all modes which the device can advertise
     275         *
     276         *  see ETH_AUTONEG_ macros in net/eth_phys.h of libc
     277         */
     278        uint32_t autoneg_support;
     279} nic_device_info_t;
     280
     281/**
     282 * Type of the ethernet frame
     283 */
     284typedef enum nic_frame_type {
     285        NIC_FRAME_UNICAST,
     286        NIC_FRAME_MULTICAST,
     287        NIC_FRAME_BROADCAST
     288} nic_frame_type_t;
     289
     290/**
     291 * Specifies which unicast frames is the NIC receiving.
     292 */
     293typedef enum nic_unicast_mode {
     294        NIC_UNICAST_UNKNOWN,
     295        /** No unicast frames are received */
     296        NIC_UNICAST_BLOCKED,
     297        /** Only the frames with this NIC's MAC as destination are received */
     298        NIC_UNICAST_DEFAULT,
     299        /**
     300         * Both frames with this NIC's MAC and those specified in the list are
     301         * received
     302         */
     303        NIC_UNICAST_LIST,
     304        /** All unicast frames are received */
     305        NIC_UNICAST_PROMISC
     306} nic_unicast_mode_t;
     307
     308typedef enum nic_multicast_mode {
     309        NIC_MULTICAST_UNKNOWN,
     310        /** No multicast frames are received */
     311        NIC_MULTICAST_BLOCKED,
     312        /** Frames with multicast addresses specified in this list are received */
     313        NIC_MULTICAST_LIST,
     314        /** All multicast frames are received */
     315        NIC_MULTICAST_PROMISC
     316} nic_multicast_mode_t;
     317
     318typedef enum nic_broadcast_mode {
     319        NIC_BROADCAST_UNKNOWN,
     320        /** Broadcast frames are dropped */
     321        NIC_BROADCAST_BLOCKED,
     322        /** Broadcast frames are received */
     323        NIC_BROADCAST_ACCEPTED
     324} nic_broadcast_mode_t;
     325
     326/**
     327 * Structure covering the bitmap with VLAN tags.
     328 */
     329typedef struct nic_vlan_mask {
     330        uint8_t bitmap[NIC_VLAN_BITMAP_SIZE];
     331} nic_vlan_mask_t;
     332
     333/* WOL virtue identifier */
     334typedef unsigned int nic_wv_id_t;
     335
     336/**
     337 * Structure passed as argument for virtue NIC_WV_MAGIC_PACKET.
     338 */
     339typedef struct nic_wv_magic_packet_data {
     340        uint8_t password[6];
     341} nic_wv_magic_packet_data_t;
     342
     343/**
     344 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV4
     345 */
     346typedef struct nic_wv_ipv4_data {
     347        uint8_t address[4];
     348} nic_wv_ipv4_data_t;
     349
     350/**
     351 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV6
     352 */
     353typedef struct nic_wv_ipv6_data {
     354        uint8_t address[16];
     355} nic_wv_ipv6_data_t;
     356
     357/**
     358 * WOL virtue types defining the interpretation of data passed to the virtue.
     359 * Those tagged with S can have only single virtue active at one moment, those
     360 * tagged with M can have multiple ones.
     361 */
     362typedef enum nic_wv_type {
     363        /**
     364         * Used for deletion of the virtue - in this case the mask, data and length
     365         * arguments are ignored.
     366         */
     367        NIC_WV_NONE,
     368        /** S
     369         * Enabled <=> wakeup upon link change
     370         */
     371        NIC_WV_LINK_CHANGE,
     372        /** S
     373         * If this virtue is set up, wakeup can be issued by a magic packet frame.
     374         * If the data argument is not NULL, it must contain
     375         * nic_wv_magic_packet_data structure with the SecureOn password.
     376         */
     377        NIC_WV_MAGIC_PACKET,
     378        /** M
     379         * If the virtue is set up, wakeup can be issued by a frame targeted to
     380         * device with MAC address specified in data. The data must contain
     381         * nic_address_t structure.
     382         */
     383        NIC_WV_DESTINATION,
     384        /** S
     385         * Enabled <=> wakeup upon receiving broadcast frame
     386         */
     387        NIC_WV_BROADCAST,
     388        /** S
     389         * Enabled <=> wakeup upon receiving ARP Request
     390         */
     391        NIC_WV_ARP_REQUEST,
     392        /** M
     393         * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet
     394         * with IPv4 address specified in data. The data must contain
     395         * nic_wv_ipv4_data structure.
     396         */
     397        NIC_WV_DIRECTED_IPV4,
     398        /** M
     399         * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet
     400         * with IPv6 address specified in data. The data must contain
     401         * nic_wv_ipv6_data structure.
     402         */
     403        NIC_WV_DIRECTED_IPV6,
     404        /** M
     405         * First length/2 bytes in the argument are interpreted as mask, second
     406         * length/2 bytes are interpreted as content.
     407         * If enabled, the wakeup is issued upon receiving frame where the bytes
     408         * with non-zero value in the mask equal to those in the content.
     409         */
     410        NIC_WV_FULL_MATCH,
     411        /**
     412         * Dummy value, do not use.
     413         */
     414        NIC_WV_MAX
     415} nic_wv_type_t;
     416
     417/**
     418 * Specifies the interrupt/polling mode used by the driver and NIC
     419 */
     420typedef enum nic_poll_mode {
     421        /**
     422         * NIC issues interrupts upon events.
     423         */
     424        NIC_POLL_IMMEDIATE,
     425        /**
     426         * Some uspace app calls nic_poll_now(...) in order to check the NIC state
     427         * - no interrupts are received from the NIC.
     428         */
     429        NIC_POLL_ON_DEMAND,
     430        /**
     431         * The driver itself issues a poll request in a periodic manner. It is
     432         * allowed to use hardware timer if the NIC supports it.
     433         */
     434        NIC_POLL_PERIODIC,
     435        /**
     436         * The driver itself issued a poll request in a periodic manner. The driver
     437         * must create software timer, internal hardware timer of NIC must not be
     438         * used even if the NIC supports it.
     439         */
     440        NIC_POLL_SOFTWARE_PERIODIC
     441} nic_poll_mode_t;
     442
     443/**
     444 * Says if this virtue type is a multi-virtue (there can be multiple virtues of
     445 * this type at once).
     446 *
     447 * @param type
     448 *
     449 * @return true or false
     450 */
     451static inline int nic_wv_is_multi(nic_wv_type_t type) {
     452        switch (type) {
     453        case NIC_WV_FULL_MATCH:
     454        case NIC_WV_DESTINATION:
     455        case NIC_WV_DIRECTED_IPV4:
     456        case NIC_WV_DIRECTED_IPV6:
     457                return true;
     458        default:
     459                return false;
     460        }
     461}
     462
     463static inline const char *nic_device_state_to_string(nic_device_state_t state)
     464{
     465        switch (state) {
     466        case NIC_STATE_STOPPED:
     467                return "stopped";
     468        case NIC_STATE_DOWN:
     469                return "down";
     470        case NIC_STATE_ACTIVE:
     471                return "active";
     472        default:
     473                return "undefined";
     474        }
     475}
    132476
    133477#endif
  • uspace/lib/c/include/net/icmp_api.h

    r2bdf8313 rb0f00a9  
    4242#include <sys/types.h>
    4343#include <sys/time.h>
    44 
    4544#include <adt/measured_strings.h>
    4645#include <net/ip_codes.h>
    4746#include <net/icmp_codes.h>
    4847#include <net/icmp_common.h>
     48#include <async.h>
    4949
    5050/** @name ICMP module application interface
     
    5353/*@{*/
    5454
    55 extern int icmp_echo_msg(int, size_t, mseconds_t, ip_ttl_t, ip_tos_t, int,
    56     const struct sockaddr *, socklen_t);
     55extern int icmp_echo_msg(async_sess_t *, size_t, mseconds_t, ip_ttl_t, ip_tos_t,
     56    int, const struct sockaddr *, socklen_t);
    5757
    5858/*@}*/
  • uspace/lib/c/include/net/icmp_common.h

    r2bdf8313 rb0f00a9  
    4040#include <ipc/services.h>
    4141#include <sys/time.h>
     42#include <async.h>
    4243
    43 /** Default timeout for incoming connections in microseconds (1 sec). */
    44 #define ICMP_CONNECT_TIMEOUT  1000000
    45 
    46 extern int icmp_connect_module(suseconds_t);
     44extern async_sess_t *icmp_connect_module(void);
    4745
    4846#endif
  • uspace/lib/c/include/net/modules.h

    r2bdf8313 rb0f00a9  
    4646#include <sys/time.h>
    4747
    48 /** Connect to the needed module function type definition.
     48/** Connect to module function type definition.
    4949 *
    50  * @param[in] need The needed module service.
    51  *
    52  * @return The phone of the needed service.
     50 * @return Session to the service.
    5351 *
    5452 */
    55 typedef int connect_module_t(services_t need);
     53typedef async_sess_t *connect_module_t(services_t);
    5654
    5755extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t);
    58 extern int bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
     56extern async_sess_t *bind_service(services_t, sysarg_t, sysarg_t, sysarg_t,
    5957    async_client_conn_t);
    60 extern int bind_service_timeout(services_t, sysarg_t, sysarg_t, sysarg_t,
    61     async_client_conn_t, suseconds_t);
    62 extern int connect_to_service(services_t);
    63 extern int connect_to_service_timeout(services_t, suseconds_t);
     58extern async_sess_t *connect_to_service(services_t);
    6459extern int data_reply(void *, size_t);
    6560extern void refresh_answer(ipc_call_t *, size_t *);
  • uspace/lib/c/include/net/packet.h

    r2bdf8313 rb0f00a9  
    3838#define LIBC_PACKET_H_
    3939
     40#include <sys/types.h>
     41
    4042/** Packet identifier type.
    4143 * Value zero is used as an invalid identifier.
    4244 */
    43 typedef int packet_id_t;
     45typedef sysarg_t packet_id_t;
    4446
    4547/** Type definition of the packet.
     
    5153 * @see packet_dimension
    5254 */
    53 typedef struct packet_dimension packet_dimension_t;
     55typedef struct packet_dimension packet_dimension_t;
    5456
    5557/** Packet dimension. */
     
    7173extern packet_t *pm_find(packet_id_t);
    7274extern int pm_add(packet_t *);
     75extern void pm_remove(packet_t *);
    7376extern int pm_init(void);
    7477extern void pm_destroy(void);
  • uspace/lib/c/include/net/packet_header.h

    r2bdf8313 rb0f00a9  
    6161#define PACKET_MAGIC_VALUE      0x11227788
    6262
     63/** Maximum total length of the packet */
     64#define PACKET_MAX_LENGTH  65536
     65
    6366/** Packet header. */
    6467struct packet {
     
    8588         */
    8689        size_t length;
     90
     91        /** Offload info provided by the NIC */
     92        uint32_t offload_info;
     93
     94        /** Mask which bits in offload info are valid */
     95        uint32_t offload_mask;
    8796
    8897        /** Stored source and destination addresses length. */
  • uspace/lib/c/include/ns.h

    r2bdf8313 rb0f00a9  
    2727 */
    2828
    29 /** @addtogroup console
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef GCONS_H_
    36 #define GCONS_H_
     35#ifndef LIBC_NS_H_
     36#define LIBC_NS_H_
    3737
    3838#include <sys/types.h>
     39#include <task.h>
     40#include <async.h>
    3941
    40 void gcons_init(int);
     42extern int service_register(sysarg_t);
     43extern async_sess_t *service_connect(exch_mgmt_t, sysarg_t, sysarg_t, sysarg_t);
     44extern async_sess_t *service_connect_blocking(exch_mgmt_t, sysarg_t, sysarg_t,
     45    sysarg_t);
    4146
    42 void gcons_redraw_console(void);
    43 void gcons_change_console(size_t);
    44 void gcons_notify_char(size_t);
    45 void gcons_in_kernel(void);
    46 
    47 void gcons_notify_connect(size_t);
    48 void gcons_notify_disconnect(size_t);
    49 
    50 void gcons_mouse_move(ssize_t, ssize_t);
    51 int gcons_mouse_btn(bool state);
     47extern int ns_ping(void);
     48extern int ns_intro(task_id_t);
    5249
    5350#endif
  • uspace/lib/c/include/rtld/elf_dyn.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_RTLD_ELF_DYN_H_
    3737
    38 #include <arch/elf.h>
    3938#include <sys/types.h>
    40 
    41 #include <elf.h>
     39#include <elf/elf.h>
    4240#include <libarch/rtld/elf_dyn.h>
    4341
  • uspace/lib/c/include/rtld/rtld.h

    r2bdf8313 rb0f00a9  
    4949
    5050        /** List of all loaded modules including rtld and the program */
    51         link_t modules_head;
     51        list_t modules;
    5252
    5353        /** Temporary hack to place each module at different address. */
  • uspace/lib/c/include/rtld/symbol.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_RTLD_SYMBOL_H_
    3737
     38#include <elf/elf.h>
    3839#include <rtld/rtld.h>
    39 #include <elf.h>
    4040
    4141elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod);
  • uspace/lib/c/include/stats.h

    r2bdf8313 rb0f00a9  
    4040#include <stdint.h>
    4141#include <bool.h>
    42 #include <kernel/sysinfo/abi.h>
     42#include <sys/types.h>
     43#include <abi/sysinfo.h>
    4344
    4445extern stats_cpu_t *stats_get_cpus(size_t *);
  • uspace/lib/c/include/stdio.h

    r2bdf8313 rb0f00a9  
    9797};
    9898
    99 typedef struct {
    100         /** Linked list pointer. */
    101         link_t link;
    102        
    103         /** Underlying file descriptor. */
    104         int fd;
    105        
    106         /** Error indicator. */
    107         int error;
    108        
    109         /** End-of-file indicator. */
    110         int eof;
    111        
    112         /** Klog indicator */
    113         int klog;
    114        
    115         /** Phone to the file provider */
    116         int phone;
    117 
    118         /**
    119          * Non-zero if the stream needs sync on fflush(). XXX change
    120          * console semantics so that sync is not needed.
    121          */
    122         int need_sync;
    123 
    124         /** Buffering type */
    125         enum _buffer_type btype;
    126 
    127         /** Buffer */
    128         uint8_t *buf;
    129 
    130         /** Buffer size */
    131         size_t buf_size;
    132 
    133         /** Buffer state */
    134         enum _buffer_state buf_state;
    135 
    136         /** Buffer I/O pointer */
    137         uint8_t *buf_head;
    138 
    139         /** Points to end of occupied space when in read mode. */
    140         uint8_t *buf_tail;
    141 } FILE;
     99/** Forward declaration */
     100struct _IO_FILE;
     101typedef struct _IO_FILE FILE;
    142102
    143103extern FILE *stdin;
  • uspace/lib/c/include/str.h

    r2bdf8313 rb0f00a9  
    11/*
    22 * Copyright (c) 2005 Martin Decky
     3 * Copyright (c) 2011 Oleg Romanenko
    34 * All rights reserved.
    45 *
     
    4849#define STR_BOUNDS(length)  ((length) << 2)
    4950
     51/**
     52 * Maximum size of a buffer needed to a string converted from space-padded
     53 * ASCII of size @a spa_size using spascii_to_str().
     54 */
     55#define SPASCII_STR_BUFSIZE(spa_size) ((spa_size) + 1)
     56
    5057extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
    5158extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz);
     
    7380extern void str_append(char *dest, size_t size, const char *src);
    7481
     82extern int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n);
    7583extern void wstr_to_str(char *dest, size_t size, const wchar_t *src);
    7684extern char *wstr_to_astr(const wchar_t *src);
    7785extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src);
     86extern wchar_t *str_to_awstr(const char *src);
     87extern int utf16_to_str(char *dest, size_t size, const uint16_t *src);
     88extern int str_to_utf16(uint16_t *dest, size_t size, const char *src);
    7889
    7990extern char *str_chr(const char *str, wchar_t ch);
    8091extern char *str_rchr(const char *str, wchar_t ch);
     92
     93extern void str_rtrim(char *str, wchar_t ch);
     94extern void str_ltrim(char *str, wchar_t ch);
    8195
    8296extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos);
     
    86100extern char *str_ndup(const char *, size_t max_size);
    87101
     102extern int str_uint8_t(const char *, char **, unsigned int, bool, uint8_t *);
     103extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *);
     104extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *);
    88105extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *);
    89106extern int str_size_t(const char *, char **, unsigned int, bool, size_t *);
  • uspace/lib/c/include/sys/stat.h

    r2bdf8313 rb0f00a9  
    3939#include <bool.h>
    4040#include <ipc/vfs.h>
    41 #include <ipc/devmap.h>
     41#include <ipc/loc.h>
    4242
    4343struct stat {
    4444        fs_handle_t fs_handle;
    45         devmap_handle_t devmap_handle;
     45        service_id_t service_id;
    4646        fs_index_t index;
    4747        unsigned int lnkcnt;
     
    4949        bool is_directory;
    5050        aoff64_t size;
    51         devmap_handle_t device;
     51        service_id_t service;
    5252};
    5353
  • uspace/lib/c/include/sys/time.h

    r2bdf8313 rb0f00a9  
    6262extern int gettimeofday(struct timeval *tv, struct timezone *tz);
    6363
     64extern void udelay(useconds_t);
     65
    6466#endif
    6567
  • uspace/lib/c/include/syscall.h

    r2bdf8313 rb0f00a9  
    4545
    4646#include <sys/types.h>
    47 #include <kernel/syscall/syscall.h>
     47#include <abi/syscall.h>
    4848
    4949#define __syscall0  __syscall
  • uspace/lib/c/include/sysinfo.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_SYSINFO_H_
    3737
    38 #include <libc.h>
     38#include <sys/types.h>
     39#include <bool.h>
     40#include <abi/sysinfo.h>
    3941
    40 /** Sysinfo value types
    41  *
    42  */
    43 typedef enum {
    44         SYSINFO_VAL_UNDEFINED = 0,
    45         SYSINFO_VAL_VAL = 1,
    46         SYSINFO_VAL_DATA = 2
    47 } sysinfo_item_tag_t;
    48 
    49 extern sysinfo_item_tag_t sysinfo_get_tag(const char *);
     42extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *);
    5043extern int sysinfo_get_value(const char *, sysarg_t *);
    5144extern void *sysinfo_get_data(const char *, size_t *);
  • uspace/lib/c/include/task.h

    r2bdf8313 rb0f00a9  
    3737
    3838#include <sys/types.h>
    39 
    40 typedef uint64_t task_id_t;
     39#include <abi/proc/task.h>
    4140
    4241typedef enum {
     
    5150extern task_id_t task_spawn(const char *, const char *const[], int *);
    5251extern int task_spawnv(task_id_t *, const char *path, const char *const []);
     52extern int task_spawnvf(task_id_t *, const char *path, const char *const [],
     53    int *const []);
    5354extern int task_spawnl(task_id_t *, const char *path, ...);
    5455
  • uspace/lib/c/include/thread.h

    r2bdf8313 rb0f00a9  
    3838#include <libarch/thread.h>
    3939#include <sys/types.h>
    40 
    41 typedef uint64_t thread_id_t;
     40#include <abi/proc/thread.h>
    4241
    4342extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *);
  • uspace/lib/c/include/udebug.h

    r2bdf8313 rb0f00a9  
    3636#define LIBC_UDEBUG_H_
    3737
    38 #include <kernel/udebug/udebug.h>
     38#include <abi/udebug.h>
    3939#include <sys/types.h>
     40#include <async.h>
    4041
    4142typedef sysarg_t thash_t;
    4243
    43 int udebug_begin(int);
    44 int udebug_end(int);
    45 int udebug_set_evmask(int, udebug_evmask_t);
    46 int udebug_thread_read(int, void *, size_t , size_t *, size_t *);
    47 int udebug_name_read(int, void *, size_t, size_t *, size_t *);
    48 int udebug_areas_read(int, void *, size_t, size_t *, size_t *);
    49 int udebug_mem_read(int, void *, uintptr_t, size_t);
    50 int udebug_args_read(int, thash_t, sysarg_t *);
    51 int udebug_regs_read(int, thash_t, void *);
    52 int udebug_go(int, thash_t, udebug_event_t *, sysarg_t *, sysarg_t *);
    53 int udebug_stop(int, thash_t);
     44extern int udebug_begin(async_sess_t *);
     45extern int udebug_end(async_sess_t *);
     46extern int udebug_set_evmask(async_sess_t *, udebug_evmask_t);
     47extern int udebug_thread_read(async_sess_t *, void *, size_t , size_t *,
     48    size_t *);
     49extern int udebug_name_read(async_sess_t *, void *, size_t, size_t *,
     50    size_t *);
     51extern int udebug_areas_read(async_sess_t *, void *, size_t, size_t *,
     52    size_t *);
     53extern int udebug_mem_read(async_sess_t *, void *, uintptr_t, size_t);
     54extern int udebug_args_read(async_sess_t *, thash_t, sysarg_t *);
     55extern int udebug_regs_read(async_sess_t *, thash_t, void *);
     56extern int udebug_go(async_sess_t *, thash_t, udebug_event_t *, sysarg_t *,
     57    sysarg_t *);
     58extern int udebug_stop(async_sess_t *, thash_t);
    5459
    5560#endif
  • uspace/lib/c/include/unistd.h

    r2bdf8313 rb0f00a9  
    6363extern ssize_t read(int, void *, size_t);
    6464
     65extern ssize_t read_all(int, void *, size_t);
     66extern ssize_t write_all(int, const void *, size_t);
     67
    6568extern off64_t lseek(int, off64_t, int);
    6669extern int ftruncate(int, aoff64_t);
  • uspace/lib/c/include/vfs/vfs.h

    r2bdf8313 rb0f00a9  
    3838#include <sys/types.h>
    3939#include <ipc/vfs.h>
    40 #include <ipc/devmap.h>
     40#include <ipc/loc.h>
     41#include <adt/list.h>
    4142#include <stdio.h>
     43#include <async.h>
     44#include "vfs_mtab.h"
    4245
    43 /**
    44  * This type is a libc version of the VFS triplet.
    45  * It uniquely identifies a file system node within a file system instance.
    46  */
    47 typedef struct {
    48         fs_handle_t fs_handle;
    49         devmap_handle_t devmap_handle;
    50         fs_index_t index;
    51 } fdi_node_t;
     46enum vfs_change_state_type {
     47        VFS_PASS_HANDLE
     48};
    5249
    5350extern char *absolutize(const char *, size_t *);
    5451
    5552extern int mount(const char *, const char *, const char *, const char *,
    56     unsigned int);
     53    unsigned int, unsigned int);
    5754extern int unmount(const char *);
    5855
    59 extern int open_node(fdi_node_t *, int);
    60 extern int fd_phone(int);
    61 extern int fd_node(int, fdi_node_t *);
     56extern int fhandle(FILE *, int *);
    6257
    63 extern FILE *fopen_node(fdi_node_t *, const char *);
    64 extern int fphone(FILE *);
    65 extern int fnode(FILE *, fdi_node_t *);
     58extern int fd_wait(void);
     59extern int get_mtab_list(list_t *mtab_list);
     60
     61extern async_exch_t *vfs_exchange_begin(void);
     62extern void vfs_exchange_end(async_exch_t *);
    6663
    6764#endif
Note: See TracChangeset for help on using the changeset viewer.