PPL Logo

util/uJcontext.c File Reference

Go to the source code of this file.

Functions

static void * getStack (void)
 VERBOSE ()
int getJcontext (uJcontext_t *u)
int setJcontext (const uJcontext_t *u)
int swapJcontext (uJcontext_t *o, const uJcontext_t *u)
void makeJcontext (uJcontext_t *u, uJcontext_fn_t __func, int __argc, void *a, void *b)

Variables

char * _dummyAllocaSetJcontext


Function Documentation

static void* getStack ( void   )  [static]

Definition at line 34 of file uJcontext.c.

References p.

Referenced by getJcontext(), and VERBOSE().

VERBOSE (  ) 

Definition at line 39 of file uJcontext.c.

References getStack(), and printf().

Referenced by makeJcontext(), setJcontext(), and swapJcontext().

int getJcontext ( uJcontext_t u  ) 

int setJcontext ( const uJcontext_t u  ) 

Some machines reference variables (e.g., arguments, saved link) from their caller's stack frame, so we need to leave a little extra space before the new stack pointer.

Microsoft's _alloca is too smart-- it checks the pages being allocated to see if they're all valid stack pages, so our hack of using a huge alloca to change the stack pointer instead results in an address error (from "chkstk").

Manually changing the stack pointer seems to work properly; and because local variables are referenced via the frame pointer (ebp), this is all that's needed.

Definition at line 69 of file uJcontext.c.

References uJcontext_t::_uc_args, uJcontext_t::_uc_fn, uJcontext_t::_uc_jmp_buf, printf(), setJcontext(), uJcontext_stack_t::ss_size, uJcontext_stack_t::ss_sp, uJcontext_t::uc_link, uJcontext_t::uc_stack, uJcontext_t::uc_swap, and VERBOSE().

Referenced by setJcontext(), and swapJcontext().

int swapJcontext ( uJcontext_t o,
const uJcontext_t u 
)

Definition at line 164 of file uJcontext.c.

References uJcontext_t::_uc_jmp_buf, printf(), setJcontext(), and VERBOSE().

void makeJcontext ( uJcontext_t u,
uJcontext_fn_t  __func,
int  __argc,
void *  a,
void *  b 
)

Definition at line 183 of file uJcontext.c.

References uJcontext_t::_uc_args, uJcontext_t::_uc_fn, printf(), and VERBOSE().

Referenced by CthCreateInner().


Variable Documentation

Definition at line 66 of file uJcontext.c.


Generated on Sat May 26 08:08:11 2012 for Charm++ by  doxygen 1.5.5