1#ifndef COROUTINE_PPC_CONTEXT_H
2#define COROUTINE_PPC_CONTEXT_H 1
11#define COROUTINE __attribute__((noreturn)) void
12#define COROUTINE_LIMITED_ADDRESS_SPACE
29 context->stack_pointer = NULL;
32static inline void coroutine_initialize(
34 coroutine_start start,
38 assert(start && stack && size >= 1024);
41 char * top = (
char*)stack + size;
42 context->stack_pointer = (
void**)((uintptr_t)top & ~0xF);
44 context->stack_pointer -= COROUTINE_REGISTERS;
45 memset(context->stack_pointer, 0,
sizeof(
void*) * COROUTINE_REGISTERS);
48 context->stack_pointer[19] = ((
char*)start) + 8;
55 context->stack_pointer = NULL;