Changeset 1787e527 in mainline for uspace/lib/libc/include/async_priv.h
- Timestamp:
- 2009-11-16T21:22:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ebdf94
- Parents:
- fcbd1be (diff), 9c70ed6 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/async_priv.h
rfcbd1be r1787e527 1 1 /* 2 * Copyright (c) 200 5 Jakub Jermar2 * Copyright (c) 2006 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc ia3229 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 /* 36 * Variable argument list manipulation macros 37 * for architectures using stack to pass arguments. 38 */ 39 40 #ifndef LIBC_ia32_STACKARG_H_ 41 #define LIBC_ia32_STACKARG_H_ 35 #ifndef LIBC_ASYNC_PRIV_H_ 36 #define LIBC_ASYNC_PRIV_H_ 42 37 43 #include <sys/types.h> 38 #include <adt/list.h> 39 #include <fibril.h> 40 #include <sys/time.h> 41 #include <bool.h> 44 42 45 /* dont allow to define it second time in stdarg.h */ 46 #define __VARARGS_DEFINED 43 /** Structures of this type are used to track the timeout events. */ 44 typedef struct { 45 /** If true, this struct is in the timeout list. */ 46 bool inlist; 47 48 /** Timeout list link. */ 49 link_t link; 50 51 /** If true, we have timed out. */ 52 bool occurred; 47 53 48 typedef struct va_list { 49 int pos; 50 uint8_t *last; 51 } va_list; 54 /** Expiration time. */ 55 struct timeval expires; 56 } to_event_t; 52 57 53 #define va_start(ap, lst) \ 54 (ap).pos = sizeof(lst); \ 55 (ap).last = (uint8_t *) &(lst) 58 /** Structures of this type are used to track the wakeup events. */ 59 typedef struct { 60 /** If true, this struct is in a synchronization object wait queue. */ 61 bool inlist; 62 63 /** Wait queue linkage. */ 64 link_t link; 65 } wu_event_t; 56 66 57 #define va_arg(ap, type) \58 (*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type))))59 67 60 #define va_end(ap) 68 /** Structures of this type represent a waiting fibril. */ 69 typedef struct { 70 /** Identification of and link to the waiting fibril. */ 71 fid_t fid; 72 73 /** If true, this fibril is currently active. */ 74 bool active; 61 75 76 /** Timeout wait data. */ 77 to_event_t to_event; 78 /** Wakeup wait data. */ 79 wu_event_t wu_event; 80 } awaiter_t; 81 82 extern void async_insert_timeout(awaiter_t *wd); 62 83 63 84 #endif
Note:
See TracChangeset
for help on using the changeset viewer.