Changeset 197ef43 in mainline for uspace/lib/c/include
- Timestamp:
- 2011-01-29T23:52:07Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12573db, 40fb017
- Parents:
- 6aef742 (diff), 47b7006 (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:
-
- 15 edited
-
async.h (modified) (5 diffs)
-
async_sess.h (modified) (1 diff)
-
byteorder.h (modified) (1 diff)
-
err.h (modified) (1 diff)
-
errno.h (modified) (2 diffs)
-
ipc/ipc.h (modified) (6 diffs)
-
loader/pcb.h (modified) (1 diff)
-
malloc.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)
-
unistd.h (modified) (2 diffs)
-
vfs/vfs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/async.h
r6aef742 r197ef43 57 57 extern atomic_t threads_in_ipc_wait; 58 58 59 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 60 65 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t); 61 62 static inline ipc_callid_t async_get_call(ipc_call_t *data)63 {64 return async_get_call_timeout(data, 0);65 }66 67 static inline void async_manager(void)68 {69 fibril_switch(FIBRIL_TO_MANAGER);70 }71 66 72 67 /* … … 143 138 */ 144 139 145 extern int async_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int); 146 extern int async_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t, 147 sysarg_t, sysarg_t, sysarg_t, int); 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); 148 144 149 145 /* … … 306 302 async_share_in_start((phoneid), (dst), (size), (arg), (flags)) 307 303 308 extern int async_share_in_start(int, void *, size_t, sysarg_t, int *); 309 extern int async_share_in_receive(ipc_callid_t *, size_t *); 310 extern int async_share_in_finalize(ipc_callid_t, void *, int ); 311 extern int async_share_out_start(int, void *, int); 312 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 *); 313 310 extern int async_share_out_finalize(ipc_callid_t, void *); 314 311 … … 344 341 345 342 extern int async_data_read_start(int, void *, size_t); 346 extern intasync_data_read_receive(ipc_callid_t *, size_t *);343 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 347 344 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 348 345 … … 383 380 384 381 extern int async_data_write_start(int, const void *, size_t); 385 extern intasync_data_write_receive(ipc_callid_t *, size_t *);382 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 386 383 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 387 384 388 385 extern int async_data_write_accept(void **, const bool, const size_t, 389 386 const size_t, const size_t, size_t *); 390 extern void async_data_write_void( const int);387 extern void async_data_write_void(sysarg_t); 391 388 392 389 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t, -
uspace/lib/c/include/async_sess.h
r6aef742 r197ef43 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
r6aef742 r197ef43 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/err.h
r6aef742 r197ef43 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
r6aef742 r197ef43 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/ipc/ipc.h
r6aef742 r197ef43 53 53 * possible, the fast version is used. 54 54 */ 55 55 56 #define ipc_call_sync_0_0(phoneid, method) \ 56 57 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0) … … 182 183 sysarg_t *); 183 184 184 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int); 185 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); 186 186 extern void ipc_poke(void); 187 187 188 static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data) 189 { 190 return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); 191 } 192 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); 193 192 extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *); 194 193 … … 199 198 * to m. 200 199 */ 200 201 201 #define ipc_answer_0(callid, retval) \ 202 202 ipc_answer_fast((callid), (retval), 0, 0, 0, 0) … … 223 223 * to m. 224 224 */ 225 225 226 #define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \ 226 227 ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \ … … 248 249 249 250 extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 250 sysarg_t, void *, ipc_async_callback_t, int);251 sysarg_t, void *, ipc_async_callback_t, bool); 251 252 extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 252 sysarg_t, sysarg_t, void *, ipc_async_callback_t, int); 253 254 extern int ipc_connect_to_me(int, int, int, int, sysarg_t *, sysarg_t *); 255 extern int ipc_connect_me_to(int, int, int, int); 256 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 257 260 extern int ipc_hangup(int); 258 extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int); 259 extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t, 260 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); 261 266 262 267 /* 263 268 * User-friendly wrappers for ipc_share_in_start(). 264 269 */ 270 265 271 #define ipc_share_in_start_0_0(phoneid, dst, size) \ 266 272 ipc_share_in_start((phoneid), (dst), (size), 0, NULL) … … 272 278 ipc_share_in_start((phoneid), (dst), (size), (arg), (flags)) 273 279 274 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);275 extern int ipc_share_in_finalize(ipc_callid_t, void *, int);276 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); 277 283 extern int ipc_share_out_finalize(ipc_callid_t, void *); 278 284 extern int ipc_data_read_start(int, void *, size_t); -
uspace/lib/c/include/loader/pcb.h
r6aef742 r197ef43 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
r6aef742 r197ef43 38 38 #include <sys/types.h> 39 39 40 extern void __heap_init(void);41 40 extern uintptr_t get_max_heap_addr(void); 42 41 -
uspace/lib/c/include/setjmp.h
r6aef742 r197ef43 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
r6aef742 r197ef43 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
r6aef742 r197ef43 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
r6aef742 r197ef43 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
r6aef742 r197ef43 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/unistd.h
r6aef742 r197ef43 41 41 42 42 #ifndef NULL 43 #define NULL ((void *) 0)43 #define NULL ((void *) 0) 44 44 #endif 45 45 … … 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
r6aef742 r197ef43 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.
