Changeset 04803bf in mainline for uspace/lib/c/include/fibril.h
- Timestamp:
- 2011-03-21T22:00:17Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 143932e3
- Parents:
- b50b5af2 (diff), 7308e84 (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
-
uspace/lib/c/include/fibril.h (moved) (moved from uspace/lib/libc/include/fibril.h ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/fibril.h
rb50b5af2 r04803bf 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 1 50 #define FIBRIL_WRITER 2 47 #define FIBRIL_SERIALIZED 1 48 #define FIBRIL_WRITER 2 49 50 struct fibril; 51 52 typedef struct { 53 struct fibril *owned_by; 54 } fibril_owner_info_t; 51 55 52 56 typedef enum { … … 59 63 typedef sysarg_t fid_t; 60 64 61 struct fibril {65 typedef struct fibril { 62 66 link_t link; 63 67 context_t ctx; … … 70 74 int retval; 71 75 int flags; 72 }; 73 typedef struct fibril fibril_t; 76 77 fibril_owner_info_t *waits_for; 78 } fibril_t; 74 79 75 80 /** Fibril-local variable specifier */ 76 81 #define fibril_local __thread 77 82 78 extern int context_save(context_t *c ) __attribute__((returns_twice));79 extern void context_restore(context_t *c ) __attribute__((noreturn));83 extern int context_save(context_t *ctx) __attribute__((returns_twice)); 84 extern void context_restore(context_t *ctx) __attribute__((noreturn)); 80 85 81 86 extern fid_t fibril_create(int (*func)(void *), void *arg); … … 89 94 extern void fibril_inc_sercount(void); 90 95 extern void fibril_dec_sercount(void); 96 extern int fibril_get_sercount(void); 91 97 92 static inline int fibril_yield(void) { 98 static inline int fibril_yield(void) 99 { 93 100 return fibril_switch(FIBRIL_PREEMPT); 94 101 }
Note:
See TracChangeset
for help on using the changeset viewer.
