]> gitweb.factorcode.org Git - factor.git/blob - vm/os-linux-x86.64.hpp
Merge branch 'master' into startup
[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
23 }