X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-64-bsd-os.c;h=3d9a9c74e2502e862bc5955d79926a2763e64a58;hb=eac461c1f1ca91cfe282c779291d582ed6b336cb;hp=93dec52e46a35da39a81e205a1ef33a9dcdf0eb5;hpb=9184392783512f76eb971b7e316c875e2a1eb94c;p=sbcl.git diff --git a/src/runtime/x86-64-bsd-os.c b/src/runtime/x86-64-bsd-os.c index 93dec52..3d9a9c7 100644 --- a/src/runtime/x86-64-bsd-os.c +++ b/src/runtime/x86-64-bsd-os.c @@ -8,10 +8,8 @@ #include #endif -#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER -#include - -kern_return_t mach_thread_init(mach_port_t thread_exception_port); +#if defined(LISP_FEATURE_OPENBSD) +#include #endif /* KLUDGE: There is strong family resemblance in the signal context @@ -151,7 +149,7 @@ int arch_os_thread_init(struct thread *thread) { #endif #ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER - mach_thread_init(THREAD_STRUCT_TO_EXCEPTION_PORT(thread)); + mach_lisp_thread_init(thread); #endif #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK @@ -182,3 +180,16 @@ os_restore_fp_control(os_context_t *context) asm ("fldcw %0" : : "m" (ex->en_cw)); } #endif + +#if defined(LISP_FEATURE_OPENBSD) +void +os_restore_fp_control(os_context_t *context) +{ + if (context->sc_fpstate != NULL) { + u_int32_t mxcsr = context->sc_fpstate->fx_mxcsr & ~0x3F; + u_int16_t cw = context->sc_fpstate->fx_fcw; + asm ("ldmxcsr %0" : : "m" (mxcsr)); + asm ("fldcw %0" : : "m" (cw)); + } +} +#endif