+
+unsigned long
+os_context_fp_control(os_context_t *context)
+{
+ int *state = context->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state;
+ /* The STATE array is in the format used by the x86 instruction FNSAVE,
+ * so the FPU control word is in the first 16 bits */
+ int cw = (state[0] & 0xffff);
+ int sw = context->uc_mcontext.fpregs.fp_reg_set.fpchip_state.status;
+ return (cw ^ 0x3f) | (sw << 16);
+}