Begin to fix floating point exceptions on PPC
... write an os_context_fp_control function
... use it in CONTEXT-FLOATING-POINT-MODES
(this, unlike on the SPARC and Alpha ports, doesn't fix all the
normal-user problems. After the first return from the Lisp
debugger on the PPC, the FLOATING-POINT-MODES are (almost)
cleared, which means that the second bad floating point
operation is not trapped).
;;; Given a signal context, return the floating point modes word in
;;; the same format as returned by FLOATING-POINT-MODES.
-(defun context-floating-point-modes (context)
- ;; FIXME: As of sbcl-0.6.7 and the big rewrite of signal handling
- ;; for POSIXness and (at the Lisp level) opaque signal contexts,
- ;; this is needs to be rewritten as an alien function.
- (warn "stub CONTEXT-FLOATING-POINT-MODES")
- 0)
-
+(define-alien-routine ("os_context_fp_control" context-floating-point-modes)
+ (sb!alien:unsigned 32)
+ (context (* os-context-t)))
\f
;;;; INTERNAL-ERROR-ARGS.
return &context->uc_sigmask;
}
+unsigned long
+os_context_fp_control(os_context_t *context)
+{
+ /* So this may look like nice, well behaved code. However, closer
+ inspection reveals that gpr is simply the general purpose
+ registers, and PT_FPSCR is an offset that is larger than 32
+ (the number of ppc registers), but that happens to get the
+ right answer. -- CSR, 2002-07-11 */
+ return &((context->uc_mcontext.regs)->gpr[PT_FPSCR]);
+}
+
void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
{
/* see ppc-arch.c */
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.5.9"
+"0.7.5.10"