38 uintptr_t top = (uintptr_t)stack.
start;
45 .r12 = (uintptr_t)arg,
49 fiber_ctx->
sp = (
void *)sp;
void srn_fiber_ctx_make(srn_fiber_ctx_t *fiber_ctx, srn_fiber_stack_t stack, void(*fn)(void *), void *arg)
Initialise a fresh fiber context so the first srn_fiber_swap into it begins executing fn(arg) on stac...
AI Generated (🤦) Fiber subsystem overview.
void srn_fiber_trampoline(void)
Defined in switch_x86_64.S.
#define SRN_FIBER_FCW_DEFAULT
x87 control word
#define SRN_FIBER_MXCSR_DEFAULT
Control-register values a fresh fiber starts with: all FP exceptions masked, round-to-nearest,...
#define SRN_FIBER_STACK_ALIGN
SysV AMD64 requires 16-byte stack alignment at a call; srn_fiber_ctx_make rounds the frame's base dow...
struct srn_fiber_frame srn_fiber_frame_t
srn_fiber_frame is the exact frame srn_fiber_swap (switch_x86_64.S) pushes and pops,...
The saved context of a suspended fiber is a single word: its stack pointer at the moment it was switc...
One stack per fiber, mapped with a guard page at the low end so an overflow faults deterministically ...
void * start
High end, stack pointer initialises to this address.