X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fmips-linux-os.c;h=17450af8f92676a1099f466e5cb417b6dd6540cc;hb=732ad8030a354ff38af83a84173bfc919a4d7f1c;hp=9fee95eb338fe042c16ca8f4ec79ee61cf17a1f8;hpb=79cc569a97e444389350ea3f5b1017374fe16bec;p=sbcl.git diff --git a/src/runtime/mips-linux-os.c b/src/runtime/mips-linux-os.c index 9fee95e..17450af 100644 --- a/src/runtime/mips-linux-os.c +++ b/src/runtime/mips-linux-os.c @@ -15,29 +15,17 @@ */ #include -#include -#include -#include "sbcl.h" -#include "./signal.h" -#include "os.h" -#include "arch.h" -#include "globals.h" -#include "interrupt.h" -#include "interr.h" -#include "lispregs.h" -#include -#include - -#include #include -#include -#include -#include /* for cacheflush() */ #include -#include "validate.h" +/* for BD_CAUSE */ +#include + +#include "sbcl.h" +#include "os.h" +#include "arch.h" size_t os_vm_page_size; @@ -66,6 +54,12 @@ os_context_register_addr(os_context_t *context, int offset) } os_context_register_t * +os_context_fpregister_addr(os_context_t *context, int offset) +{ + return &(((struct sigcontext *)&(context->uc_mcontext))->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 */ @@ -82,6 +76,7 @@ unsigned int os_context_fp_control(os_context_t *context) { /* FIXME: Probably do something. */ + return 0; } void @@ -101,12 +96,23 @@ os_context_bd_cause(os_context_t *context) loop" where a (BREAK 16) not in a branch delay slot would have CAUSEF_BD filled. So, we comment - #include - return (((struct sigcontext *) &(context->uc_mcontext))->sc_cause & CAUSEF_BD); out and return 0 always. -- CSR, 2002-09-02 */ + /* Unfortunately, returning 0 fails for taken branches because + os_context_bd_cause is also used to find out if a branch + emulation is needed. We work around that by checking if the + current instruction is a jump or a branch. */ + extern boolean arch_insn_with_bdelay_p(unsigned int insn); + + os_vm_address_t addr + = (os_vm_address_t)(unsigned int)*os_context_pc_addr(context); + unsigned int insn = *(unsigned int *)addr; + + if (arch_insn_with_bdelay_p(insn)) + return CAUSEF_BD; + return 0; }