• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/programs/qthread-1.4/include/osx_compat/tile-ucontext.h

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  * This struct defines the way the registers are stored on the stack during a
00007  * system call/exception.  It should be a multiple of 8 bytes to preserve
00008  * normal stack alignment rules.
00009  *
00010  */
00011 struct mcontext {
00012     /* Saved main processor registers; 56..63 are special. */
00013     /* tp, sp, and lr must immediately follow regs[] for aliasing. */
00014     unsigned long regs[23]; /* callee saves r30-r52 */
00015     unsigned long tp;       /* thread-local data pointer (23*4) */
00016     unsigned long sp;       /* stack pointer (grows DOWNWARD) (23*4)+4 */
00017     unsigned long lr;       /* aka link register (where to go when returning from a function)
00018                                (23*4)+(2*4) */
00019 
00020     /* Saved special registers. */
00021     unsigned long pc;       /* (23*4)+(3*4) */
00022     unsigned long r0;       /* (23*4)+(4*4) */
00023     //unsigned long ex1;      /* stored in EX_CONTEXT_1_1 (PL and ICS bit) */
00024     unsigned long arg0;     /* (23*4)+(5*4) only used for first function invocation */
00025     unsigned long first;    /* (23*4)+(6*4) */
00026 };
00027 
00028 
00029 struct ucontext
00030 {
00031         struct {
00032                 void *ss_sp;
00033                 size_t ss_size;
00034         } uc_stack;
00035         //sigset_t uc_sigmask;
00036         mcontext_t mc;
00037         struct ucontext * uc_link; /* unused */
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 

Generated on Fri Oct 22 2010 11:02:24 for SST by  doxygen 1.7.1