diff options
Diffstat (limited to 'coroutine.h')
-rw-r--r-- | coroutine.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/coroutine.h b/coroutine.h index 273680d..fbaf000 100644 --- a/coroutine.h +++ b/coroutine.h @@ -13,6 +13,8 @@ /* typedefs *******************************************************************/ typedef size_t cid_t; /* 0=none; otherwise 1-indexed */ + +#define COROUTINE __attribute__ ((noreturn, no_split_stack)) void typedef void (*cr_fn_t)(void *args); /* managing coroutines ********************************************************/ @@ -23,12 +25,12 @@ void coroutine_main(void); /* inside of coroutines *******************************************************/ -bool cr_begin(void); -void cr_exit(void); -void cr_yield(void); -void cr_pause_and_yield(void); -void cr_unpause(cid_t); -#define cr_end() +__attribute__ ((no_split_stack)) bool cr_begin( void); +__attribute__ ((no_split_stack, noreturn)) void cr_exit(void); +__attribute__ ((no_split_stack)) void cr_yield(void); +__attribute__ ((no_split_stack)) void cr_pause_and_yield(void); +__attribute__ ((no_split_stack)) void cr_unpause(cid_t); +#define cr_end cr_exit cid_t cr_getcid(void); |