Changeset c4fb95d3 in mainline for uspace/lib/c/include
- Timestamp:
- 2011-02-18T20:04:56Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d011038
- Parents:
- 87e373b (diff), 8b1ea2d4 (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:
-
- 1 added
- 53 edited
-
adt/hash_table.h (modified) (1 diff)
-
as.h (modified) (1 diff)
-
async.h (modified) (11 diffs)
-
async_sess.h (modified) (1 diff)
-
byteorder.h (modified) (1 diff)
-
ddi.h (modified) (2 diffs)
-
devman.h (modified) (1 diff)
-
err.h (modified) (1 diff)
-
errno.h (modified) (2 diffs)
-
event.h (modified) (1 diff)
-
io/console.h (modified) (1 diff)
-
io/screenbuffer.h (modified) (1 diff)
-
ipc/adb.h (modified) (1 diff)
-
ipc/arp.h (modified) (1 diff)
-
ipc/bd.h (modified) (1 diff)
-
ipc/char.h (modified) (1 diff)
-
ipc/clipboard.h (modified) (1 diff)
-
ipc/common.h (added)
-
ipc/console.h (modified) (1 diff)
-
ipc/dev_iface.h (modified) (1 diff)
-
ipc/devman.h (modified) (5 diffs)
-
ipc/devmap.h (modified) (1 diff)
-
ipc/fb.h (modified) (1 diff)
-
ipc/icmp.h (modified) (5 diffs)
-
ipc/il.h (modified) (1 diff)
-
ipc/ip.h (modified) (1 diff)
-
ipc/ipc.h (modified) (7 diffs)
-
ipc/irc.h (modified) (1 diff)
-
ipc/kbd.h (modified) (1 diff)
-
ipc/loader.h (modified) (1 diff)
-
ipc/mouse.h (modified) (1 diff)
-
ipc/net.h (modified) (1 diff)
-
ipc/net_net.h (modified) (1 diff)
-
ipc/netif.h (modified) (1 diff)
-
ipc/nil.h (modified) (1 diff)
-
ipc/ns.h (modified) (2 diffs)
-
ipc/packet.h (modified) (1 diff)
-
ipc/services.h (modified) (2 diffs)
-
ipc/socket.h (modified) (1 diff)
-
ipc/tl.h (modified) (1 diff)
-
ipc/vfs.h (modified) (1 diff)
-
libc.h (modified) (1 diff)
-
loader/pcb.h (modified) (1 diff)
-
malloc.h (modified) (1 diff)
-
net/icmp_common.h (modified) (1 diff)
-
net/modules.h (modified) (1 diff)
-
setjmp.h (modified) (1 diff)
-
stdlib.h (modified) (1 diff)
-
syscall.h (modified) (3 diffs)
-
thread.h (modified) (2 diffs)
-
tls.h (modified) (1 diff)
-
udebug.h (modified) (1 diff)
-
unistd.h (modified) (3 diffs)
-
vfs/vfs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
r87e373b rc4fb95d3 41 41 typedef unsigned long hash_count_t; 42 42 typedef unsigned long hash_index_t; 43 typedef struct hash_table hash_table_t; 44 typedef struct hash_table_operations hash_table_operations_t; 43 44 /** Set of operations for hash table. */ 45 typedef struct { 46 /** Hash function. 47 * 48 * @param key Array of keys needed to compute hash index. 49 * All keys must be passed. 50 * 51 * @return Index into hash table. 52 * 53 */ 54 hash_index_t (*hash)(unsigned long key[]); 55 56 /** Hash table item comparison function. 57 * 58 * @param key Array of keys that will be compared with item. It is 59 * not necessary to pass all keys. 60 * 61 * @return True if the keys match, false otherwise. 62 * 63 */ 64 int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); 65 66 /** Hash table item removal callback. 67 * 68 * @param item Item that was removed from the hash table. 69 * 70 */ 71 void (*remove_callback)(link_t *item); 72 } hash_table_operations_t; 45 73 46 74 /** Hash table structure. */ 47 struct hash_table{75 typedef struct { 48 76 link_t *entry; 49 77 hash_count_t entries; 50 78 hash_count_t max_keys; 51 79 hash_table_operations_t *op; 52 }; 53 54 /** Set of operations for hash table. */ 55 struct hash_table_operations { 56 /** Hash function. 57 * 58 * @param key Array of keys needed to compute hash index. All keys 59 * must be passed. 60 * 61 * @return Index into hash table. 62 */ 63 hash_index_t (* hash)(unsigned long key[]); 64 65 /** Hash table item comparison function. 66 * 67 * @param key Array of keys that will be compared with item. It is 68 * not necessary to pass all keys. 69 * 70 * @return true if the keys match, false otherwise. 71 */ 72 int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); 73 74 /** Hash table item removal callback. 75 * 76 * @param item Item that was removed from the hash table. 77 */ 78 void (*remove_callback)(link_t *item); 79 }; 80 } hash_table_t; 80 81 81 82 #define hash_table_get_instance(item, type, member) \ -
uspace/lib/c/include/as.h
r87e373b rc4fb95d3 41 41 #include <libarch/config.h> 42 42 43 static inline size_t SIZE2PAGES(size_t size) 44 { 45 if (size == 0) 46 return 0; 47 48 return (size_t) ((size - 1) >> PAGE_WIDTH) + 1; 49 } 50 51 static inline size_t PAGES2SIZE(size_t pages) 52 { 53 return (size_t) (pages << PAGE_WIDTH); 54 } 55 43 56 extern void *as_area_create(void *address, size_t size, int flags); 44 57 extern int as_area_resize(void *address, size_t size, int flags); -
uspace/lib/c/include/async.h
r87e373b rc4fb95d3 33 33 */ 34 34 35 #if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_))) 36 #error Do not intermix low-level IPC interface and async framework 37 #endif 38 35 39 #ifndef LIBC_ASYNC_H_ 36 40 #define LIBC_ASYNC_H_ 37 41 38 #include <ipc/ ipc.h>42 #include <ipc/common.h> 39 43 #include <async_sess.h> 40 44 #include <fibril.h> … … 42 46 #include <atomic.h> 43 47 #include <bool.h> 48 #include <task.h> 44 49 45 50 typedef ipc_callid_t aid_t; 46 typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call); 47 48 extern atomic_t async_futex; 51 52 typedef void *(*async_client_data_ctor_t)(void); 53 typedef void (*async_client_data_dtor_t)(void *); 54 55 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *); 49 56 50 57 extern atomic_t threads_in_ipc_wait; 51 58 52 extern int __async_init(void); 53 extern ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs); 54 55 static inline ipc_callid_t async_get_call(ipc_call_t *data) 56 { 57 return async_get_call_timeout(data, 0); 58 } 59 60 static inline void async_manager(void) 61 { 62 fibril_switch(FIBRIL_TO_MANAGER); 63 } 59 #define async_manager() \ 60 fibril_switch(FIBRIL_TO_MANAGER) 61 62 #define async_get_call(data) \ 63 async_get_call_timeout(data, 0) 64 65 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t); 64 66 65 67 /* … … 85 87 (arg5), (dataptr)) 86 88 87 extern aid_t async_send_fast(int phoneid, sysarg_t method, sysarg_t arg1, 88 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr); 89 extern aid_t async_send_slow(int phoneid, sysarg_t method, sysarg_t arg1, 90 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, 91 ipc_call_t *dataptr); 92 extern void async_wait_for(aid_t amsgid, sysarg_t *result); 93 extern int async_wait_timeout(aid_t amsgid, sysarg_t *retval, 94 suseconds_t timeout); 95 96 extern fid_t async_new_connection(sysarg_t in_phone_hash, ipc_callid_t callid, 97 ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *)); 98 extern void async_usleep(suseconds_t timeout); 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, 92 sysarg_t, sysarg_t, ipc_call_t *); 93 extern void async_wait_for(aid_t, sysarg_t *); 94 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t); 95 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 *)); 98 extern void async_usleep(suseconds_t); 99 99 extern void async_create_manager(void); 100 100 extern void async_destroy_manager(void); 101 101 102 extern void async_set_client_connection(async_client_conn_t conn); 103 extern void async_set_interrupt_received(async_client_conn_t conn); 104 105 /* Wrappers for simple communication */ 106 #define async_msg_0(phone, method) \ 107 ipc_call_async_0((phone), (method), NULL, NULL, true) 108 #define async_msg_1(phone, method, arg1) \ 109 ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \ 110 true) 111 #define async_msg_2(phone, method, arg1, arg2) \ 112 ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \ 113 true) 114 #define async_msg_3(phone, method, arg1, arg2, arg3) \ 115 ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \ 116 true) 117 #define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \ 118 ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \ 119 NULL, true) 120 #define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \ 121 ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \ 122 (arg5), NULL, NULL, true) 102 extern void async_set_client_data_constructor(async_client_data_ctor_t); 103 extern void async_set_client_data_destructor(async_client_data_dtor_t); 104 105 extern void *async_client_data_get(void); 106 107 extern void async_set_client_connection(async_client_conn_t); 108 extern void async_set_interrupt_received(async_client_conn_t); 109 110 /* 111 * Wrappers for simple communication. 112 */ 113 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, 120 sysarg_t); 121 122 /* 123 * Wrappers for answer routines. 124 */ 125 126 extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t); 127 extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t); 128 extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t); 129 extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t, 130 sysarg_t); 131 extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t, 132 sysarg_t, sysarg_t); 133 extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t, 134 sysarg_t, sysarg_t, sysarg_t); 135 136 /* 137 * Wrappers for forwarding routines. 138 */ 139 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); 123 144 124 145 /* … … 128 149 * and slow verion based on m. 129 150 */ 151 130 152 #define async_req_0_0(phoneid, method) \ 131 153 async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \ … … 243 265 (arg5), (rc1), (rc2), (rc3), (rc4), (rc5)) 244 266 245 extern sysarg_t async_req_fast(int phoneid, sysarg_t method, sysarg_t arg1, 246 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t *r1, sysarg_t *r2, 247 sysarg_t *r3, sysarg_t *r4, sysarg_t *r5); 248 extern sysarg_t async_req_slow(int phoneid, sysarg_t method, sysarg_t arg1, 249 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *r1, 250 sysarg_t *r2, sysarg_t *r3, sysarg_t *r4, sysarg_t *r5); 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, 270 sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, 271 sysarg_t *); 251 272 252 273 static inline void async_serialize_start(void) … … 260 281 } 261 282 283 extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, 284 async_client_conn_t); 262 285 extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 263 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); 289 extern void async_poke(void); 264 290 265 291 /* 266 292 * User-friendly wrappers for async_share_in_start(). 267 293 */ 294 268 295 #define async_share_in_start_0_0(phoneid, dst, size) \ 269 296 async_share_in_start((phoneid), (dst), (size), 0, NULL) … … 275 302 async_share_in_start((phoneid), (dst), (size), (arg), (flags)) 276 303 277 extern int async_share_in_start(int, void *, size_t, sysarg_t, int *); 278 extern int async_share_in_receive(ipc_callid_t *, size_t *); 279 extern int async_share_in_finalize(ipc_callid_t, void *, int ); 280 extern int async_share_out_start(int, void *, int); 281 extern int async_share_out_receive(ipc_callid_t *, size_t *, int *); 304 extern int async_share_in_start(int, void *, size_t, sysarg_t, unsigned int *); 305 extern bool async_share_in_receive(ipc_callid_t *, size_t *); 306 extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int); 307 308 extern int async_share_out_start(int, void *, unsigned int); 309 extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *); 282 310 extern int async_share_out_finalize(ipc_callid_t, void *); 283 311 … … 285 313 * User-friendly wrappers for async_data_read_forward_fast(). 286 314 */ 315 287 316 #define async_data_read_forward_0_0(phoneid, method, answer) \ 288 317 async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) … … 312 341 313 342 extern int async_data_read_start(int, void *, size_t); 314 extern intasync_data_read_receive(ipc_callid_t *, size_t *);343 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 315 344 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 316 345 … … 321 350 * User-friendly wrappers for async_data_write_forward_fast(). 322 351 */ 352 323 353 #define async_data_write_forward_0_0(phoneid, method, answer) \ 324 354 async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) … … 350 380 351 381 extern int async_data_write_start(int, const void *, size_t); 352 extern intasync_data_write_receive(ipc_callid_t *, size_t *);382 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 353 383 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 354 384 355 385 extern int async_data_write_accept(void **, const bool, const size_t, 356 386 const size_t, const size_t, size_t *); 357 extern void async_data_write_void( const int);387 extern void async_data_write_void(sysarg_t); 358 388 359 389 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t, -
uspace/lib/c/include/async_sess.h
r87e373b rc4fb95d3 45 45 } async_sess_t; 46 46 47 extern void _async_sess_init(void);48 47 extern void async_session_create(async_sess_t *, int, sysarg_t); 49 48 extern void async_session_destroy(async_sess_t *); -
uspace/lib/c/include/byteorder.h
r87e373b rc4fb95d3 80 80 #endif 81 81 82 #define htons(n) host2uint16_t_be((n))83 #define htonl(n) host2uint32_t_be((n))84 #define ntohs(n) uint16_t_be2host((n))85 #define ntohl(n) uint32_t_be2host((n))82 #define htons(n) host2uint16_t_be((n)) 83 #define htonl(n) host2uint32_t_be((n)) 84 #define ntohs(n) uint16_t_be2host((n)) 85 #define ntohl(n) uint32_t_be2host((n)) 86 86 87 87 static inline uint64_t uint64_t_byteorder_swap(uint64_t n) -
uspace/lib/c/include/ddi.h
r87e373b rc4fb95d3 36 36 #define LIBC_DDI_H_ 37 37 38 #include <sys/types.h> 39 #include <kernel/ddi/irq.h> 38 40 #include <task.h> 39 41 … … 42 44 extern int iospace_enable(task_id_t, void *, unsigned long); 43 45 extern int pio_enable(void *, size_t, void **); 46 extern int register_irq(int, int, int, irq_code_t *); 47 extern int unregister_irq(int, int); 44 48 45 49 #endif -
uspace/lib/c/include/devman.h
r87e373b rc4fb95d3 41 41 #include <bool.h> 42 42 43 44 43 extern int devman_get_phone(devman_interface_t, unsigned int); 45 44 extern void devman_hangup_phone(devman_interface_t); 46 45 47 46 extern int devman_driver_register(const char *, async_client_conn_t); 48 extern int devman_ child_device_register(const char *, match_id_list_t *,47 extern int devman_add_function(const char *, fun_type_t, match_id_list_t *, 49 48 devman_handle_t, devman_handle_t *); 50 49 -
uspace/lib/c/include/err.h
r87e373b rc4fb95d3 39 39 40 40 #define errx(status, fmt, ...) \ 41 { \41 do { \ 42 42 printf((fmt), ##__VA_ARGS__); \ 43 _exit(status); \44 } 43 exit(status); \ 44 } while (0) 45 45 46 46 #endif -
uspace/lib/c/include/errno.h
r87e373b rc4fb95d3 39 39 #include <fibril.h> 40 40 41 #define errno _errno 42 41 43 extern int _errno; 42 43 #define errno _errno44 44 45 45 #define EMFILE (-18) … … 57 57 58 58 /** An API function is called while another blocking function is in progress. */ 59 #define EINPROGRESS (-10036)59 #define EINPROGRESS (-10036) 60 60 61 61 /** The socket identifier is not valid. */ 62 #define ENOTSOCK (-10038)62 #define ENOTSOCK (-10038) 63 63 64 64 /** The destination address required. */ 65 #define EDESTADDRREQ (-10039)65 #define EDESTADDRREQ (-10039) 66 66 67 67 /** Protocol is not supported. */ 68 #define EPROTONOSUPPORT (-10043)68 #define EPROTONOSUPPORT (-10043) 69 69 70 70 /** Socket type is not supported. */ 71 #define ESOCKTNOSUPPORT (-10044)71 #define ESOCKTNOSUPPORT (-10044) 72 72 73 73 /** Protocol family is not supported. */ 74 #define EPFNOSUPPORT (-10046)74 #define EPFNOSUPPORT (-10046) 75 75 76 76 /** Address family is not supported. */ 77 #define EAFNOSUPPORT (-10047)77 #define EAFNOSUPPORT (-10047) 78 78 79 79 /** Address is already in use. */ 80 #define EADDRINUSE (-10048)80 #define EADDRINUSE (-10048) 81 81 82 82 /** The socket is not connected or bound. */ 83 #define ENOTCONN (-10057)83 #define ENOTCONN (-10057) 84 84 85 85 /** The requested operation was not performed. Try again later. */ 86 #define EAGAIN (-11002)86 #define EAGAIN (-11002) 87 87 88 /** No data. 89 */ 90 #define NO_DATA (-11004) 88 /** No data. */ 89 #define NO_DATA (-11004) 91 90 92 91 #endif -
uspace/lib/c/include/event.h
r87e373b rc4fb95d3 37 37 38 38 #include <kernel/ipc/event_types.h> 39 #include <ipc/ipc.h>40 39 41 40 extern int event_subscribe(event_type_t, sysarg_t); -
uspace/lib/c/include/io/console.h
r87e373b rc4fb95d3 36 36 #define LIBC_IO_CONSOLE_H_ 37 37 38 #include <ipc/ipc.h>39 38 #include <bool.h> 40 39 -
uspace/lib/c/include/io/screenbuffer.h
r87e373b rc4fb95d3 38 38 #include <stdint.h> 39 39 #include <sys/types.h> 40 #include <ipc/ipc.h>41 40 #include <bool.h> 42 41 -
uspace/lib/c/include/ipc/adb.h
r87e373b rc4fb95d3 32 32 /** @file 33 33 * @brief ADB device interface. 34 */ 34 */ 35 35 36 36 #ifndef LIBC_IPC_ADB_H_ 37 37 #define LIBC_IPC_ADB_H_ 38 38 39 #include <ipc/ ipc.h>39 #include <ipc/common.h> 40 40 41 41 typedef enum { 42 42 ADB_REG_WRITE = IPC_FIRST_USER_METHOD 43 43 } adb_request_t; 44 45 44 46 45 typedef enum { -
uspace/lib/c/include/ipc/arp.h
r87e373b rc4fb95d3 39 39 #define LIBC_ARP_MESSAGES_ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/net.h> 43 42 -
uspace/lib/c/include/ipc/bd.h
r87e373b rc4fb95d3 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_IPC_BD_H_ 36 36 #define LIBC_IPC_BD_H_ 37 37 38 #include <ipc/ ipc.h>38 #include <ipc/common.h> 39 39 40 40 typedef enum { -
uspace/lib/c/include/ipc/char.h
r87e373b rc4fb95d3 32 32 /** @file 33 33 * @brief Character device interface. 34 */ 34 */ 35 35 36 36 #ifndef LIBC_IPC_CHAR_H_ 37 37 #define LIBC_IPC_CHAR_H_ 38 38 39 #include <ipc/ ipc.h>39 #include <ipc/common.h> 40 40 41 41 typedef enum { 42 42 CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD 43 43 } char_request_t; 44 45 44 46 45 typedef enum { -
uspace/lib/c/include/ipc/clipboard.h
r87e373b rc4fb95d3 36 36 #define LIBC_IPC_CLIPBOARD_H_ 37 37 38 #include <ipc/ipc.h>39 40 38 typedef enum { 41 39 CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD, -
uspace/lib/c/include/ipc/console.h
r87e373b rc4fb95d3 36 36 #define LIBC_IPC_CONSOLE_H_ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/vfs.h> 40 39 -
uspace/lib/c/include/ipc/dev_iface.h
r87e373b rc4fb95d3 30 30 #define LIBC_IPC_DEV_IFACE_H_ 31 31 32 #include <ipc/ipc.h>33 32 #include <malloc.h> 34 33 #include <unistd.h> -
uspace/lib/c/include/ipc/devman.h
r87e373b rc4fb95d3 30 30 * @{ 31 31 */ 32 32 33 33 #ifndef LIBC_IPC_DEVMAN_H_ 34 34 #define LIBC_IPC_DEVMAN_H_ 35 35 36 #include <ipc/common.h> 36 37 #include <adt/list.h> 37 #include <ipc/ipc.h> 38 #include <stdlib.h> 39 #include <stdio.h> 40 #include <str.h> 38 #include <malloc.h> 39 #include <mem.h> 41 40 42 #define DEVMAN_NAME_MAXLEN 25641 #define DEVMAN_NAME_MAXLEN 256 43 42 44 43 typedef sysarg_t devman_handle_t; 44 45 typedef enum { 46 /** Invalid value for debugging purposes */ 47 fun_invalid = 0, 48 /** Function to which child devices attach */ 49 fun_inner, 50 /** Fuction exported to external clients (leaf function) */ 51 fun_exposed 52 } fun_type_t; 45 53 46 54 /** Ids of device models used for device-to-driver matching. … … 67 75 } match_id_list_t; 68 76 69 70 static inline match_id_t * create_match_id() 77 static inline match_id_t *create_match_id(void) 71 78 { 72 79 match_id_t *id = malloc(sizeof(match_id_t)); … … 85 92 } 86 93 87 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 94 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 88 95 { 89 96 match_id_t *mid = NULL; 90 link_t *link = ids->ids.next; 97 link_t *link = ids->ids.next; 91 98 92 99 while (link != &ids->ids) { … … 98 105 } 99 106 100 list_insert_before(&id->link, link); 107 list_insert_before(&id->link, link); 101 108 } 102 109 … … 129 136 typedef enum { 130 137 DEVMAN_DRIVER_REGISTER = IPC_FIRST_USER_METHOD, 131 DEVMAN_ADD_ CHILD_DEVICE,138 DEVMAN_ADD_FUNCTION, 132 139 DEVMAN_ADD_MATCH_ID, 133 140 DEVMAN_ADD_DEVICE_TO_CLASS -
uspace/lib/c/include/ipc/devmap.h
r87e373b rc4fb95d3 34 34 #define DEVMAP_DEVMAP_H_ 35 35 36 #include <atomic.h> 37 #include <ipc/ipc.h> 38 #include <adt/list.h> 36 #include <ipc/common.h> 39 37 40 38 #define DEVMAP_NAME_MAXLEN 255 -
uspace/lib/c/include/ipc/fb.h
r87e373b rc4fb95d3 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_FB_H_ 36 36 #define LIBC_FB_H_ 37 37 38 #include <ipc/ ipc.h>38 #include <ipc/common.h> 39 39 40 40 typedef enum { -
uspace/lib/c/include/ipc/icmp.h
r87e373b rc4fb95d3 33 33 /** @file 34 34 * ICMP module messages. 35 * @see icmp_ interface.h35 * @see icmp_remote.h 36 36 */ 37 37 … … 39 39 #define LIBC_ICMP_MESSAGES_ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/net.h> 43 42 #include <sys/types.h> 44 43 #include <sys/time.h> 45 46 44 #include <net/icmp_codes.h> 47 45 48 46 /** ICMP module messages. */ 49 47 typedef enum { 50 /** Send secho request. @see icmp_echo() */48 /** Send echo request. @see icmp_echo() */ 51 49 NET_ICMP_ECHO = NET_ICMP_FIRST, 52 50 53 51 /** 54 * Send sdestination unreachable error message.52 * Send destination unreachable error message. 55 53 * @see icmp_destination_unreachable_msg() 56 54 */ … … 58 56 59 57 /** 60 * Send ssource quench error message.58 * Send source quench error message. 61 59 * @see icmp_source_quench_msg() 62 60 */ … … 64 62 65 63 /** 66 * Send stime exceeded error message.64 * Send time exceeded error message. 67 65 * @see icmp_time_exceeded_msg() 68 66 */ … … 70 68 71 69 /** 72 * Send sparameter problem error message.70 * Send parameter problem error message. 73 71 * @see icmp_parameter_problem_msg() 74 72 */ 75 NET_ICMP_PARAMETERPROB, 76 77 /** Initializes new connection. */ 78 NET_ICMP_INIT 79 } icmp_messages; 73 NET_ICMP_PARAMETERPROB 74 } icmp_messages_t; 80 75 81 76 /** @name ICMP specific message parameters definitions */ -
uspace/lib/c/include/ipc/il.h
r87e373b rc4fb95d3 40 40 #define LIBC_IL_MESSAGES_H_ 41 41 42 #include <ipc/ipc.h>43 42 #include <ipc/net.h> 44 43 -
uspace/lib/c/include/ipc/ip.h
r87e373b rc4fb95d3 39 39 #define LIBC_IP_MESSAGES_H_ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/net.h> 43 44 42 #include <net/in.h> 45 43 #include <net/ip_codes.h> -
uspace/lib/c/include/ipc/ipc.h
r87e373b rc4fb95d3 33 33 */ 34 34 35 #ifndef LIBIPC_IPC_H_ 36 #define LIBIPC_IPC_H_ 37 35 #if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_))) 36 #error Do not intermix low-level IPC interface and async framework 37 #endif 38 39 #ifndef LIBC_IPC_H_ 40 #define LIBC_IPC_H_ 41 42 #include <sys/types.h> 43 #include <ipc/common.h> 44 #include <kernel/synch/synch.h> 38 45 #include <task.h> 39 #include <kernel/ipc/ipc.h> 40 #include <kernel/ddi/irq.h> 41 #include <sys/types.h> 42 #include <kernel/synch/synch.h> 43 44 #define IPC_FLAG_BLOCKING 0x01 45 46 typedef struct { 47 sysarg_t args[IPC_CALL_LEN]; 48 sysarg_t in_phone_hash; 49 } ipc_call_t; 50 51 typedef sysarg_t ipc_callid_t; 52 53 typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *); 46 47 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *); 54 48 55 49 /* … … 59 53 * possible, the fast version is used. 60 54 */ 55 61 56 #define ipc_call_sync_0_0(phoneid, method) \ 62 57 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0) … … 188 183 sysarg_t *); 189 184 190 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int); 191 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t); 185 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int); 192 186 extern void ipc_poke(void); 193 187 194 static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data) 195 { 196 return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); 197 } 198 188 #define ipc_wait_for_call(data) \ 189 ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); 190 191 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t); 199 192 extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *); 200 193 … … 205 198 * to m. 206 199 */ 200 207 201 #define ipc_answer_0(callid, retval) \ 208 202 ipc_answer_fast((callid), (retval), 0, 0, 0, 0) … … 229 223 * to m. 230 224 */ 225 231 226 #define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \ 232 227 ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \ … … 254 249 255 250 extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 256 sysarg_t, void *, ipc_async_callback_t, int);251 sysarg_t, void *, ipc_async_callback_t, bool); 257 252 extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 258 sysarg_t, sysarg_t, void *, ipc_async_callback_t, int); 259 260 extern int ipc_connect_to_me(int, int, int, int, sysarg_t *); 261 extern int ipc_connect_me_to(int, int, int, int); 262 extern int ipc_connect_me_to_blocking(int, int, int, int); 253 sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool); 254 255 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *, 256 sysarg_t *); 257 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 258 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t); 259 263 260 extern int ipc_hangup(int); 264 extern int ipc_register_irq(int, int, int, irq_code_t *); 265 extern int ipc_ unregister_irq(int, int);266 extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t,int);267 extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,268 sysarg_t, sysarg_t, sysarg_t, int);261 262 extern int ipc_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t, 263 unsigned int); 264 extern int ipc_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t, 265 sysarg_t, sysarg_t, sysarg_t, unsigned int); 269 266 270 267 /* 271 268 * User-friendly wrappers for ipc_share_in_start(). 272 269 */ 270 273 271 #define ipc_share_in_start_0_0(phoneid, dst, size) \ 274 272 ipc_share_in_start((phoneid), (dst), (size), 0, NULL) … … 280 278 ipc_share_in_start((phoneid), (dst), (size), (arg), (flags)) 281 279 282 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);283 extern int ipc_share_in_finalize(ipc_callid_t, void *, int);284 extern int ipc_share_out_start(int, void *, int);280 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *); 281 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int); 282 extern int ipc_share_out_start(int, void *, unsigned int); 285 283 extern int ipc_share_out_finalize(ipc_callid_t, void *); 286 284 extern int ipc_data_read_start(int, void *, size_t); -
uspace/lib/c/include/ipc/irc.h
r87e373b rc4fb95d3 36 36 #define LIBC_IRC_H_ 37 37 38 #include <ipc/ ipc.h>38 #include <ipc/common.h> 39 39 40 40 typedef enum { -
uspace/lib/c/include/ipc/kbd.h
r87e373b rc4fb95d3 38 38 #define LIBC_IPC_KBD_H_ 39 39 40 #include <ipc/ ipc.h>40 #include <ipc/common.h> 41 41 42 42 typedef enum { -
uspace/lib/c/include/ipc/loader.h
r87e373b rc4fb95d3 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_IPC_LOADER_H_ 36 36 #define LIBC_IPC_LOADER_H_ 37 37 38 #include <ipc/ ipc.h>38 #include <ipc/common.h> 39 39 40 40 typedef enum { -
uspace/lib/c/include/ipc/mouse.h
r87e373b rc4fb95d3 37 37 #define LIBC_IPC_MOUSE_H_ 38 38 39 #include <ipc/ ipc.h>39 #include <ipc/common.h> 40 40 41 41 typedef enum { -
uspace/lib/c/include/ipc/net.h
r87e373b rc4fb95d3 38 38 #define LIBC_NET_MESSAGES_H_ 39 39 40 #include <ipc/ipc.h>41 40 #include <ipc/services.h> 42 43 41 #include <net/device.h> 44 42 #include <net/packet.h> -
uspace/lib/c/include/ipc/net_net.h
r87e373b rc4fb95d3 39 39 #define LIBC_NET_NET_MESSAGES_H_ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/net.h> 43 42 -
uspace/lib/c/include/ipc/netif.h
r87e373b rc4fb95d3 38 38 #define LIBC_NETIF_MESSAGES_H_ 39 39 40 #include <ipc/ipc.h>41 40 #include <ipc/net.h> 42 41 -
uspace/lib/c/include/ipc/nil.h
r87e373b rc4fb95d3 38 38 #define LIBC_NIL_MESSAGES_H_ 39 39 40 #include <ipc/ipc.h>41 40 #include <ipc/net.h> 42 41 -
uspace/lib/c/include/ipc/ns.h
r87e373b rc4fb95d3 33 33 */ 34 34 35 #ifndef LIB IPC_NS_H_36 #define LIB IPC_NS_H_35 #ifndef LIBC_NS_H_ 36 #define LIBC_NS_H_ 37 37 38 #include <ipc/ipc.h> 38 #include <sys/types.h> 39 #include <ipc/common.h> 39 40 40 41 typedef enum { … … 45 46 } ns_request_t; 46 47 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 47 52 #endif 48 53 -
uspace/lib/c/include/ipc/packet.h
r87e373b rc4fb95d3 38 38 #define LIBC_PACKET_MESSAGES_ 39 39 40 #include <ipc/ipc.h>41 40 #include <ipc/net.h> 42 41 -
uspace/lib/c/include/ipc/services.h
r87e373b rc4fb95d3 35 35 */ 36 36 37 #ifndef LIB IPC_SERVICES_H_38 #define LIB IPC_SERVICES_H_37 #ifndef LIBC_SERVICES_H_ 38 #define LIBC_SERVICES_H_ 39 39 40 40 typedef enum { … … 66 66 } services_t; 67 67 68 /* Memory area to be received from NS */69 #define SERVICE_MEM_REALTIME 170 #define SERVICE_MEM_KLOG 271 72 68 #endif 73 69 -
uspace/lib/c/include/ipc/socket.h
r87e373b rc4fb95d3 38 38 #define LIBC_SOCKET_MESSAGES_H_ 39 39 40 #include <ipc/ipc.h>41 40 #include <ipc/net.h> 42 41 -
uspace/lib/c/include/ipc/tl.h
r87e373b rc4fb95d3 39 39 #define LIBC_TL_MESSAGES_H_ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/net.h> 43 42 -
uspace/lib/c/include/ipc/vfs.h
r87e373b rc4fb95d3 36 36 #define LIBC_IPC_VFS_H_ 37 37 38 #include <ipc/ ipc.h>38 #include <ipc/common.h> 39 39 #include <sys/types.h> 40 40 #include <bool.h> -
uspace/lib/c/include/libc.h
r87e373b rc4fb95d3 62 62 __syscall6(p1, p2, p3, p4, p5, p6, id) 63 63 64 extern void __main(void *pcb_ptr);65 extern void __exit(void);66 67 64 #endif 68 65 -
uspace/lib/c/include/loader/pcb.h
r87e373b rc4fb95d3 52 52 /** Program entry point. */ 53 53 entry_point_t entry; 54 54 55 55 /** Current working directory. */ 56 56 char *cwd; -
uspace/lib/c/include/malloc.h
r87e373b rc4fb95d3 38 38 #include <sys/types.h> 39 39 40 extern void __heap_init(void);41 extern uintptr_t get_max_heap_addr(void);42 43 40 extern void *malloc(const size_t size) 44 41 __attribute__((malloc)); -
uspace/lib/c/include/net/icmp_common.h
r87e373b rc4fb95d3 41 41 #include <sys/time.h> 42 42 43 /** Default timeout for incoming connections in microseconds . */44 #define ICMP_CONNECT_TIMEOUT (1 * 1000 * 1000)43 /** Default timeout for incoming connections in microseconds (1 sec). */ 44 #define ICMP_CONNECT_TIMEOUT 1000000 45 45 46 extern int icmp_connect_module(s ervices_t, suseconds_t);46 extern int icmp_connect_module(suseconds_t); 47 47 48 48 #endif -
uspace/lib/c/include/net/modules.h
r87e373b rc4fb95d3 43 43 44 44 #include <async.h> 45 46 #include <ipc/ipc.h>47 45 #include <ipc/services.h> 48 49 46 #include <sys/time.h> 50 47 -
uspace/lib/c/include/setjmp.h
r87e373b rc4fb95d3 41 41 42 42 extern int setjmp(jmp_buf env); 43 extern void longjmp(jmp_buf env, int val) __attribute__((__noreturn__));43 extern void longjmp(jmp_buf env, int val) __attribute__((noreturn)); 44 44 45 45 #endif -
uspace/lib/c/include/stdlib.h
r87e373b rc4fb95d3 40 40 #include <stacktrace.h> 41 41 42 #define abort() \ 43 do { \ 44 stacktrace_print(); \ 45 _exit(1); \ 46 } while (0) 42 #define RAND_MAX 714025 47 43 48 #define core() \ 49 *((int *) 0) = 0xbadbad; 50 51 #define exit(status) _exit((status)) 52 53 #define RAND_MAX 714025 44 #define rand() random() 45 #define srand(seed) srandom(seed) 54 46 55 47 extern long int random(void); 56 48 extern void srandom(unsigned int seed); 57 49 58 static inline int rand(void) 59 { 60 return random(); 61 } 62 63 static inline void srand(unsigned int seed) 64 { 65 srandom(seed); 66 } 50 extern void abort(void) __attribute__((noreturn)); 67 51 68 52 #endif -
uspace/lib/c/include/syscall.h
r87e373b rc4fb95d3 32 32 /** 33 33 * @file 34 * @brief Syscall function declaration for architectures that don't35 * inline syscalls or architectures that handle syscalls36 * according to the number of arguments.34 * @brief Syscall function declaration for architectures that don't 35 * inline syscalls or architectures that handle syscalls 36 * according to the number of arguments. 37 37 */ 38 38 … … 40 40 #define LIBC_SYSCALL_H_ 41 41 42 #ifndef LIBARCH_SYSCALL_GENERIC43 #error "You can't include this file directly." 42 #ifndef LIBARCH_SYSCALL_GENERIC 43 #error You cannot include this file directly 44 44 #endif 45 45 … … 47 47 #include <kernel/syscall/syscall.h> 48 48 49 #define __syscall0 __syscall50 #define __syscall1 __syscall51 #define __syscall2 __syscall52 #define __syscall3 __syscall53 #define __syscall4 __syscall54 #define __syscall5 __syscall55 #define __syscall6 __syscall49 #define __syscall0 __syscall 50 #define __syscall1 __syscall 51 #define __syscall2 __syscall 52 #define __syscall3 __syscall 53 #define __syscall4 __syscall 54 #define __syscall5 __syscall 55 #define __syscall6 __syscall 56 56 57 57 extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, -
uspace/lib/c/include/thread.h
r87e373b rc4fb95d3 36 36 #define LIBC_THREAD_H_ 37 37 38 #include <kernel/proc/uarg.h>39 38 #include <libarch/thread.h> 40 39 #include <sys/types.h> … … 42 41 typedef uint64_t thread_id_t; 43 42 44 extern void __thread_entry(void);45 extern void __thread_main(uspace_arg_t *);46 47 43 extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *); 48 extern void thread_exit(int) __attribute__ ((noreturn));44 extern void thread_exit(int) __attribute__((noreturn)); 49 45 extern void thread_detach(thread_id_t); 50 46 extern int thread_join(thread_id_t); -
uspace/lib/c/include/tls.h
r87e373b rc4fb95d3 57 57 extern void tls_free_variant_1(tcb_t *, size_t); 58 58 #endif 59 59 60 #ifdef CONFIG_TLS_VARIANT_2 60 61 extern tcb_t *tls_alloc_variant_2(void **, size_t); -
uspace/lib/c/include/udebug.h
r87e373b rc4fb95d3 38 38 #include <kernel/udebug/udebug.h> 39 39 #include <sys/types.h> 40 #include <libarch/types.h>41 40 42 41 typedef sysarg_t thash_t; 43 42 44 int udebug_begin(int phoneid); 45 int udebug_end(int phoneid); 46 int udebug_set_evmask(int phoneid, udebug_evmask_t mask); 47 int udebug_thread_read(int phoneid, void *buffer, size_t n, 48 size_t *copied, size_t *needed); 49 int udebug_name_read(int phoneid, void *buffer, size_t n, 50 size_t *copied, size_t *needed); 51 int udebug_areas_read(int phoneid, void *buffer, size_t n, 52 size_t *copied, size_t *needed); 53 int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n); 54 int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer); 55 int udebug_regs_read(int phoneid, thash_t tid, void *buffer); 56 int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type, 57 sysarg_t *val0, sysarg_t *val1); 58 int udebug_stop(int phoneid, thash_t tid); 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); 59 54 60 55 #endif -
uspace/lib/c/include/unistd.h
r87e373b rc4fb95d3 41 41 42 42 #ifndef NULL 43 #define NULL ((void *) 0)43 #define NULL ((void *) 0) 44 44 #endif 45 46 #define getpagesize() (PAGE_SIZE)47 45 48 46 #ifndef SEEK_SET … … 57 55 #define SEEK_END 2 58 56 #endif 57 58 #define getpagesize() (PAGE_SIZE) 59 59 60 60 extern int dup2(int oldfd, int newfd); … … 74 74 extern int chdir(const char *); 75 75 76 extern void _exit(int) __attribute__((noreturn));76 extern void exit(int) __attribute__((noreturn)); 77 77 extern int usleep(useconds_t); 78 78 extern unsigned int sleep(unsigned int); -
uspace/lib/c/include/vfs/vfs.h
r87e373b rc4fb95d3 57 57 extern int unmount(const char *); 58 58 59 extern void __stdio_init(int filc, fdi_node_t *filv[]);60 extern void __stdio_done(void);61 62 59 extern int open_node(fdi_node_t *, int); 63 60 extern int fd_phone(int);
Note:
See TracChangeset
for help on using the changeset viewer.
