improve SXHASH on fixnums
[sbcl.git] / src / runtime / mips-linux-os.c
index 1028b83..70f988e 100644 (file)
@@ -49,20 +49,26 @@ arch_os_thread_cleanup(struct thread *thread)
 os_context_register_t *
 os_context_register_addr(os_context_t *context, int offset)
 {
-    return &(((struct sigcontext *)&(context->uc_mcontext))->sc_regs[offset]);
+    mcontext_t *mctx = &context->uc_mcontext;
+    struct sigcontext *ctx = (struct sigcontext *)mctx;
+    return &ctx->sc_regs[offset];
 }
 
 os_context_register_t *
 os_context_fpregister_addr(os_context_t *context, int offset)
 {
-    return &(((struct sigcontext *)&(context->uc_mcontext))->sc_fpregs[offset]);
+    mcontext_t *mctx = &context->uc_mcontext;
+    struct sigcontext *ctx = (struct sigcontext *)mctx;
+    return &ctx->sc_fpregs[offset];
 }
 
 os_context_register_t *
 os_context_pc_addr(os_context_t *context)
 {
     /* Why do I get all the silly ports? -- CSR, 2002-08-11 */
-    return &(((struct sigcontext *)&(context->uc_mcontext))->sc_pc);
+    mcontext_t *mctx = &context->uc_mcontext;
+    struct sigcontext *ctx = (struct sigcontext *)mctx;
+    return &ctx->sc_pc;
 }
 
 sigset_t *
@@ -74,14 +80,17 @@ os_context_sigmask_addr(os_context_t *context)
 unsigned int
 os_context_fp_control(os_context_t *context)
 {
-    /* FIXME: Probably do something. */
-    return 0;
+    mcontext_t *mctx = &context->uc_mcontext;
+    struct sigcontext *ctx = (struct sigcontext *)mctx;
+    return ctx->sc_fpc_csr;
 }
 
 void
 os_restore_fp_control(os_context_t *context)
 {
-    /* FIXME: Probably do something. */
+    unsigned int ctl = os_context_fp_control(context);
+    ctl &= ~(FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK);
+    arch_set_fp_control(ctl);
 }
 
 unsigned int