1 #define setcontext(u) _setmcontext(&(u)->mc)
2 #define getcontext(u) _getmcontext(&(u)->mc)
3 typedef struct mcontext mcontext_t;
4 typedef struct ucontext ucontext_t;
11 ulong sp; /* callee saved: r1 */
12 ulong toc; /* callee saved: r2 */
13 ulong r3; /* first arg to function, return register: r3 */
14 ulong gpr[19]; /* callee saved: r13-r31 */
16 // XXX: currently do not save vector registers or floating-point state
18 // uvlong fpr[18]; / * callee saved: f14-f31 * /
19 // ulong vr[4*12]; / * callee saved: v20-v31, 256-bits each * /
33 void makecontext(ucontext_t*, void(*)(void), int, ...);
34 int swapcontext(ucontext_t*, ucontext_t*);
35 int _getmcontext(mcontext_t*);
36 void _setmcontext(mcontext_t*);