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 |
static void* getStack | ( | void | ) | [static] |
Definition at line 34 of file uJcontext.C.
Referenced by getJcontext(), and VERBOSE().
VERBOSE | ( | ) |
Definition at line 40 of file uJcontext.C.
References getStack().
Referenced by DLOOP_Dataloop_create_flattened_struct(), makeJcontext(), setJcontext(), and swapJcontext().
int getJcontext | ( | uJcontext_t * | u | ) |
Definition at line 52 of file uJcontext.C.
References uJcontext_t::_uc_args, uJcontext_t::_uc_fn, getStack(), uJcontext_stack_t::ss_flags, uJcontext_stack_t::ss_size, uJcontext_stack_t::ss_sp, uJcontext_t::uc_flags, uJcontext_t::uc_link, uJcontext_t::uc_sigmask, uJcontext_t::uc_stack, and uJcontext_t::uc_swap.
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 70 of file uJcontext.C.
References uJcontext_t::_uc_args, uJcontext_t::_uc_fn, uJcontext_t::_uc_jmp_buf, 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().
int swapJcontext | ( | uJcontext_t * | o, | |
const uJcontext_t * | u | |||
) |
Definition at line 166 of file uJcontext.C.
References uJcontext_t::_uc_jmp_buf, setJcontext(), and VERBOSE().
void makeJcontext | ( | uJcontext_t * | u, | |
uJcontext_fn_t | __func, | |||
int | __argc, | |||
void * | a, | |||
void * | b | |||
) |
Definition at line 185 of file uJcontext.C.
References uJcontext_t::_uc_args, uJcontext_t::_uc_fn, and VERBOSE().
char* _dummyAllocaSetJcontext |
Definition at line 67 of file uJcontext.C.