Changeset 17aca1c in mainline for uspace/lib/c/include
- Timestamp:
- 2011-02-04T20:56:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0397e5a4, e29e09cf
- Parents:
- e778543 (diff), 0b37882 (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
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/as.h
re778543 r17aca1c 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/assert.h
re778543 r17aca1c 57 57 printf("Assertion failed (%s) at file '%s', " \ 58 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 stacktrace_print(); \60 core(); \61 59 abort(); \ 62 60 } \ -
uspace/lib/c/include/async.h
re778543 r17aca1c 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; … … 50 55 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *); 51 56 52 extern atomic_t async_futex;53 54 57 extern atomic_t threads_in_ipc_wait; 55 58 56 extern int __async_init(void); 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 57 65 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t); 58 59 static inline ipc_callid_t async_get_call(ipc_call_t *data)60 {61 return async_get_call_timeout(data, 0);62 }63 64 static inline void async_manager(void)65 {66 fibril_switch(FIBRIL_TO_MANAGER);67 }68 66 69 67 /* … … 110 108 extern void async_set_interrupt_received(async_client_conn_t); 111 109 112 /* Wrappers for simple communication */ 113 #define async_msg_0(phone, method) \ 114 ipc_call_async_0((phone), (method), NULL, NULL, true) 115 #define async_msg_1(phone, method, arg1) \ 116 ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \ 117 true) 118 #define async_msg_2(phone, method, arg1, arg2) \ 119 ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \ 120 true) 121 #define async_msg_3(phone, method, arg1, arg2, arg3) \ 122 ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \ 123 true) 124 #define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \ 125 ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \ 126 NULL, true) 127 #define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \ 128 ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \ 129 (arg5), NULL, NULL, true) 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); 130 144 131 145 /* … … 135 149 * and slow verion based on m. 136 150 */ 151 137 152 #define async_req_0_0(phoneid, method) \ 138 153 async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \ … … 266 281 } 267 282 283 extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, 284 async_client_conn_t); 268 285 extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 269 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); 270 290 271 291 /* 272 292 * User-friendly wrappers for async_share_in_start(). 273 293 */ 294 274 295 #define async_share_in_start_0_0(phoneid, dst, size) \ 275 296 async_share_in_start((phoneid), (dst), (size), 0, NULL) … … 281 302 async_share_in_start((phoneid), (dst), (size), (arg), (flags)) 282 303 283 extern int async_share_in_start(int, void *, size_t, sysarg_t, int *); 284 extern int async_share_in_receive(ipc_callid_t *, size_t *); 285 extern int async_share_in_finalize(ipc_callid_t, void *, int ); 286 extern int async_share_out_start(int, void *, int); 287 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 *); 288 310 extern int async_share_out_finalize(ipc_callid_t, void *); 289 311 … … 291 313 * User-friendly wrappers for async_data_read_forward_fast(). 292 314 */ 315 293 316 #define async_data_read_forward_0_0(phoneid, method, answer) \ 294 317 async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) … … 318 341 319 342 extern int async_data_read_start(int, void *, size_t); 320 extern intasync_data_read_receive(ipc_callid_t *, size_t *);343 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 321 344 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 322 345 … … 327 350 * User-friendly wrappers for async_data_write_forward_fast(). 328 351 */ 352 329 353 #define async_data_write_forward_0_0(phoneid, method, answer) \ 330 354 async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) … … 356 380 357 381 extern int async_data_write_start(int, const void *, size_t); 358 extern intasync_data_write_receive(ipc_callid_t *, size_t *);382 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 359 383 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 360 384 361 385 extern int async_data_write_accept(void **, const bool, const size_t, 362 386 const size_t, const size_t, size_t *); 363 extern void async_data_write_void( const int);387 extern void async_data_write_void(sysarg_t); 364 388 365 389 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t, -
uspace/lib/c/include/async_sess.h
re778543 r17aca1c 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
re778543 r17aca1c 80 80 #endif 81 81 82 #define htons(n) 83 #define htonl(n) 84 #define ntohs(n) 85 #define ntohl(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
re778543 r17aca1c 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
re778543 r17aca1c 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); -
uspace/lib/c/include/err.h
re778543 r17aca1c 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
re778543 r17aca1c 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 59 #define EINPROGRESS (-10036) 60 60 61 61 /** The socket identifier is not valid. */ 62 #define ENOTSOCK 62 #define ENOTSOCK (-10038) 63 63 64 64 /** The destination address required. */ 65 #define EDESTADDRREQ 65 #define EDESTADDRREQ (-10039) 66 66 67 67 /** Protocol is not supported. */ 68 #define EPROTONOSUPPORT 68 #define EPROTONOSUPPORT (-10043) 69 69 70 70 /** Socket type is not supported. */ 71 #define ESOCKTNOSUPPORT 71 #define ESOCKTNOSUPPORT (-10044) 72 72 73 73 /** Protocol family is not supported. */ 74 #define EPFNOSUPPORT 74 #define EPFNOSUPPORT (-10046) 75 75 76 76 /** Address family is not supported. */ 77 #define EAFNOSUPPORT 77 #define EAFNOSUPPORT (-10047) 78 78 79 79 /** Address is already in use. */ 80 #define EADDRINUSE 80 #define EADDRINUSE (-10048) 81 81 82 82 /** The socket is not connected or bound. */ 83 #define ENOTCONN 83 #define ENOTCONN (-10057) 84 84 85 85 /** The requested operation was not performed. Try again later. */ 86 #define EAGAIN 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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; … … 67 66 } match_id_list_t; 68 67 69 70 static inline match_id_t * create_match_id() 68 static inline match_id_t *create_match_id(void) 71 69 { 72 70 match_id_t *id = malloc(sizeof(match_id_t)); … … 85 83 } 86 84 87 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 85 static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 88 86 { 89 87 match_id_t *mid = NULL; 90 link_t *link = ids->ids.next; 88 link_t *link = ids->ids.next; 91 89 92 90 while (link != &ids->ids) { … … 98 96 } 99 97 100 list_insert_before(&id->link, link); 98 list_insert_before(&id->link, link); 101 99 } 102 100 -
uspace/lib/c/include/ipc/devmap.h
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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 -
uspace/lib/c/include/ipc/il.h
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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_task_hash; 49 sysarg_t in_phone_hash; 50 } ipc_call_t; 51 52 typedef sysarg_t ipc_callid_t; 53 54 typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *); 46 47 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *); 55 48 56 49 /* … … 60 53 * possible, the fast version is used. 61 54 */ 55 62 56 #define ipc_call_sync_0_0(phoneid, method) \ 63 57 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0) … … 189 183 sysarg_t *); 190 184 191 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int); 192 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); 193 186 extern void ipc_poke(void); 194 187 195 static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data) 196 { 197 return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); 198 } 199 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); 200 192 extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *); 201 193 … … 206 198 * to m. 207 199 */ 200 208 201 #define ipc_answer_0(callid, retval) \ 209 202 ipc_answer_fast((callid), (retval), 0, 0, 0, 0) … … 230 223 * to m. 231 224 */ 225 232 226 #define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \ 233 227 ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \ … … 255 249 256 250 extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 257 sysarg_t, void *, ipc_async_callback_t, int);251 sysarg_t, void *, ipc_async_callback_t, bool); 258 252 extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 259 sysarg_t, sysarg_t, void *, ipc_async_callback_t, int); 260 261 extern int ipc_connect_to_me(int, int, int, int, sysarg_t *, sysarg_t *); 262 extern int ipc_connect_me_to(int, int, int, int); 263 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 264 260 extern int ipc_hangup(int); 265 extern int ipc_register_irq(int, int, int, irq_code_t *); 266 extern int ipc_ unregister_irq(int, int);267 extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t,int);268 extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,269 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); 270 266 271 267 /* 272 268 * User-friendly wrappers for ipc_share_in_start(). 273 269 */ 270 274 271 #define ipc_share_in_start_0_0(phoneid, dst, size) \ 275 272 ipc_share_in_start((phoneid), (dst), (size), 0, NULL) … … 281 278 ipc_share_in_start((phoneid), (dst), (size), (arg), (flags)) 282 279 283 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);284 extern int ipc_share_in_finalize(ipc_callid_t, void *, int);285 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); 286 283 extern int ipc_share_out_finalize(ipc_callid_t, void *); 287 284 extern int ipc_data_read_start(int, void *, size_t); -
uspace/lib/c/include/ipc/irc.h
re778543 r17aca1c 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
re778543 r17aca1c 38 38 #define LIBC_IPC_KBD_H_ 39 39 40 #include <ipc/ ipc.h>40 #include <ipc/common.h> 41 41 #include <ipc/dev_iface.h> 42 42 -
uspace/lib/c/include/ipc/loader.h
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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/modules.h
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 32 32 /** 33 33 * @file 34 * @brief 35 * 36 * 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 43 #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 50 #define __syscall1 51 #define __syscall2 52 #define __syscall3 53 #define __syscall4 54 #define __syscall5 55 #define __syscall6 49 #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
re778543 r17aca1c 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__ 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
re778543 r17aca1c 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
re778543 r17aca1c 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
re778543 r17aca1c 41 41 42 42 #ifndef NULL 43 #define NULL 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
re778543 r17aca1c 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.