From 52eb34af7be585c411a9a9ab39f0bea1d19e7d32 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 18 Sep 2024 00:53:51 -0600 Subject: fix? --- coroutine.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'coroutine.h') 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); -- cgit v1.2.3-2-g168b