X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-bsd-os.c;h=d071666d1077a3fda2e9fee0e1247c8c1d0c5ab4;hb=711389a80032e3a21719f8a5bac7984deec2ae43;hp=c44c7db4af7eb75538f1558cb1ea2029146bf7ef;hpb=26e8f33d8639e4de75e59e3aa30bbd7478d51a69;p=sbcl.git diff --git a/src/runtime/x86-bsd-os.c b/src/runtime/x86-bsd-os.c index c44c7db..d071666 100644 --- a/src/runtime/x86-bsd-os.c +++ b/src/runtime/x86-bsd-os.c @@ -19,6 +19,12 @@ #include "machine/npx.h" #endif +#if defined(LISP_FEATURE_OPENBSD) +#include +#include +#include +#endif + /* KLUDGE: There is strong family resemblance in the signal context * stuff in FreeBSD and OpenBSD, but in detail they're different in * almost every line of code. It would be nice to find some way to @@ -237,3 +243,19 @@ os_restore_fp_control(os_context_t *context) #endif } #endif + +#if defined(LISP_FEATURE_OPENBSD) +void +os_restore_fp_control(os_context_t *context) +{ + struct sigframe *frame; + union savefpu *fpu; + + 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 + __asm__ __volatile__ ("fldcw %0" : : "m" (fpu->sv_87.sv_env.en_cw)); +} +#endif