From 93ff086ab8bea4dd1f34f80918935c17ac377337 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 6 Sep 2002 08:55:25 +0000 Subject: [PATCH] 0.7.7.17: MIPS fixup ... Linux appears to put garbage in the sc_cause sigcontext slot. So assume that we never trap in a branch delay instruction, and hope for the best. --- NEWS | 4 ++++ src/runtime/mips-arch.c | 10 +++++++++- src/runtime/mips-linux-os.c | 13 +++++++++++-- version.lisp-expr | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index c08fbb8..59bd7fb 100644 --- a/NEWS +++ b/NEWS @@ -1251,6 +1251,10 @@ changes in sbcl-0.7.7 relative to sbcl-0.7.6: bug fix involving the names of PCL MAKE-INSTANCE functions) changes in sbcl-0.7.8 relative to sbcl-0.7.7: + * A beta-quality port to the mips architecture running Linux, + based on the old CMUCL backend, has been made. It has been tested + on a big-endian kernel, and works sufficiently well to be able to + rebuild itself; it has not been tested in little-endian mode. * fixed bug 120a: The compiler now deals correctly with IFs where the consequent is the same as the alternative, instead of misderiving the return type. (thanks to Alexey Dejneka) diff --git a/src/runtime/mips-arch.c b/src/runtime/mips-arch.c index a65a381..7b68e65 100644 --- a/src/runtime/mips-arch.c +++ b/src/runtime/mips-arch.c @@ -106,10 +106,18 @@ emulate_branch(os_context_t *context, unsigned long inst) void arch_skip_instruction(os_context_t *context) { /* Skip the offending instruction */ - if (os_context_bd_cause(context)) + if (os_context_bd_cause(context)) { + /* Currently, we never get here, because Linux' support for + bd_cause seems not terribly solid (c.f os_context_bd_cause + in mips-linux-os.c). If a port to Irix comes along, this + code will be executed, because presumably Irix' support is + better (it can hardly be worse). We lose() to remind the + porter to review this code. -- CSR, 2002-09-06 */ + lose("bd_cause branch taken; review code for new OS?\n"); *os_context_pc_addr(context) = emulate_branch(context, *(unsigned long *) *os_context_pc_addr(context)); + } else *os_context_pc_addr(context) += 4; diff --git a/src/runtime/mips-linux-os.c b/src/runtime/mips-linux-os.c index f92a232..e9d9803 100644 --- a/src/runtime/mips-linux-os.c +++ b/src/runtime/mips-linux-os.c @@ -83,8 +83,17 @@ os_context_bd_cause(os_context_t *context) { /* We need to see if whatever happened, happened because of a branch delay event */ - return (((struct sigcontext *) &(context->uc_mcontext))->sc_cause - & CAUSEF_BD); + /* FIXME: However, I'm not convinced that the values that Linux + puts in this slot are actually right; specifically, attempting + to compile sbcl with sbcl-0.7.7.7 lead to an "infinite SIGTRAP + loop" where a (BREAK 16) not in a branch delay slot would have + CAUSEF_BD filled. So, we comment + + return (((struct sigcontext *) &(context->uc_mcontext))->sc_cause + & CAUSEF_BD); + + out and return 0 always. -- CSR, 2002-09-02 */ + return 0; } void diff --git a/version.lisp-expr b/version.lisp-expr index b10b5b7..fdd0192 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.7.16" +"0.7.7.17" -- 1.7.10.4