8#define COROUTINE __attribute__((noreturn)) void
10enum {COROUTINE_REGISTERS = 0xd0 / 8};
21 context->stack_pointer = NULL;
24static inline void coroutine_initialize(
26 coroutine_start start,
30 assert(start && stack && size >= 1024);
33 char * top = (
char*)stack + size;
34 context->stack_pointer = (
void**)((uintptr_t)top & ~0xF);
36 context->stack_pointer -= COROUTINE_REGISTERS;
37 memset(context->stack_pointer, 0,
sizeof(
void*) * COROUTINE_REGISTERS);
39 context->stack_pointer[0xc0 / 8] = (
void*)(uintptr_t)start;