]> gitweb.factorcode.org Git - factor.git/blob - vm/os-linux-ppc.32.hpp
VM: an unused #define we can eliminate
[factor.git] / vm / os-linux-ppc.32.hpp
1 #include <ucontext.h>
2
3 namespace factor {
4
5 #define FRAME_RETURN_ADDRESS(frame, vm) \
6   *((void**)(vm->frame_successor(frame) + 1) + 1)
7 #define UAP_STACK_POINTER(ucontext) \
8   ((ucontext_t*)ucontext)->uc_mcontext.uc_regs->gregs[1]
9 #define UAP_PROGRAM_COUNTER(ucontext) \
10   (((ucontext_t*)ucontext)->uc_mcontext.uc_regs->gregs[32])
11 #define UAP_SET_TOC_POINTER(uap, ptr) (void)0
12
13 #define CODE_TO_FUNCTION_POINTER(code) (void)0
14 #define CODE_TO_FUNCTION_POINTER_CALLBACK(vm, code) (void)0
15 #define FUNCTION_CODE_POINTER(ptr) ptr
16 #define FUNCTION_TOC_POINTER(ptr) ptr
17
18 inline static unsigned int uap_fpu_status(void* uap) {
19   union {
20     double as_double;
21     unsigned int as_uint[2];
22   } tmp;
23   tmp.as_double = ((ucontext_t*)uap)->uc_mcontext.uc_regs->fpregs.fpscr;
24   return tmp.as_uint[1];
25 }
26
27 inline static void uap_clear_fpu_status(void* uap) {
28   union {
29     double as_double;
30     unsigned int as_uint[2];
31   } tmp;
32   tmp.as_double = ((ucontext_t*)uap)->uc_mcontext.uc_regs->fpregs.fpscr;
33   tmp.as_uint[1] &= 0x0007f8ff;
34   ((ucontext_t*)uap)->uc_mcontext.uc_regs->fpregs.fpscr = tmp.as_double;
35 }
36
37 }