* Patch by Josh Elsasser, lp#615492.
In his words:
OpenBSD/amd64 recently began running signal handlers with a clean
FPU state, making it necessary to load the floating point control
word. The attached patch does exactly this, and works equally well
on OpenBSD systems from both before and after the signal handler
change was made.
This patch is necessary to build SBCL x86-64 on recent -current
snapshots of OpenBSD, and for the upcoming 4.8 release.
* Committing untested, as I don't have OpenBSD handy.
on Linux. (lp#626962, thanks to Stas Boukarev)
* bug fix: scripting fixes for Solaris and FreeBSD. (lp#615497, thanks to
Josh Elsasser)
- * bug fix: build fixes for OpenBSD -current and 4.8 (lp#615489, thanks to
- Josh Elsasser)
+ * bug fix: build fixes for OpenBSD -current and 4.8 (lp#615489, lp#615492,
+ thanks to Josh Elsasser)
* bug fix: using aliases for builtin classes as defmethod specializers
without adding DEFTYPEs for them works. (lp#618387)
* bug fix: timetravel by getrusage() no longer causes type-errors during GC.
#include <machine/fpu.h>
#endif
+#if defined(LISP_FEATURE_OPENBSD)
+#include <machine/fpu.h>
+#endif
+
#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER
#include <mach/mach.h>
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
}
#endif
+#if defined LISP_FEATURE_OPENBSD
+#define RESTORE_FP_CONTROL_FROM_CONTEXT
+void os_restore_fp_control(os_context_t *context);
+#endif
+
#endif /* _X86_64_BSD_OS_H */