X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-bsd-os.c;h=8b62584e361607ca4a56f4ac44b6941b1547bf0f;hb=22d55b9f0d56c5998290878d5ab56b76b0544aa6;hp=d071666d1077a3fda2e9fee0e1247c8c1d0c5ab4;hpb=cb2be4b6d03412e2e547a8b051e43d5446792b7c;p=sbcl.git diff --git a/src/runtime/x86-bsd-os.c b/src/runtime/x86-bsd-os.c index d071666..8b62584 100644 --- a/src/runtime/x86-bsd-os.c +++ b/src/runtime/x86-bsd-os.c @@ -1,4 +1,5 @@ #include +#include #include "sbcl.h" #include "runtime.h" #include "thread.h" @@ -20,9 +21,12 @@ #endif #if defined(LISP_FEATURE_OPENBSD) -#include #include #include +#include "openbsd-sigcontext.h" +#ifdef OS_OPENBSD_FPSTATE_IN_SIGFRAME +# include +#endif #endif /* KLUDGE: There is strong family resemblance in the signal context @@ -182,6 +186,10 @@ int arch_os_thread_init(struct thread *thread) { #endif #endif +#ifdef LISP_FEATURE_SB_SAFEPOINT + thread->selfptr = thread; +#endif + #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK stack_t sigstack; @@ -248,11 +256,14 @@ os_restore_fp_control(os_context_t *context) void os_restore_fp_control(os_context_t *context) { - struct sigframe *frame; - union savefpu *fpu; +#ifdef OS_OPENBSD_FPSTATE_IN_SIGFRAME + struct sigframe *frame = (struct sigframe *)((char*)context - + offsetof(struct sigframe, sf_sc)); + union savefpu *fpu = frame->sf_fpstate; +#elif defined(OS_OPENBSD_FPSTATE_IN_SIGCONTEXT) + union savefpu *fpu = context->sc_fpstate; +#endif - frame = (struct sigframe *)((char*)context - offsetof(struct sigframe, sf_sc)); - fpu = frame->sf_fpstate; if (openbsd_use_fxsave) __asm__ __volatile__ ("fldcw %0" : : "m" (fpu->sv_xmm.sv_env.en_cw)); else