Changeset 19f24fd in mainline for uspace/lib/libc/include/fibril.h
- Timestamp:
- 2010-02-05T22:25:52Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dafa2d04
- Parents:
- 83349b03 (diff), d42976c (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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/fibril.h
r83349b03 r19f24fd 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 50 #define FIBRIL_WRITER 47 #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 }
Note:
See TracChangeset
for help on using the changeset viewer.