Changeset 0b9ac3c in mainline for uspace/lib/libc/include
- Timestamp:
- 2010-02-23T19:03:28Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c62d2e1
- Parents:
- 1ccafee (diff), 5e50394 (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/libc/include
- Files:
-
- 1 added
- 15 edited
-
async.h (modified) (2 diffs)
-
atomicdflt.h (modified) (1 diff)
-
fibril.h (modified) (4 diffs)
-
ipc/adb.h (added)
-
ipc/clipboard.h (modified) (1 diff)
-
ipc/services.h (modified) (1 diff)
-
limits.h (modified) (4 diffs)
-
macros.h (modified) (1 diff)
-
stacktrace.h (modified) (1 diff)
-
stdio.h (modified) (3 diffs)
-
sys/mman.h (modified) (2 diffs)
-
sys/stat.h (modified) (2 diffs)
-
sys/time.h (modified) (2 diffs)
-
sys/typefmt.h (modified) (1 diff)
-
sys/types.h (modified) (1 diff)
-
unistd.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/async.h
r1ccafee r0b9ac3c 259 259 } 260 260 261 extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t); 262 extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t); 263 261 264 /* 262 265 * User-friendly wrappers for async_share_in_start(). … … 277 280 extern int async_share_out_receive(ipc_callid_t *, size_t *, int *); 278 281 extern int async_share_out_finalize(ipc_callid_t, void *); 282 283 /* 284 * User-friendly wrappers for async_data_read_forward_fast(). 285 */ 286 #define async_data_read_forward_0_0(phoneid, method, answer) \ 287 async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) 288 #define async_data_read_forward_0_1(phoneid, method, answer) \ 289 async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer)) 290 #define async_data_read_forward_1_0(phoneid, method, arg1, answer) \ 291 async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL) 292 #define async_data_read_forward_1_1(phoneid, method, arg1, answer) \ 293 async_data_read_forward_fast((phoneid), (method), (arg1), 0, 0, 0, (answer)) 294 #define async_data_read_forward_2_0(phoneid, method, arg1, arg2, answer) \ 295 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL) 296 #define async_data_read_forward_2_1(phoneid, method, arg1, arg2, answer) \ 297 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \ 298 (answer)) 299 #define async_data_read_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \ 300 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \ 301 NULL) 302 #define async_data_read_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \ 303 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \ 304 (answer)) 305 #define async_data_read_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \ 306 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 307 (arg4), NULL) 308 #define async_data_read_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \ 309 async_data_read_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 310 (arg4), (answer)) 311 279 312 extern int async_data_read_start(int, void *, size_t); 280 313 extern int async_data_read_receive(ipc_callid_t *, size_t *); 281 314 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 315 316 extern int async_data_read_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, 317 ipcarg_t, ipcarg_t, ipc_call_t *); 318 319 /* 320 * User-friendly wrappers for async_data_write_forward_fast(). 321 */ 322 #define async_data_write_forward_0_0(phoneid, method, answer) \ 323 async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL) 324 #define async_data_write_forward_0_1(phoneid, method, answer) \ 325 async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, (answer)) 326 #define async_data_write_forward_1_0(phoneid, method, arg1, answer) \ 327 async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, NULL) 328 #define async_data_write_forward_1_1(phoneid, method, arg1, answer) \ 329 async_data_write_forward_fast((phoneid), (method), (arg1), 0, 0, 0, \ 330 (answer)) 331 #define async_data_write_forward_2_0(phoneid, method, arg1, arg2, answer) \ 332 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \ 333 NULL) 334 #define async_data_write_forward_2_1(phoneid, method, arg1, arg2, answer) \ 335 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), 0, 0, \ 336 (answer)) 337 #define async_data_write_forward_3_0(phoneid, method, arg1, arg2, arg3, answer) \ 338 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 339 0, NULL) 340 #define async_data_write_forward_3_1(phoneid, method, arg1, arg2, arg3, answer) \ 341 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 342 0, (answer)) 343 #define async_data_write_forward_4_0(phoneid, method, arg1, arg2, arg3, arg4, answer) \ 344 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 345 (arg4), NULL) 346 #define async_data_write_forward_4_1(phoneid, method, arg1, arg2, arg3, arg4, answer) \ 347 async_data_write_forward_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 348 (arg4), (answer)) 349 282 350 extern int async_data_write_start(int, const void *, size_t); 283 351 extern int async_data_write_receive(ipc_callid_t *, size_t *); 284 352 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 285 353 286 extern int async_data_blob_receive(char **, const size_t, size_t *); 287 extern int async_data_string_receive(char **, const size_t); 354 extern int async_data_write_accept(void **, const bool, const size_t, 355 const size_t, const size_t, size_t *); 356 extern void async_data_write_void(const int); 357 358 extern int async_data_write_forward_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, 359 ipcarg_t, ipcarg_t, ipc_call_t *); 288 360 289 361 #endif -
uspace/lib/libc/include/atomicdflt.h
r1ccafee r0b9ac3c 37 37 38 38 #ifndef LIBC_ARCH_ATOMIC_H_ 39 #error This file cannot be included directly, include atomic.h instead.39 #error This file cannot be included directly, include atomic.h instead. 40 40 #endif 41 41 42 #include <stdint.h> 42 43 #include <bool.h> 43 44 44 45 typedef struct atomic { 45 volatile longcount;46 volatile atomic_count_t count; 46 47 } atomic_t; 47 48 48 static inline void atomic_set(atomic_t *val, longi)49 static inline void atomic_set(atomic_t *val, atomic_count_t i) 49 50 { 50 val->count = i;51 val->count = i; 51 52 } 52 53 53 static inline longatomic_get(atomic_t *val)54 static inline atomic_count_t atomic_get(atomic_t *val) 54 55 { 55 return val->count;56 return val->count; 56 57 } 57 58 58 #ifndef CAS 59 static inline bool cas(atomic_t *val, long ov, longnv)59 #ifndef CAS 60 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv) 60 61 { 61 62 return __sync_bool_compare_and_swap(&val->count, ov, nv); -
uspace/lib/libc/include/fibril.h
r1ccafee r0b9ac3c 40 40 #include <libarch/tls.h> 41 41 42 #ifndef context_set 43 #define context_set(c, _pc, stack, size, ptls) \ 42 #define context_set_generic(c, _pc, stack, size, ptls) \ 44 43 (c)->pc = (sysarg_t) (_pc); \ 45 44 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 46 45 (c)->tls = (sysarg_t) (ptls); 47 #endif /* context_set */48 46 49 #define FIBRIL_SERIALIZED 150 #define FIBRIL_WRITER 247 #define FIBRIL_SERIALIZED 1 48 #define FIBRIL_WRITER 2 51 49 52 50 typedef enum { … … 59 57 typedef sysarg_t fid_t; 60 58 61 struct fibril {59 typedef struct fibril { 62 60 link_t link; 63 61 context_t ctx; … … 70 68 int retval; 71 69 int flags; 72 }; 73 typedef struct fibril fibril_t; 70 } fibril_t; 74 71 75 72 /** Fibril-local variable specifier */ 76 73 #define fibril_local __thread 77 74 78 extern int context_save(context_t *c ) __attribute__((returns_twice));79 extern void context_restore(context_t *c ) __attribute__((noreturn));75 extern int context_save(context_t *ctx) __attribute__((returns_twice)); 76 extern void context_restore(context_t *ctx) __attribute__((noreturn)); 80 77 81 78 extern fid_t fibril_create(int (*func)(void *), void *arg); … … 90 87 extern void fibril_dec_sercount(void); 91 88 92 static inline int fibril_yield(void) { 89 static inline int fibril_yield(void) 90 { 93 91 return fibril_switch(FIBRIL_PREEMPT); 94 92 } -
uspace/lib/libc/include/ipc/clipboard.h
r1ccafee r0b9ac3c 46 46 typedef enum { 47 47 CLIPBOARD_TAG_NONE, 48 CLIPBOARD_TAG_ BLOB48 CLIPBOARD_TAG_DATA 49 49 } clipboard_tag_t; 50 50 -
uspace/lib/libc/include/ipc/services.h
r1ccafee r0b9ac3c 47 47 SERVICE_FHC, 48 48 SERVICE_OBIO, 49 SERVICE_CLIPBOARD 49 SERVICE_CLIPBOARD, 50 SERVICE_NETWORKING, 51 SERVICE_LO, 52 SERVICE_DP8390, 53 SERVICE_ETHERNET, 54 SERVICE_NILDUMMY, 55 SERVICE_IP, 56 SERVICE_ARP, 57 SERVICE_RARP, 58 SERVICE_ICMP, 59 SERVICE_UDP, 60 SERVICE_TCP, 61 SERVICE_SOCKET 50 62 } services_t; 51 63 -
uspace/lib/libc/include/limits.h
r1ccafee r0b9ac3c 46 46 47 47 #ifdef __CHAR_UNSIGNED__ 48 #define CHAR_MIN UCHAR_MIN49 #define CHAR_MAX UCHAR_MAX48 #define CHAR_MIN UCHAR_MIN 49 #define CHAR_MAX UCHAR_MAX 50 50 #else 51 #define CHAR_MIN SCHAR_MIN52 #define CHAR_MAX SCHAR_MAX51 #define CHAR_MIN SCHAR_MIN 52 #define CHAR_MAX SCHAR_MAX 53 53 #endif 54 54 … … 59 59 #define USHRT_MAX MAX_UINT16 60 60 61 /* int */ 61 62 #define INT_MIN MIN_INT32 62 63 #define INT_MAX MAX_INT32 … … 64 65 #define UINT_MAX MAX_UINT32 65 66 67 /* long long int */ 66 68 #define LLONG_MIN MIN_INT64 67 69 #define LLONG_MAX MAX_INT64 … … 69 71 #define ULLONG_MAX MAX_UINT64 70 72 73 /* off64_t */ 74 #define OFF64_MIN MIN_INT64 75 #define OFF64_MAX MAX_INT64 76 77 /* aoff64_t */ 78 #define AOFF64_MIN MIN_UINT64 79 #define AOFF64_MAX MAX_UINT64 80 71 81 #endif 72 82 -
uspace/lib/libc/include/macros.h
r1ccafee r0b9ac3c 48 48 #define STRING_ARG(arg) #arg 49 49 50 #define LOWER32(arg) (( arg) & 0xffffffff)51 #define UPPER32(arg) ((( arg) >> 32) & 0xffffffff)50 #define LOWER32(arg) (((uint64_t) (arg)) & 0xffffffff) 51 #define UPPER32(arg) (((((uint64_t) arg)) >> 32) & 0xffffffff) 52 52 53 53 #define MERGE_LOUP32(lo, up) \ -
uspace/lib/libc/include/stacktrace.h
r1ccafee r0b9ac3c 57 57 extern void stacktrace_prepare(void); 58 58 extern uintptr_t stacktrace_fp_get(void); 59 extern uintptr_t stacktrace_pc_get( );59 extern uintptr_t stacktrace_pc_get(void); 60 60 61 61 #endif -
uspace/lib/libc/include/stdio.h
r1ccafee r0b9ac3c 46 46 #define BUFSIZ 4096 47 47 48 #define DEBUG(fmt, ...) \48 #define DEBUG(fmt, ...)se\ 49 49 { \ 50 50 char _buf[256]; \ … … 56 56 #ifndef SEEK_SET 57 57 #define SEEK_SET 0 58 #endif 59 60 #ifndef SEEK_CUR 58 61 #define SEEK_CUR 1 62 #endif 63 64 #ifndef SEEK_END 59 65 #define SEEK_END 2 60 66 #endif … … 135 141 extern size_t fwrite(const void *, size_t, size_t, FILE *); 136 142 137 extern int fseek(FILE *, long, int);143 extern int fseek(FILE *, off64_t, int); 138 144 extern void rewind(FILE *); 139 extern int ftell(FILE *);145 extern off64_t ftell(FILE *); 140 146 extern int feof(FILE *); 141 147 -
uspace/lib/libc/include/sys/mman.h
r1ccafee r0b9ac3c 41 41 #define MAP_FAILED ((void *) -1) 42 42 43 #define MAP_SHARED (1 << 0)44 #define MAP_PRIVATE (1 << 1)45 #define MAP_FIXED (1 << 2)46 #define MAP_ANONYMOUS (1 << 3)43 #define MAP_SHARED (1 << 0) 44 #define MAP_PRIVATE (1 << 1) 45 #define MAP_FIXED (1 << 2) 46 #define MAP_ANONYMOUS (1 << 3) 47 47 48 48 #define PROTO_READ AS_AREA_READ … … 50 50 #define PROTO_EXEC AS_AREA_EXEC 51 51 52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd,53 off_t offset);52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, 53 aoff64_t offset); 54 54 extern int munmap(void *start, size_t length); 55 55 -
uspace/lib/libc/include/sys/stat.h
r1ccafee r0b9ac3c 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_SYS_STAT_H_ … … 48 48 bool is_file; 49 49 bool is_directory; 50 off_t size;50 aoff64_t size; 51 51 dev_handle_t device; 52 52 }; -
uspace/lib/libc/include/sys/time.h
r1ccafee r0b9ac3c 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_SYS_TIME_H_ … … 44 44 45 45 struct timeval { 46 time_t tv_sec; /* seconds */47 suseconds_t tv_usec; /* microseconds */46 time_t tv_sec; /* seconds */ 47 suseconds_t tv_usec; /* microseconds */ 48 48 }; 49 49 50 50 struct timezone { 51 int tz_minuteswest;/* minutes W of Greenwich */52 int tz_dsttime;/* type of dst correction */51 int tz_minuteswest; /* minutes W of Greenwich */ 52 int tz_dsttime; /* type of dst correction */ 53 53 }; 54 54 -
uspace/lib/libc/include/sys/typefmt.h
r1ccafee r0b9ac3c 39 39 #include <inttypes.h> 40 40 41 /* off_t */ 42 #define PRIdOFF "ld" 43 #define PRIuOFF "lu" 44 #define PRIxOFF "lx" 45 #define PRIXOFF "lX" 46 47 /* bn_t */ 48 #define PRIdBN PRId64 49 #define PRIuBN PRIu64 50 #define PRIxBN PRIx64 51 #define PRIXBN PRIX64 41 /* off64_t */ 42 #define PRIdOFF64 PRId64 43 #define PRIuOFF64 PRIu64 44 #define PRIxOFF64 PRIx64 45 #define PRIXOFF64 PRIX64 52 46 53 47 /* (s)size_t */ -
uspace/lib/libc/include/sys/types.h
r1ccafee r0b9ac3c 38 38 #include <libarch/types.h> 39 39 40 typedef long off_t; 41 typedef int mode_t; 42 typedef uint64_t bn_t; /**< Block number type. */ 40 typedef unsigned int mode_t; 43 41 42 /** Relative offset */ 43 typedef int64_t off64_t; 44 45 /** Absolute offset */ 46 typedef uint64_t aoff64_t; 47 48 /** Unicode code point */ 44 49 typedef int32_t wchar_t; 45 50 -
uspace/lib/libc/include/unistd.h
r1ccafee r0b9ac3c 47 47 #ifndef SEEK_SET 48 48 #define SEEK_SET 0 49 #endif 50 51 #ifndef SEEK_CUR 49 52 #define SEEK_CUR 1 53 #endif 54 55 #ifndef SEEK_END 50 56 #define SEEK_END 2 51 57 #endif … … 58 64 extern ssize_t read(int, void *, size_t); 59 65 60 extern off _t lseek(int, off_t, int);61 extern int ftruncate(int, off_t);66 extern off64_t lseek(int, off64_t, int); 67 extern int ftruncate(int, aoff64_t); 62 68 63 69 extern int close(int); … … 69 75 extern int chdir(const char *); 70 76 71 extern void _exit(int status) __attribute__((noreturn));72 extern int usleep(useconds_t uses);73 extern unsigned int sleep(unsigned int se);77 extern void _exit(int) __attribute__((noreturn)); 78 extern int usleep(useconds_t); 79 extern unsigned int sleep(unsigned int); 74 80 75 81 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
