Changeset b0f00a9 in mainline for uspace/lib/c/include
- Timestamp:
- 2011-11-06T22:21:05Z (14 years ago)
- 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. - Location:
- uspace/lib/c/include
- Files:
-
- 13 added
- 1 deleted
- 58 edited
- 5 moved
-
adt/hash_set.h (added)
-
adt/hash_table.h (modified) (3 diffs)
-
adt/list.h (modified) (14 diffs)
-
adt/measured_strings.h (modified) (2 diffs)
-
adt/prodcons.h (modified) (1 diff)
-
as.h (modified) (2 diffs)
-
assert.h (modified) (3 diffs)
-
async.h (modified) (10 diffs)
-
bitops.h (modified) (1 diff)
-
bool.h (modified) (1 diff)
-
cfg.h (added)
-
ddi.h (modified) (1 diff)
-
device/char_dev.h (modified) (2 diffs)
-
device/hw_res.h (modified) (6 diffs)
-
device/hw_res_parsed.h (added)
-
device/nic.h (added)
-
devman.h (modified) (1 diff)
-
elf/elf.h (moved) (moved from uspace/srv/hid/adb_mouse/adb_dev.h ) (3 diffs)
-
elf/elf_linux.h (added)
-
elf/elf_load.h (moved) (moved from uspace/srv/loader/include/elf_load.h ) (3 diffs)
-
errno.h (modified) (2 diffs)
-
event.h (modified) (1 diff)
-
fibril_synch.h (modified) (6 diffs)
-
fourcc.h (added)
-
io/color.h (modified) (1 diff)
-
io/console.h (modified) (1 diff)
-
io/klog.h (modified) (1 diff)
-
io/screenbuffer.h (deleted)
-
ipc/bd.h (modified) (1 diff)
-
ipc/clipboard.h (modified) (1 diff)
-
ipc/common.h (modified) (2 diffs)
-
ipc/console.h (modified) (1 diff)
-
ipc/dev_iface.h (modified) (2 diffs)
-
ipc/devman.h (modified) (5 diffs)
-
ipc/il.h (modified) (1 diff)
-
ipc/input.h (added)
-
ipc/ipc.h (modified) (2 diffs)
-
ipc/kbdev.h (added)
-
ipc/loc.h (moved) (moved from uspace/lib/c/include/ipc/devmap.h ) (2 diffs)
-
ipc/mouseev.h (moved) (moved from uspace/lib/c/include/ipc/kbd.h ) (2 diffs)
-
ipc/net.h (modified) (4 diffs)
-
ipc/net_net.h (modified) (1 diff)
-
ipc/nil.h (modified) (1 diff)
-
ipc/ns.h (modified) (2 diffs)
-
ipc/serial_ctl.h (modified) (2 diffs)
-
ipc/services.h (modified) (1 diff)
-
ipc/vfs.h (modified) (5 diffs)
-
l18n/langs.h (added)
-
libc.h (modified) (1 diff)
-
loader/loader.h (modified) (2 diffs)
-
loader/pcb.h (modified) (2 diffs)
-
loc.h (added)
-
net/device.h (modified) (4 diffs)
-
net/eth_phys.h (added)
-
net/icmp_api.h (modified) (2 diffs)
-
net/icmp_common.h (modified) (1 diff)
-
net/modules.h (modified) (1 diff)
-
net/packet.h (modified) (3 diffs)
-
net/packet_header.h (modified) (2 diffs)
-
ns.h (moved) (moved from uspace/srv/hid/console/gcons.h ) (2 diffs)
-
rtld/elf_dyn.h (modified) (1 diff)
-
rtld/rtld.h (modified) (1 diff)
-
rtld/symbol.h (modified) (1 diff)
-
stats.h (modified) (1 diff)
-
stdio.h (modified) (1 diff)
-
str.h (modified) (4 diffs)
-
sys/stat.h (modified) (2 diffs)
-
sys/time.h (modified) (1 diff)
-
syscall.h (modified) (1 diff)
-
sysinfo.h (modified) (1 diff)
-
task.h (modified) (2 diffs)
-
thread.h (modified) (1 diff)
-
udebug.h (modified) (1 diff)
-
unistd.h (modified) (1 diff)
-
vfs/vfs.h (modified) (1 diff)
-
vfs/vfs_mtab.h (added)
-
vfs/vfs_sess.h (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
r2bdf8313 rb0f00a9 38 38 #include <adt/list.h> 39 39 #include <unistd.h> 40 #include <bool.h> 40 41 41 42 typedef unsigned long hash_count_t; … … 74 75 /** Hash table structure. */ 75 76 typedef struct { 76 li nk_t *entry;77 list_t *entry; 77 78 hash_count_t entries; 78 79 hash_count_t max_keys; … … 83 84 list_get_instance((item), type, member) 84 85 85 extern inthash_table_create(hash_table_t *, hash_count_t, hash_count_t,86 extern bool hash_table_create(hash_table_t *, hash_count_t, hash_count_t, 86 87 hash_table_operations_t *); 88 extern void hash_table_clear(hash_table_t *); 87 89 extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *); 88 90 extern link_t *hash_table_find(hash_table_t *, unsigned long []); -
uspace/lib/c/include/adt/list.h
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 36 37 #define LIBC_LIST_H_ 37 38 39 #include <assert.h> 38 40 #include <unistd.h> 39 41 40 /** Doubly linked list head and link type. */42 /** Doubly linked list link. */ 41 43 typedef struct link { 42 44 struct link *prev; /**< Pointer to the previous item in the list. */ … … 44 46 } link_t; 45 47 48 /** Doubly linked list. */ 49 typedef struct list { 50 link_t head; /**< List head. Does not have any data. */ 51 } list_t; 52 46 53 /** Declare and initialize statically allocated list. 47 54 * … … 50 57 */ 51 58 #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 } \ 55 64 } 56 65 … … 59 68 60 69 #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)) 63 75 64 76 /** Initialize doubly-linked circular list link … … 79 91 * Initialize doubly-linked circular list. 80 92 * 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 */ 96 static 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 */ 105 static 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 */ 116 static 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; 88 122 } 89 123 … … 93 127 * 94 128 * @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 */ 132 static inline void list_prepend(link_t *link, list_t *list) 133 { 134 list_insert_after(link, &list->head); 104 135 } 105 136 … … 109 140 * 110 141 * @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 */ 145 static inline void list_append(link_t *link, list_t *list) 146 { 147 list_insert_before(link, &list->head); 136 148 } 137 149 … … 146 158 static inline void list_remove(link_t *link) 147 159 { 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 150 165 link_initialize(link); 151 166 } … … 155 170 * Query emptiness of doubly-linked circular list. 156 171 * 157 * @param list Pointer to lin k_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 alist.166 * 167 * @param list Pointer to li nk_t structure representing the list.172 * @param list Pointer to lins_t structure. 173 * 174 */ 175 static 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. 168 183 * 169 184 * @return Head item of the list. … … 171 186 * 172 187 */ 173 static inline link_t *list_head(link_t *list) 174 { 175 return ((list->next == list) ? NULL : list->next); 188 static 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 */ 201 static inline link_t *list_last(list_t *list) 202 { 203 return ((list->head.prev == &list->head) ? NULL : list->head.prev); 176 204 } 177 205 … … 230 258 } 231 259 232 /** Get n-th item ofa list.260 /** Get n-th item in a list. 233 261 * 234 262 * @param list Pointer to link_t structure representing the list. … … 239 267 * 240 268 */ 241 static inline link_t *list_nth(li nk_t *list, unsigned int n)269 static inline link_t *list_nth(list_t *list, unsigned int n) 242 270 { 243 271 unsigned int cnt = 0; … … 253 281 } 254 282 255 extern int list_member(const link_t *, const li nk_t *);256 extern void list_concat(li nk_t *, link_t *);257 extern unsigned int list_count(const li nk_t *);283 extern int list_member(const link_t *, const list_t *); 284 extern void list_concat(list_t *, list_t *); 285 extern unsigned int list_count(const list_t *); 258 286 259 287 #endif -
uspace/lib/c/include/adt/measured_strings.h
r2bdf8313 rb0f00a9 41 41 42 42 #include <sys/types.h> 43 #include <async.h> 43 44 44 45 /** Type definition of the character string with measured length. … … 64 65 extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t); 65 66 extern 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 68 extern int measured_strings_return(async_exch_t *, measured_string_t **, 69 uint8_t **, size_t); 70 extern int measured_strings_send(async_exch_t *, const measured_string_t *, 71 size_t); 68 72 69 73 #endif -
uspace/lib/c/include/adt/prodcons.h
r2bdf8313 rb0f00a9 42 42 fibril_mutex_t mtx; 43 43 fibril_condvar_t cv; 44 li nk_t list;44 list_t list; 45 45 } prodcons_t; 46 46 -
uspace/lib/c/include/as.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include <abi/mm/as.h> 39 40 #include <task.h> 40 #include <kernel/mm/as.h>41 41 #include <libarch/config.h> 42 42 … … 60 60 extern void *set_maxheapsize(size_t); 61 61 extern void *as_get_mappable_page(size_t); 62 extern int as_get_physical_mapping(const void *, uintptr_t *); 62 63 63 64 #endif -
uspace/lib/c/include/assert.h
r2bdf8313 rb0f00a9 47 47 */ 48 48 49 #define STR(l) #l50 #define STR2(l) STR(l)51 52 49 #ifndef NDEBUG 53 50 … … 55 52 do { \ 56 53 if (!(expr)) \ 57 assert_abort(#expr, __FILE__, STR2(__LINE__)); \54 assert_abort(#expr, __FILE__, __LINE__); \ 58 55 } while (0) 59 56 … … 64 61 #endif /* NDEBUG */ 65 62 66 extern void assert_abort(const char *, const char *, const char *)63 extern void assert_abort(const char *, const char *, unsigned int) 67 64 __attribute__((noreturn)); 68 69 65 70 66 #endif -
uspace/lib/c/include/async.h
r2bdf8313 rb0f00a9 41 41 42 42 #include <ipc/common.h> 43 #include <async_sess.h>44 43 #include <fibril.h> 45 44 #include <sys/time.h> … … 53 52 typedef void (*async_client_data_dtor_t)(void *); 54 53 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 */ 62 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *, void *); 63 64 /** Interrupt handler */ 65 typedef void (*async_interrupt_handler_t)(ipc_callid_t, ipc_call_t *); 66 67 /** Exchange management style 68 * 69 */ 70 typedef 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 */ 98 struct async_exch; 99 struct async_sess; 100 101 typedef struct async_sess async_sess_t; 102 typedef struct async_exch async_exch_t; 56 103 57 104 extern atomic_t threads_in_ipc_wait; … … 68 115 * User-friendly wrappers for async_send_fast() and async_send_slow(). The 69 116 * 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 based117 * arguments. Each macros chooses between the fast and the slow version based 71 118 * on m. 72 119 */ 73 120 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 134 extern aid_t async_send_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 92 135 sysarg_t, sysarg_t, ipc_call_t *); 136 extern 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 93 139 extern void async_wait_for(aid_t, sysarg_t *); 94 140 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t); 95 141 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 *)); 142 extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t, 143 ipc_call_t *, async_client_conn_t, void *); 144 98 145 extern void async_usleep(suseconds_t); 99 146 extern void async_create_manager(void); … … 102 149 extern void async_set_client_data_constructor(async_client_data_ctor_t); 103 150 extern void async_set_client_data_destructor(async_client_data_dtor_t); 104 105 extern void *async_client_data_get(void); 151 extern void *async_get_client_data(void); 152 extern void *async_get_client_data_by_id(task_id_t); 153 extern void async_put_client_data_by_id(task_id_t); 106 154 107 155 extern void async_set_client_connection(async_client_conn_t); 108 extern void async_set_interrupt_received(async_ client_conn_t);156 extern void async_set_interrupt_received(async_interrupt_handler_t); 109 157 110 158 /* … … 112 160 */ 113 161 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, 162 extern void async_msg_0(async_exch_t *, sysarg_t); 163 extern void async_msg_1(async_exch_t *, sysarg_t, sysarg_t); 164 extern void async_msg_2(async_exch_t *, sysarg_t, sysarg_t, sysarg_t); 165 extern void async_msg_3(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t); 166 extern void async_msg_4(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 120 167 sysarg_t); 168 extern void async_msg_5(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 169 sysarg_t, sysarg_t); 121 170 122 171 /* … … 138 187 */ 139 188 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);189 extern int async_forward_fast(ipc_callid_t, async_exch_t *, sysarg_t, sysarg_t, 190 sysarg_t, unsigned int); 191 extern 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); 144 193 145 194 /* … … 150 199 */ 151 200 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, \ 190 274 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, \ 193 277 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, \ 196 301 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, \ 255 303 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, \ 259 307 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, \ 263 311 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 315 extern sysarg_t async_req_fast(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 270 316 sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, 271 317 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); 318 extern 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 322 extern async_sess_t *async_connect_me(exch_mgmt_t, async_exch_t *); 323 extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t, 324 sysarg_t, sysarg_t); 325 extern async_sess_t *async_connect_me_to_blocking(exch_mgmt_t, async_exch_t *, 326 sysarg_t, sysarg_t, sysarg_t); 327 extern async_sess_t *async_connect_kbox(task_id_t); 328 329 extern int async_connect_to_me(async_exch_t *, sysarg_t, sysarg_t, sysarg_t, 330 async_client_conn_t, void *); 331 332 extern int async_hangup(async_sess_t *); 289 333 extern void async_poke(void); 290 334 335 extern async_exch_t *async_exchange_begin(async_sess_t *); 336 extern 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 */ 342 void async_sess_args_set(async_sess_t *sess, sysarg_t, sysarg_t, sysarg_t); 343 291 344 /* 292 345 * User-friendly wrappers for async_share_in_start(). 293 346 */ 294 347 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 357 extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t, 358 unsigned int *); 305 359 extern bool async_share_in_receive(ipc_callid_t *, size_t *); 306 360 extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int); 307 361 308 extern int async_share_out_start( int, void *, unsigned int);362 extern int async_share_out_start(async_exch_t *, void *, unsigned int); 309 363 extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *); 310 364 extern int async_share_out_finalize(ipc_callid_t, void *); … … 314 368 */ 315 369 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 396 extern aid_t async_data_read(async_exch_t *, void *, size_t, ipc_call_t *); 397 extern int async_data_read_start(async_exch_t *, void *, size_t); 346 398 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 347 399 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 348 400 349 extern int async_data_read_forward_fast( int, sysarg_t, sysarg_t, sysarg_t,350 sysarg_t, sysarg_t, ipc_call_t *);401 extern int async_data_read_forward_fast(async_exch_t *, sysarg_t, sysarg_t, 402 sysarg_t, sysarg_t, sysarg_t, ipc_call_t *); 351 403 352 404 /* … … 354 406 */ 355 407 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 435 extern int async_data_write_start(async_exch_t *, const void *, size_t); 388 436 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 389 437 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); … … 393 441 extern void async_data_write_void(sysarg_t); 394 442 395 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t, 396 sysarg_t, sysarg_t, ipc_call_t *); 443 extern int async_data_write_forward_fast(async_exch_t *, sysarg_t, sysarg_t, 444 sysarg_t, sysarg_t, sysarg_t, ipc_call_t *); 445 446 extern int async_exchange_clone(async_exch_t *, async_exch_t *); 447 extern async_sess_t *async_clone_receive(exch_mgmt_t); 448 extern async_sess_t *async_callback_receive(exch_mgmt_t); 449 extern async_sess_t *async_callback_receive_start(exch_mgmt_t, ipc_call_t *); 450 451 extern int async_state_change_start(async_exch_t *, sysarg_t, sysarg_t, 452 sysarg_t, async_exch_t *); 453 extern bool async_state_change_receive(ipc_callid_t *, sysarg_t *, sysarg_t *, 454 sysarg_t *); 455 extern int async_state_change_finalize(ipc_callid_t, async_exch_t *); 456 457 extern void *async_remote_state_acquire(async_sess_t *); 458 extern void async_remote_state_update(async_sess_t *, void *); 459 extern void async_remote_state_release(async_sess_t *); 460 extern void async_remote_state_release_exchange(async_exch_t *); 397 461 398 462 #endif -
uspace/lib/c/include/bitops.h
r2bdf8313 rb0f00a9 38 38 #include <sys/types.h> 39 39 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)) 40 55 41 56 /** Return position of first non-zero bit from left (i.e. [log_2(arg)]). -
uspace/lib/c/include/bool.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <libarch/types.h> 39 #include <abi/bool.h> 39 40 40 41 #define false 0 41 42 #define true 1 42 43 typedef uint8_t bool;44 43 45 44 #endif -
uspace/lib/c/include/ddi.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include < kernel/ddi/irq.h>39 #include <abi/ddi/irq.h> 40 40 #include <task.h> 41 41 -
uspace/lib/c/include/device/char_dev.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_DEVICE_CHAR_DEV_H_ 37 37 38 #include <async.h> 39 38 40 typedef enum { 39 41 CHAR_DEV_READ = 0, … … 41 43 } char_dev_method_t; 42 44 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);45 extern ssize_t char_dev_read(async_sess_t *, void *, size_t); 46 extern ssize_t char_dev_write(async_sess_t *, void *, size_t); 45 47 46 48 #endif -
uspace/lib/c/include/device/hw_res.h
r2bdf8313 rb0f00a9 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ … … 32 32 /** @file 33 33 */ 34 34 35 35 #ifndef LIBC_DEVICE_HW_RES_H_ 36 36 #define LIBC_DEVICE_HW_RES_H_ 37 37 38 38 #include <ipc/dev_iface.h> 39 #include <async.h> 39 40 #include <bool.h> 40 41 … … 48 49 typedef enum { 49 50 INTERRUPT, 50 IO_RANGE, 51 IO_RANGE, 51 52 MEM_RANGE 52 53 } hw_res_type_t; … … 66 67 size_t size; 67 68 } mem_range; 68 69 69 70 struct { 70 71 uint64_t address; … … 72 73 size_t size; 73 74 } io_range; 74 75 75 76 struct { 76 77 int irq; … … 88 89 if (hw_res->resources != NULL) { 89 90 free(hw_res->resources); 90 91 91 hw_res->resources = NULL; 92 92 } 93 93 94 94 hw_res->count = 0; 95 95 } 96 96 97 extern int hw_res_get_resource_list( int, hw_resource_list_t *);98 extern bool hw_res_enable_interrupt( int);97 extern int hw_res_get_resource_list(async_sess_t *, hw_resource_list_t *); 98 extern bool hw_res_enable_interrupt(async_sess_t *); 99 99 100 100 #endif -
uspace/lib/c/include/devman.h
r2bdf8313 rb0f00a9 38 38 39 39 #include <ipc/devman.h> 40 #include <ipc/loc.h> 40 41 #include <async.h> 41 42 #include <bool.h> 42 43 43 extern int devman_get_phone(devman_interface_t, unsigned int); 44 extern void devman_hangup_phone(devman_interface_t); 44 extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t); 45 extern async_exch_t *devman_exchange_begin(devman_interface_t); 46 extern void devman_exchange_end(async_exch_t *); 45 47 46 48 extern int devman_driver_register(const char *, async_client_conn_t); 47 49 extern int devman_add_function(const char *, fun_type_t, match_id_list_t *, 48 50 devman_handle_t, devman_handle_t *); 51 extern int devman_remove_function(devman_handle_t); 52 extern int devman_drv_fun_online(devman_handle_t); 53 extern int devman_drv_fun_offline(devman_handle_t); 49 54 50 extern int devman_device_connect(devman_handle_t, unsigned int); 51 extern int devman_parent_device_connect(devman_handle_t, unsigned int); 55 extern async_sess_t *devman_device_connect(exch_mgmt_t, devman_handle_t, 56 unsigned int); 57 extern async_sess_t *devman_parent_device_connect(exch_mgmt_t, devman_handle_t, 58 unsigned int); 52 59 53 extern int devman_ device_get_handle(const char *, devman_handle_t *,60 extern int devman_fun_get_handle(const char *, devman_handle_t *, 54 61 unsigned int); 55 extern int devman_device_get_handle_by_class(const char *, const char *, 56 devman_handle_t *, unsigned int); 62 extern int devman_fun_get_child(devman_handle_t, devman_handle_t *); 63 extern int devman_dev_get_functions(devman_handle_t, devman_handle_t **, 64 size_t *); 65 extern int devman_fun_get_name(devman_handle_t, char *, size_t); 66 extern int devman_fun_get_path(devman_handle_t, char *, size_t); 67 extern int devman_fun_online(devman_handle_t); 68 extern int devman_fun_offline(devman_handle_t); 57 69 58 extern int devman_add_device_to_class(devman_handle_t, const char *); 70 extern int devman_add_device_to_category(devman_handle_t, const char *); 71 extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *); 59 72 60 73 #endif -
uspace/lib/c/include/elf/elf.h
r2bdf8313 rb0f00a9 1 1 /* 2 * Copyright (c) 201 0Jiri Svoboda2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup mouse 30 * @brief 29 /** @addtogroup generic 31 30 * @{ 32 31 */ … … 34 33 */ 35 34 36 #ifndef ADBDEV_H_37 #define ADBDEV_H_35 #ifndef LIBC_ELF_H_ 36 #define LIBC_ELF_H_ 38 37 39 38 #include <sys/types.h> 40 41 extern int adb_dev_init(void); 39 #include <abi/elf.h> 40 #include <libarch/elf.h> 42 41 43 42 #endif 44 43 45 /** 46 * @} 47 */ 48 44 /** @} 45 */ -
uspace/lib/c/include/elf/elf_load.h
r2bdf8313 rb0f00a9 1 1 /* 2 * Copyright (c) 2006 Sergey Bondari 2 3 * Copyright (c) 2008 Jiri Svoboda 3 4 * All rights reserved. … … 37 38 #define ELF_LOAD_H_ 38 39 39 #include < arch/elf.h>40 #include <elf/elf.h> 40 41 #include <sys/types.h> 41 42 #include <loader/pcb.h> 42 43 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 44 54 45 55 typedef enum { … … 82 92 } elf_ld_t; 83 93 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);94 extern const char *elf_error(unsigned int); 95 extern int elf_load_file(const char *, size_t, eld_flags_t, elf_info_t *); 96 extern void elf_create_pcb(elf_info_t *, pcb_t *); 87 97 88 98 #endif -
uspace/lib/c/include/errno.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_ERRNO_H_ 37 37 38 #include < kernel/errno.h>38 #include <abi/errno.h> 39 39 #include <fibril.h> 40 40 … … 55 55 #define EIO (-265) 56 56 #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) 57 70 58 71 /** An API function is called while another blocking function is in progress. */ -
uspace/lib/c/include/event.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_EVENT_H_ 37 37 38 #include <kernel/ipc/event_types.h> 38 #include <abi/ipc/event.h> 39 #include <libarch/types.h> 39 40 40 41 extern int event_subscribe(event_type_t, sysarg_t); 42 extern int event_task_subscribe(event_task_type_t, sysarg_t); 41 43 extern int event_unmask(event_type_t); 44 extern int event_task_unmask(event_task_type_t); 42 45 43 46 #endif -
uspace/lib/c/include/fibril_synch.h
r2bdf8313 rb0f00a9 45 45 fibril_owner_info_t oi; /**< Keep this the first thing. */ 46 46 int counter; 47 li nk_t waiters;47 list_t waiters; 48 48 } fibril_mutex_t; 49 49 … … 55 55 .counter = 1, \ 56 56 .waiters = { \ 57 .prev = &name.waiters, \ 58 .next = &name.waiters, \ 57 .head = { \ 58 .prev = &(name).waiters.head, \ 59 .next = &(name).waiters.head, \ 60 } \ 59 61 } \ 60 62 } … … 67 69 unsigned writers; 68 70 unsigned readers; 69 li nk_t waiters;71 list_t waiters; 70 72 } fibril_rwlock_t; 71 73 … … 78 80 .writers = 0, \ 79 81 .waiters = { \ 80 .prev = &name.waiters, \ 81 .next = &name.waiters, \ 82 .head = { \ 83 .prev = &(name).waiters.head, \ 84 .next = &(name).waiters.head, \ 85 } \ 82 86 } \ 83 87 } … … 87 91 88 92 typedef struct { 89 li nk_t waiters;93 list_t waiters; 90 94 } fibril_condvar_t; 91 95 … … 93 97 { \ 94 98 .waiters = { \ 95 .next = &name.waiters, \ 96 .prev = &name.waiters, \ 99 .head = { \ 100 .next = &(name).waiters.head, \ 101 .prev = &(name).waiters.head, \ 102 } \ 97 103 } \ 98 104 } -
uspace/lib/c/include/io/color.h
r2bdf8313 rb0f00a9 44 44 COLOR_MAGENTA = 5, 45 45 COLOR_YELLOW = 6, 46 COLOR_WHITE = 7, 47 48 CATTR_BRIGHT = 8, 49 CATTR_BLINK = 8 46 COLOR_WHITE = 7 50 47 } console_color_t; 48 49 typedef enum { 50 CATTR_NORMAL = 0, 51 CATTR_BRIGHT = 8, 52 CATTR_BLINK = 16 53 } console_color_attr_t; 51 54 52 55 #endif -
uspace/lib/c/include/io/console.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_IO_CONSOLE_H_ 37 37 38 #include <sys/time.h> 39 #include <io/keycode.h> 40 #include <async.h> 38 41 #include <bool.h> 42 #include <stdio.h> 43 44 typedef 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. */ 52 typedef 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; 39 71 40 72 typedef enum { 41 73 KEY_PRESS, 42 74 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; 51 76 52 77 /** Console event structure. */ 53 78 typedef struct { 79 /** List handle */ 80 link_t link; 81 54 82 /** Press or release event. */ 55 console_ev_type_t type;83 kbd_event_type_t type; 56 84 57 85 /** Keycode of the key that was pressed or released. */ 58 unsigned int key;86 keycode_t key; 59 87 60 88 /** Bitmask of modifiers held. */ 61 unsigned int mods;89 keymod_t mods; 62 90 63 91 /** The character that was generated or '\0' for none. */ 64 92 wchar_t c; 65 } console_event_t;93 } kbd_event_t; 66 94 67 extern void console_clear(int phone); 95 extern console_ctrl_t *console_init(FILE *, FILE *); 96 extern void console_done(console_ctrl_t *); 97 extern bool console_kcon(void); 68 98 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); 99 extern void console_flush(console_ctrl_t *); 100 extern void console_clear(console_ctrl_t *); 72 101 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); 102 extern int console_get_size(console_ctrl_t *, sysarg_t *, sysarg_t *); 103 extern int console_get_pos(console_ctrl_t *, sysarg_t *, sysarg_t *); 104 extern void console_set_pos(console_ctrl_t *, sysarg_t, sysarg_t); 77 105 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);106 extern void console_set_style(console_ctrl_t *, uint8_t); 107 extern void console_set_color(console_ctrl_t *, uint8_t, uint8_t, uint8_t); 108 extern void console_set_rgb_color(console_ctrl_t *, uint32_t, uint32_t); 81 109 82 extern bool console_get_event(int phone, console_event_t *event); 110 extern void console_cursor_visibility(console_ctrl_t *, bool); 111 extern int console_get_color_cap(console_ctrl_t *, sysarg_t *); 112 extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *); 113 extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *, 114 suseconds_t *); 83 115 84 116 #endif -
uspace/lib/c/include/io/klog.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include <stdarg.h> 39 40 40 41 extern size_t klog_write(const void *, size_t); 41 42 extern void klog_update(void); 43 extern int klog_printf(const char *, ...); 44 extern int klog_vprintf(const char *, va_list); 42 45 43 46 #endif -
uspace/lib/c/include/ipc/bd.h
r2bdf8313 rb0f00a9 42 42 BD_GET_NUM_BLOCKS, 43 43 BD_READ_BLOCKS, 44 BD_WRITE_BLOCKS 44 BD_WRITE_BLOCKS, 45 BD_READ_TOC 45 46 } bd_request_t; 46 47 -
uspace/lib/c/include/ipc/clipboard.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_IPC_CLIPBOARD_H_ 37 37 38 #include <ipc/common.h> 39 38 40 typedef enum { 39 41 CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD, -
uspace/lib/c/include/ipc/common.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include <abi/ipc/ipc.h> 39 40 #include <atomic.h> 40 #include < kernel/ipc/ipc.h>41 #include <task.h> 41 42 42 43 #define IPC_FLAG_BLOCKING 0x01 … … 44 45 typedef struct { 45 46 sysarg_t args[IPC_CALL_LEN]; 46 sysarg_t in_task_hash;47 task_id_t in_task_id; 47 48 sysarg_t in_phone_hash; 48 49 } ipc_call_t; -
uspace/lib/c/include/ipc/console.h
r2bdf8313 rb0f00a9 48 48 CONSOLE_SET_COLOR, 49 49 CONSOLE_SET_RGB_COLOR, 50 CONSOLE_CURSOR_VISIBILITY, 51 CONSOLE_KCON_ENABLE 50 CONSOLE_CURSOR_VISIBILITY 52 51 } console_request_t; 53 52 -
uspace/lib/c/include/ipc/dev_iface.h
r2bdf8313 rb0f00a9 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 /** Character device interface */ 38 39 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 39 54 DEV_IFACE_MAX 40 55 } dev_inferface_idx_t; … … 48 63 DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX) 49 64 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 50 75 51 76 #endif -
uspace/lib/c/include/ipc/devman.h
r2bdf8313 rb0f00a9 72 72 */ 73 73 typedef struct match_id_list { 74 li nk_t ids;74 list_t ids; 75 75 } match_id_list_t; 76 76 … … 95 95 { 96 96 match_id_t *mid = NULL; 97 link_t *link = ids->ids. next;97 link_t *link = ids->ids.head.next; 98 98 99 while (link != &ids->ids ) {99 while (link != &ids->ids.head) { 100 100 mid = list_get_instance(link, match_id_t,link); 101 101 if (mid->score < id->score) { 102 102 break; 103 } 103 } 104 104 link = link->next; 105 105 } … … 118 118 match_id_t *id; 119 119 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); 123 123 id = list_get_instance(link, match_id_t, link); 124 delete_match_id(id); 125 } 124 delete_match_id(id); 125 } 126 126 } 127 127 … … 130 130 DEVMAN_CLIENT, 131 131 DEVMAN_CONNECT_TO_DEVICE, 132 DEVMAN_CONNECT_FROM_ DEVMAP,132 DEVMAN_CONNECT_FROM_LOC, 133 133 DEVMAN_CONNECT_TO_PARENTS_DEVICE 134 134 } devman_interface_t; … … 138 138 DEVMAN_ADD_FUNCTION, 139 139 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 142 144 } driver_to_devman_t; 143 145 144 146 typedef 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, 147 153 } devman_to_driver_t; 148 154 149 155 typedef enum { 150 156 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 152 164 } client_to_devman_t; 153 165 -
uspace/lib/c/include/ipc/il.h
r2bdf8313 rb0f00a9 54 54 NET_IL_MTU_CHANGED, 55 55 56 /** 57 * Device address changed message 58 * @see il_addr_changed_msg() 59 */ 60 NET_IL_ADDR_CHANGED, 61 56 62 /** Packet received message. 57 63 * @see il_received_msg() -
uspace/lib/c/include/ipc/ipc.h
r2bdf8313 rb0f00a9 42 42 #include <sys/types.h> 43 43 #include <ipc/common.h> 44 #include <kernel/synch/synch.h> 44 #include <abi/ipc/methods.h> 45 #include <abi/synch.h> 45 46 #include <task.h> 46 47 … … 253 254 sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool); 254 255 255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,256 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *, 256 257 sysarg_t *); 258 extern int ipc_connect_me(int); 257 259 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 258 260 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t); -
uspace/lib/c/include/ipc/loc.h
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2007 Josef Cejka 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 27 28 */ 28 29 29 /** @addtogroup devmap30 /** @addtogroup loc 30 31 * @{ 31 32 */ 32 33 33 #ifndef DEVMAP_DEVMAP_H_34 #define DEVMAP_DEVMAP_H_34 #ifndef LIBC_IPC_LOC_H_ 35 #define LIBC_IPC_LOC_H_ 35 36 36 37 #include <ipc/common.h> 37 38 38 #define DEVMAP_NAME_MAXLEN 25539 #define LOC_NAME_MAXLEN 255 39 40 40 typedef sysarg_t devmap_handle_t; 41 typedef sysarg_t service_id_t; 42 typedef sysarg_t category_id_t; 41 43 42 44 typedef enum { 43 DEV_HANDLE_NONE,44 DEV_HANDLE_NAMESPACE,45 DEV_HANDLE_DEVICE46 } devmap_handle_type_t;45 LOC_OBJECT_NONE, 46 LOC_OBJECT_NAMESPACE, 47 LOC_OBJECT_SERVICE 48 } loc_object_type_t; 47 49 48 50 typedef 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; 63 72 64 /** Interface provided by devmap. 73 typedef enum { 74 LOC_EVENT_CAT_CHANGE = IPC_FIRST_USER_METHOD 75 } loc_event_t; 76 77 /** Ports provided by location service. 65 78 * 66 * Every process that connects to devmapmust ask one of following67 * interfacesotherwise connection will be refused.79 * Every process that connects to loc must ask one of following 80 * ports, otherwise connection will be refused. 68 81 * 69 82 */ 70 83 typedef 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, 75 88 /** Create new connection to instance of device that 76 89 is specified by second argument of call. */ 77 DEVMAP_CONNECT_TO_DEVICE78 } devmap_interface_t;90 LOC_CONNECT_TO_SERVICE 91 } loc_interface_t; 79 92 80 93 typedef 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; 84 97 85 98 #endif 99 100 /** @} 101 */ -
uspace/lib/c/include/ipc/mouseev.h
r2bdf8313 rb0f00a9 27 27 */ 28 28 29 /** @addtogroup kbdgen generic 30 * @brief HelenOS generic uspace keyboard handler. 31 * @ingroup kbd 29 /** @addtogroup mouse 30 * @brief 32 31 * @{ 33 32 */ … … 35 34 */ 36 35 37 #ifndef LIBC_IPC_ KBD_H_38 #define LIBC_IPC_ KBD_H_36 #ifndef LIBC_IPC_MOUSEEV_H_ 37 #define LIBC_IPC_MOUSEEV_H_ 39 38 40 39 #include <ipc/common.h> 40 #include <ipc/dev_iface.h> 41 41 42 42 typedef enum { 43 KBD_YIELD = IPC_FIRST_USER_METHOD,44 KBD_RECLAIM45 } kbd_request_t;43 MOUSEEV_YIELD = DEV_FIRST_CUSTOM_METHOD, 44 MOUSEEV_RECLAIM 45 } mouseev_request_t; 46 46 47 47 typedef 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; 50 51 51 52 #endif -
uspace/lib/c/include/ipc/net.h
r2bdf8313 rb0f00a9 277 277 * 278 278 */ 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)) 280 280 281 281 /** Return the packet identifier message argument. … … 298 298 * 299 299 */ 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)) 301 329 302 330 /** Return the maximum transmission unit message argument. … … 305 333 * 306 334 */ 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)) 329 336 330 337 /** Return the error service message argument. … … 335 342 #define IPC_GET_ERROR(call) ((services_t) IPC_GET_ARG4(call)) 336 343 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 344 344 /** Set the device identifier in the message answer. 345 345 * -
uspace/lib/c/include/ipc/net_net.h
r2bdf8313 rb0f00a9 43 43 /** Networking subsystem central module messages. */ 44 44 typedef enum { 45 /** Return s thegeneral configuration45 /** Return general configuration 46 46 * @see net_get_conf_req() 47 47 */ 48 48 NET_NET_GET_CONF = NET_FIRST, 49 /** Return s thedevice specific configuration49 /** Return device specific configuration 50 50 * @see net_get_device_conf_req() 51 51 */ 52 52 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 55 59 } net_messages; 56 60 -
uspace/lib/c/include/ipc/nil.h
r2bdf8313 rb0f00a9 70 70 */ 71 71 NET_NIL_BROADCAST_ADDR, 72 /** Device has changed address 73 * @see nil_addr_changed_msg() 74 */ 75 NET_NIL_ADDR_CHANGED 72 76 } nil_messages; 73 77 -
uspace/lib/c/include/ipc/ns.h
r2bdf8313 rb0f00a9 33 33 */ 34 34 35 #ifndef LIBC_ NS_H_36 #define LIBC_ NS_H_35 #ifndef LIBC_IPC_NS_H_ 36 #define LIBC_IPC_NS_H_ 37 37 38 #include <sys/types.h>39 38 #include <ipc/common.h> 40 39 … … 46 45 } ns_request_t; 47 46 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 52 47 #endif 53 48 -
uspace/lib/c/include/ipc/serial_ctl.h
r2bdf8313 rb0f00a9 32 32 #include <ipc/dev_iface.h> 33 33 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 * 39 41 */ 40 typedef enum { 42 typedef enum { 41 43 SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD, 42 44 SERIAL_SET_COM_PROPS … … 48 50 SERIAL_EVEN_PARITY = 3, 49 51 SERIAL_MARK_PARITY = 5, 50 SERIAL_SPACE_PARITY = 7 52 SERIAL_SPACE_PARITY = 7 51 53 } serial_parity_t; 52 54 -
uspace/lib/c/include/ipc/services.h
r2bdf8313 rb0f00a9 38 38 #define LIBC_SERVICES_H_ 39 39 40 #include <fourcc.h> 41 40 42 typedef 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', ' ') 63 58 } services_t; 64 59 -
uspace/lib/c/include/ipc/vfs.h
r2bdf8313 rb0f00a9 42 42 #define FS_NAME_MAXLEN 20 43 43 #define MAX_PATH_LEN (64 * 1024) 44 #define MAX_MNTOPTS_LEN 256 44 45 #define PLB_SIZE (2 * MAX_PATH_LEN) 45 46 … … 56 57 /** Unique identifier of the fs. */ 57 58 char name[FS_NAME_MAXLEN + 1]; 59 unsigned int instance; 58 60 bool concurrent_read_write; 59 61 bool write_retains_size; … … 62 64 typedef enum { 63 65 VFS_IN_OPEN = IPC_FIRST_USER_METHOD, 64 VFS_IN_OPEN_NODE,65 66 VFS_IN_READ, 66 67 VFS_IN_WRITE, … … 69 70 VFS_IN_FSTAT, 70 71 VFS_IN_CLOSE, 72 VFS_IN_PING, 71 73 VFS_IN_MOUNT, 72 74 VFS_IN_UNMOUNT, … … 77 79 VFS_IN_RENAME, 78 80 VFS_IN_STAT, 79 VFS_IN_DUP 81 VFS_IN_DUP, 82 VFS_IN_WAIT_HANDLE, 83 VFS_IN_MTAB_GET, 80 84 } vfs_in_request_t; 81 85 -
uspace/lib/c/include/libc.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 #include < kernel/syscall/syscall.h>39 #include <abi/syscall.h> 40 40 #include <libarch/syscall.h> 41 41 -
uspace/lib/c/include/loader/loader.h
r2bdf8313 rb0f00a9 38 38 39 39 #include <task.h> 40 #include <vfs/vfs.h>41 40 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 */ 42 struct loader; 43 typedef struct loader loader_t; 47 44 48 45 extern int loader_spawn(const char *); … … 52 49 extern int loader_set_pathname(loader_t *, const char *); 53 50 extern int loader_set_args(loader_t *, const char *const[]); 54 extern int loader_set_files(loader_t *, fdi_node_t *const[]);51 extern int loader_set_files(loader_t *, int *const[]); 55 52 extern int loader_load_program(loader_t *); 56 53 extern int loader_run(loader_t *); -
uspace/lib/c/include/loader/pcb.h
r2bdf8313 rb0f00a9 38 38 39 39 #include <sys/types.h> 40 #include <vfs/vfs.h>41 40 42 41 typedef void (*entry_point_t)(void); … … 62 61 63 62 /** Number of preset files. */ 64 int filc; 65 /** Preset files. */ 66 fdi_node_t **filv; 63 unsigned int filc; 67 64 68 65 /* -
uspace/lib/c/include/net/device.h
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2009 Lukas Mejdrech 3 * Copyright (c) 2011 Radim Vansa 3 4 * All rights reserved. 4 5 * … … 39 40 40 41 #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) 41 62 42 63 /** Device identifier to generic type map declaration. */ 43 #define DEVICE_MAP_DECLARE INT_MAP_DECLARE64 #define DEVICE_MAP_DECLARE INT_MAP_DECLARE 44 65 45 66 /** 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 47 71 48 72 /** 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" 50 87 51 88 /** 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; 89 typedef int nic_device_id_t; 90 91 /** 92 * Structure covering the MAC address. 93 */ 94 typedef struct nic_address { 95 uint8_t address[ETH_ADDR]; 96 } nic_address_t; 61 97 62 98 /** 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 }; 99 typedef 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 */ 123 typedef 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 */ 133 typedef 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 */ 143 typedef 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 */ 152 typedef 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; 73 164 74 165 /** Device usage statistics. */ 75 structdevice_stats {76 /** Total packets received . */166 typedef struct nic_device_stats { 167 /** Total packets received (accepted). */ 77 168 unsigned long receive_packets; 78 169 /** Total packets transmitted. */ 79 170 unsigned long send_packets; 80 /** Total bytes received . */171 /** Total bytes received (accepted). */ 81 172 unsigned long receive_bytes; 82 173 /** Total bytes transmitted. */ … … 86 177 /** Packet transmition problems counter. */ 87 178 unsigned long send_errors; 88 /** N o space in buffers counter.*/179 /** Number of frames dropped due to insufficient space in RX buffers */ 89 180 unsigned long receive_dropped; 90 /** N o space available counter.*/181 /** Number of frames dropped due to insufficient space in TX buffers */ 91 182 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; 94 187 /** The number of collisions due to congestion on the medium. */ 95 188 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; 96 195 97 196 /* detailed receive_errors */ … … 129 228 /** Total compressed packet transmitted. */ 130 229 unsigned long send_compressed; 131 }; 230 } nic_device_stats_t; 231 232 /** Errors corresponding to those in the nic_device_stats_t */ 233 typedef 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 */ 245 typedef 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 */ 261 typedef 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 */ 284 typedef 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 */ 293 typedef 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 308 typedef 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 318 typedef 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 */ 329 typedef struct nic_vlan_mask { 330 uint8_t bitmap[NIC_VLAN_BITMAP_SIZE]; 331 } nic_vlan_mask_t; 332 333 /* WOL virtue identifier */ 334 typedef unsigned int nic_wv_id_t; 335 336 /** 337 * Structure passed as argument for virtue NIC_WV_MAGIC_PACKET. 338 */ 339 typedef 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 */ 346 typedef 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 */ 353 typedef 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 */ 362 typedef 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 */ 420 typedef 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 */ 451 static 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 463 static 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 } 132 476 133 477 #endif -
uspace/lib/c/include/net/icmp_api.h
r2bdf8313 rb0f00a9 42 42 #include <sys/types.h> 43 43 #include <sys/time.h> 44 45 44 #include <adt/measured_strings.h> 46 45 #include <net/ip_codes.h> 47 46 #include <net/icmp_codes.h> 48 47 #include <net/icmp_common.h> 48 #include <async.h> 49 49 50 50 /** @name ICMP module application interface … … 53 53 /*@{*/ 54 54 55 extern int icmp_echo_msg( int, size_t, mseconds_t, ip_ttl_t, ip_tos_t, int,56 const struct sockaddr *, socklen_t);55 extern int icmp_echo_msg(async_sess_t *, size_t, mseconds_t, ip_ttl_t, ip_tos_t, 56 int, const struct sockaddr *, socklen_t); 57 57 58 58 /*@}*/ -
uspace/lib/c/include/net/icmp_common.h
r2bdf8313 rb0f00a9 40 40 #include <ipc/services.h> 41 41 #include <sys/time.h> 42 #include <async.h> 42 43 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); 44 extern async_sess_t *icmp_connect_module(void); 47 45 48 46 #endif -
uspace/lib/c/include/net/modules.h
r2bdf8313 rb0f00a9 46 46 #include <sys/time.h> 47 47 48 /** Connect to the neededmodule function type definition.48 /** Connect to module function type definition. 49 49 * 50 * @param[in] need The needed module service. 51 * 52 * @return The phone of the needed service. 50 * @return Session to the service. 53 51 * 54 52 */ 55 typedef int connect_module_t(services_t need);53 typedef async_sess_t *connect_module_t(services_t); 56 54 57 55 extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t); 58 extern intbind_service(services_t, sysarg_t, sysarg_t, sysarg_t,56 extern async_sess_t *bind_service(services_t, sysarg_t, sysarg_t, sysarg_t, 59 57 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); 58 extern async_sess_t *connect_to_service(services_t); 64 59 extern int data_reply(void *, size_t); 65 60 extern void refresh_answer(ipc_call_t *, size_t *); -
uspace/lib/c/include/net/packet.h
r2bdf8313 rb0f00a9 38 38 #define LIBC_PACKET_H_ 39 39 40 #include <sys/types.h> 41 40 42 /** Packet identifier type. 41 43 * Value zero is used as an invalid identifier. 42 44 */ 43 typedef int packet_id_t;45 typedef sysarg_t packet_id_t; 44 46 45 47 /** Type definition of the packet. … … 51 53 * @see packet_dimension 52 54 */ 53 typedef struct packet_dimension packet_dimension_t;55 typedef struct packet_dimension packet_dimension_t; 54 56 55 57 /** Packet dimension. */ … … 71 73 extern packet_t *pm_find(packet_id_t); 72 74 extern int pm_add(packet_t *); 75 extern void pm_remove(packet_t *); 73 76 extern int pm_init(void); 74 77 extern void pm_destroy(void); -
uspace/lib/c/include/net/packet_header.h
r2bdf8313 rb0f00a9 61 61 #define PACKET_MAGIC_VALUE 0x11227788 62 62 63 /** Maximum total length of the packet */ 64 #define PACKET_MAX_LENGTH 65536 65 63 66 /** Packet header. */ 64 67 struct packet { … … 85 88 */ 86 89 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; 87 96 88 97 /** Stored source and destination addresses length. */ -
uspace/lib/c/include/ns.h
r2bdf8313 rb0f00a9 27 27 */ 28 28 29 /** @addtogroup console29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef GCONS_H_36 #define GCONS_H_35 #ifndef LIBC_NS_H_ 36 #define LIBC_NS_H_ 37 37 38 38 #include <sys/types.h> 39 #include <task.h> 40 #include <async.h> 39 41 40 void gcons_init(int); 42 extern int service_register(sysarg_t); 43 extern async_sess_t *service_connect(exch_mgmt_t, sysarg_t, sysarg_t, sysarg_t); 44 extern async_sess_t *service_connect_blocking(exch_mgmt_t, sysarg_t, sysarg_t, 45 sysarg_t); 41 46 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); 47 extern int ns_ping(void); 48 extern int ns_intro(task_id_t); 52 49 53 50 #endif -
uspace/lib/c/include/rtld/elf_dyn.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_RTLD_ELF_DYN_H_ 37 37 38 #include <arch/elf.h>39 38 #include <sys/types.h> 40 41 #include <elf.h> 39 #include <elf/elf.h> 42 40 #include <libarch/rtld/elf_dyn.h> 43 41 -
uspace/lib/c/include/rtld/rtld.h
r2bdf8313 rb0f00a9 49 49 50 50 /** List of all loaded modules including rtld and the program */ 51 li nk_t modules_head;51 list_t modules; 52 52 53 53 /** Temporary hack to place each module at different address. */ -
uspace/lib/c/include/rtld/symbol.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_RTLD_SYMBOL_H_ 37 37 38 #include <elf/elf.h> 38 39 #include <rtld/rtld.h> 39 #include <elf.h>40 40 41 41 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod); -
uspace/lib/c/include/stats.h
r2bdf8313 rb0f00a9 40 40 #include <stdint.h> 41 41 #include <bool.h> 42 #include <kernel/sysinfo/abi.h> 42 #include <sys/types.h> 43 #include <abi/sysinfo.h> 43 44 44 45 extern stats_cpu_t *stats_get_cpus(size_t *); -
uspace/lib/c/include/stdio.h
r2bdf8313 rb0f00a9 97 97 }; 98 98 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 */ 100 struct _IO_FILE; 101 typedef struct _IO_FILE FILE; 142 102 143 103 extern FILE *stdin; -
uspace/lib/c/include/str.h
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2005 Martin Decky 3 * Copyright (c) 2011 Oleg Romanenko 3 4 * All rights reserved. 4 5 * … … 48 49 #define STR_BOUNDS(length) ((length) << 2) 49 50 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 50 57 extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); 51 58 extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz); … … 73 80 extern void str_append(char *dest, size_t size, const char *src); 74 81 82 extern int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n); 75 83 extern void wstr_to_str(char *dest, size_t size, const wchar_t *src); 76 84 extern char *wstr_to_astr(const wchar_t *src); 77 85 extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src); 86 extern wchar_t *str_to_awstr(const char *src); 87 extern int utf16_to_str(char *dest, size_t size, const uint16_t *src); 88 extern int str_to_utf16(uint16_t *dest, size_t size, const char *src); 78 89 79 90 extern char *str_chr(const char *str, wchar_t ch); 80 91 extern char *str_rchr(const char *str, wchar_t ch); 92 93 extern void str_rtrim(char *str, wchar_t ch); 94 extern void str_ltrim(char *str, wchar_t ch); 81 95 82 96 extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos); … … 86 100 extern char *str_ndup(const char *, size_t max_size); 87 101 102 extern int str_uint8_t(const char *, char **, unsigned int, bool, uint8_t *); 103 extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *); 104 extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *); 88 105 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *); 89 106 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); -
uspace/lib/c/include/sys/stat.h
r2bdf8313 rb0f00a9 39 39 #include <bool.h> 40 40 #include <ipc/vfs.h> 41 #include <ipc/ devmap.h>41 #include <ipc/loc.h> 42 42 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 devmap_handle_t devmap_handle;45 service_id_t service_id; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; … … 49 49 bool is_directory; 50 50 aoff64_t size; 51 devmap_handle_t device;51 service_id_t service; 52 52 }; 53 53 -
uspace/lib/c/include/sys/time.h
r2bdf8313 rb0f00a9 62 62 extern int gettimeofday(struct timeval *tv, struct timezone *tz); 63 63 64 extern void udelay(useconds_t); 65 64 66 #endif 65 67 -
uspace/lib/c/include/syscall.h
r2bdf8313 rb0f00a9 45 45 46 46 #include <sys/types.h> 47 #include < kernel/syscall/syscall.h>47 #include <abi/syscall.h> 48 48 49 49 #define __syscall0 __syscall -
uspace/lib/c/include/sysinfo.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_SYSINFO_H_ 37 37 38 #include <libc.h> 38 #include <sys/types.h> 39 #include <bool.h> 40 #include <abi/sysinfo.h> 39 41 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 *); 42 extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *); 50 43 extern int sysinfo_get_value(const char *, sysarg_t *); 51 44 extern void *sysinfo_get_data(const char *, size_t *); -
uspace/lib/c/include/task.h
r2bdf8313 rb0f00a9 37 37 38 38 #include <sys/types.h> 39 40 typedef uint64_t task_id_t; 39 #include <abi/proc/task.h> 41 40 42 41 typedef enum { … … 51 50 extern task_id_t task_spawn(const char *, const char *const[], int *); 52 51 extern int task_spawnv(task_id_t *, const char *path, const char *const []); 52 extern int task_spawnvf(task_id_t *, const char *path, const char *const [], 53 int *const []); 53 54 extern int task_spawnl(task_id_t *, const char *path, ...); 54 55 -
uspace/lib/c/include/thread.h
r2bdf8313 rb0f00a9 38 38 #include <libarch/thread.h> 39 39 #include <sys/types.h> 40 41 typedef uint64_t thread_id_t; 40 #include <abi/proc/thread.h> 42 41 43 42 extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *); -
uspace/lib/c/include/udebug.h
r2bdf8313 rb0f00a9 36 36 #define LIBC_UDEBUG_H_ 37 37 38 #include < kernel/udebug/udebug.h>38 #include <abi/udebug.h> 39 39 #include <sys/types.h> 40 #include <async.h> 40 41 41 42 typedef sysarg_t thash_t; 42 43 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); 44 extern int udebug_begin(async_sess_t *); 45 extern int udebug_end(async_sess_t *); 46 extern int udebug_set_evmask(async_sess_t *, udebug_evmask_t); 47 extern int udebug_thread_read(async_sess_t *, void *, size_t , size_t *, 48 size_t *); 49 extern int udebug_name_read(async_sess_t *, void *, size_t, size_t *, 50 size_t *); 51 extern int udebug_areas_read(async_sess_t *, void *, size_t, size_t *, 52 size_t *); 53 extern int udebug_mem_read(async_sess_t *, void *, uintptr_t, size_t); 54 extern int udebug_args_read(async_sess_t *, thash_t, sysarg_t *); 55 extern int udebug_regs_read(async_sess_t *, thash_t, void *); 56 extern int udebug_go(async_sess_t *, thash_t, udebug_event_t *, sysarg_t *, 57 sysarg_t *); 58 extern int udebug_stop(async_sess_t *, thash_t); 54 59 55 60 #endif -
uspace/lib/c/include/unistd.h
r2bdf8313 rb0f00a9 63 63 extern ssize_t read(int, void *, size_t); 64 64 65 extern ssize_t read_all(int, void *, size_t); 66 extern ssize_t write_all(int, const void *, size_t); 67 65 68 extern off64_t lseek(int, off64_t, int); 66 69 extern int ftruncate(int, aoff64_t); -
uspace/lib/c/include/vfs/vfs.h
r2bdf8313 rb0f00a9 38 38 #include <sys/types.h> 39 39 #include <ipc/vfs.h> 40 #include <ipc/devmap.h> 40 #include <ipc/loc.h> 41 #include <adt/list.h> 41 42 #include <stdio.h> 43 #include <async.h> 44 #include "vfs_mtab.h" 42 45 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; 46 enum vfs_change_state_type { 47 VFS_PASS_HANDLE 48 }; 52 49 53 50 extern char *absolutize(const char *, size_t *); 54 51 55 52 extern int mount(const char *, const char *, const char *, const char *, 56 unsigned int );53 unsigned int, unsigned int); 57 54 extern int unmount(const char *); 58 55 59 extern int open_node(fdi_node_t *, int); 60 extern int fd_phone(int); 61 extern int fd_node(int, fdi_node_t *); 56 extern int fhandle(FILE *, int *); 62 57 63 extern FILE *fopen_node(fdi_node_t *, const char *); 64 extern int fphone(FILE *); 65 extern int fnode(FILE *, fdi_node_t *); 58 extern int fd_wait(void); 59 extern int get_mtab_list(list_t *mtab_list); 60 61 extern async_exch_t *vfs_exchange_begin(void); 62 extern void vfs_exchange_end(async_exch_t *); 66 63 67 64 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
