00001 #define setcontext(u) _setmcontext(&(u)->mc)
00002 #define getcontext(u) _getmcontext(&(u)->mc)
00003 typedef struct mcontext mcontext_t;
00004 typedef struct ucontext ucontext_t;
00005 struct mcontext
00006 {
00007 unsigned long pc;
00008 unsigned long cr;
00009 unsigned long ctr;
00010 unsigned long xer;
00011 unsigned long sp;
00012 unsigned long toc;
00013 unsigned long r3;
00014 unsigned long gpr[19];
00015
00016 unsigned long pad;
00017 double fpregs[18];
00018
00019
00020
00021
00022
00023 };
00024
00025 struct ucontext
00026 {
00027 struct {
00028 void *ss_sp;
00029 uint ss_size;
00030 } uc_stack;
00031 sigset_t uc_sigmask;
00032 mcontext_t mc;
00033 struct ucontext * uc_link;
00034 };
00035
00036 void makecontext(ucontext_t*, void(*)(void), int, ...);
00037 int swapcontext(ucontext_t*, ucontext_t*);
00038 int _getmcontext(mcontext_t*);
00039 void _setmcontext(mcontext_t*);
00040