6 #define FRAME_RETURN_ADDRESS(frame,vm) *((void **)(vm->frame_successor(frame) + 1) + 2)
7 #define UAP_STACK_POINTER(ucontext) ((ucontext_t *)ucontext)->uc_mcontext.gp_regs[1]
8 #define UAP_PROGRAM_COUNTER(ucontext) (((ucontext_t *)ucontext)->uc_mcontext.gp_regs[32])
9 #define UAP_SET_TOC_POINTER(uap, ptr) (void)0
11 #define FACTOR_PPC_TOC 1
13 #define CODE_TO_FUNCTION_POINTER(code) \
15 code = fill_function_descriptor(desc, code)
17 #define CODE_TO_FUNCTION_POINTER_CALLBACK(vm, code) \
18 code = fill_function_descriptor(new void*[3], code); \
19 vm->function_descriptors.push_back((void **)code)
21 #define FUNCTION_CODE_POINTER(ptr) \
22 (function_descriptor_field((void *)ptr, 0))
24 #define FUNCTION_TOC_POINTER(ptr) \
25 (function_descriptor_field((void *)ptr, 1))
27 #define UAP_STACK_POINTER_TYPE unsigned long
29 inline static unsigned int uap_fpu_status(void *uap)
33 unsigned int as_uint[2];
35 tmp.as_double = ((ucontext_t*) uap)->uc_mcontext.fp_regs[32];
36 return tmp.as_uint[1];
39 inline static void uap_clear_fpu_status(void *uap)
43 unsigned int as_uint[2];
45 tmp.as_double = ((ucontext_t*) uap)->uc_mcontext.fp_regs[32];
46 tmp.as_uint[1] &= 0x0007f8ff;
47 ((ucontext_t*) uap)->uc_mcontext.fp_regs[32] = tmp.as_double;