X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-sunos-os.c;h=4569063d7a0d7946f76bed4d9a426c8f157d3c40;hb=f35f14479a64dd97f93d2d91dc154bdc141d6842;hp=fd11cf5e6d20725582dab6c466e963c05f9b00c8;hpb=6d94caa24f68a3df5ac73e7072cea3e62e9d87f5;p=sbcl.git diff --git a/src/runtime/x86-sunos-os.c b/src/runtime/x86-sunos-os.c index fd11cf5..4569063 100644 --- a/src/runtime/x86-sunos-os.c +++ b/src/runtime/x86-sunos-os.c @@ -79,3 +79,14 @@ os_context_sigmask_addr(os_context_t *context) void os_flush_icache(os_vm_address_t address, os_vm_size_t length) { } + +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); +}