]> gitweb.factorcode.org Git - factor.git/blob - vm/os-linux-x86.64.hpp
Merge remote-tracking branch 'mattknox/master'
[factor.git] / vm / os-linux-x86.64.hpp
1 #include <ucontext.h>
2
3 namespace factor
4 {
5
6 inline static unsigned int uap_fpu_status(void *uap)
7 {
8         ucontext_t *ucontext = (ucontext_t *)uap;
9         return ucontext->uc_mcontext.fpregs->swd
10                 | ucontext->uc_mcontext.fpregs->mxcsr;
11 }
12
13 inline static void uap_clear_fpu_status(void *uap)
14 {
15         ucontext_t *ucontext = (ucontext_t *)uap;
16         ucontext->uc_mcontext.fpregs->swd = 0;
17         ucontext->uc_mcontext.fpregs->mxcsr &= 0xffffffc0;
18 }
19
20 #define UAP_STACK_POINTER(ucontext) (((ucontext_t *)ucontext)->uc_mcontext.gregs[15])
21 #define UAP_PROGRAM_COUNTER(ucontext) (((ucontext_t *)ucontext)->uc_mcontext.gregs[16])
22 #define UAP_SET_TOC_POINTER(uap, ptr) (void)0
23
24 #define CODE_TO_FUNCTION_POINTER(code) (void)0
25 #define CODE_TO_FUNCTION_POINTER_CALLBACK(vm, code) (void)0
26 #define FUNCTION_CODE_POINTER(ptr) ptr
27 #define FUNCTION_TOC_POINTER(ptr) ptr
28
29 #define UAP_STACK_POINTER_TYPE greg_t
30 }