X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fmips-linux-os.c;h=70f988e8f467df0b0c4e3681e93440fd5d0f2a8c;hb=236acc699ec1b5996e04f3f30d2859803e54e5ea;hp=17450af8f92676a1099f466e5cb417b6dd6540cc;hpb=b4311ac4940db19282608d09622d0a1a1154cda0;p=sbcl.git diff --git a/src/runtime/mips-linux-os.c b/src/runtime/mips-linux-os.c index 17450af..70f988e 100644 --- a/src/runtime/mips-linux-os.c +++ b/src/runtime/mips-linux-os.c @@ -20,13 +20,12 @@ /* for cacheflush() */ #include -/* for BD_CAUSE */ -#include - #include "sbcl.h" #include "os.h" #include "arch.h" +#define CAUSEF_BD (1 << 31) + size_t os_vm_page_size; int @@ -50,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 * @@ -75,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