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
00006
00007
00008
00009
00010
00011 struct mcontext {
00012
00013
00014 unsigned long regs[23];
00015 unsigned long tp;
00016 unsigned long sp;
00017 unsigned long lr;
00018
00019
00020
00021 unsigned long pc;
00022 unsigned long r0;
00023
00024 unsigned long arg0;
00025 unsigned long first;
00026 };
00027
00028
00029 struct ucontext
00030 {
00031 struct {
00032 void *ss_sp;
00033 size_t ss_size;
00034 } uc_stack;
00035
00036 mcontext_t mc;
00037 struct ucontext * uc_link;
00038 };
00039
00040 void makecontext(ucontext_t*, void(*)(void), int, ...);
00041 int swapcontext(ucontext_t*, ucontext_t*);
00042 int _getmcontext(mcontext_t*);
00043 void _setmcontext(mcontext_t*);
00044