+#if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT)
+ /* Calling this function here may not be good idea. Or rename
+ * function name os_restore_fp_control to os_restore_context or
+ * so, to match the behavior? */
+ os_restore_tls_segment_register(context);
+#endif
+}
+#endif
+
+#if defined(LISP_FEATURE_OPENBSD)
+void
+os_restore_fp_control(os_context_t *context)
+{
+#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
+
+ 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));