diff --git a/code/debug-int.lisp b/code/debug-int.lisp
index c4423a75d9d4f38cd908e21b1e95dcbc3b896fba..ae42d2667b611b3c3b3c687a1b02dd6917fd1b11 100644
--- a/code/debug-int.lisp
+++ b/code/debug-int.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug-int.lisp,v 1.132 2007/12/18 00:08:04 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug-int.lisp,v 1.133 2008/01/03 11:41:51 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1426,14 +1426,14 @@ The result is a symbol or nil if the routine cannot be found."
 	;; This seems to gone now, but we leave this in for now to
 	;; catch this condition.  If this doesn't happen anymore, we
 	;; can remove this later.
-	#+darwin
+	#+ignore
 	(when (zerop (sys:sap-int (alien:alien-sap (alien:slot scp 'vm::sc-mcontext))))
 	  (cerror "Continue."
 		  "NULL mcontext found at index ~D, scp = ~S.  Please report this bug!"
 		  index
 		  (alien:alien-sap scp)))
 	(when (and
-	       #+darwin
+	       #+ignore
 	       (not
 		(zerop (sys:sap-int (alien:alien-sap (alien:slot scp 'vm::sc-mcontext)))))
 	       (= (system:sap-int frame-pointer)
diff --git a/code/float-trap.lisp b/code/float-trap.lisp
index 7d1b5117a9543329238181cbd8b299963a3b2390..d40675fca3de854575f1545d69e409a1da1e266e 100644
--- a/code/float-trap.lisp
+++ b/code/float-trap.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/float-trap.lisp,v 1.31 2007/11/14 10:04:33 cshapiro Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/float-trap.lisp,v 1.32 2008/01/03 11:41:51 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -164,53 +164,6 @@
 ;;;
 ;;;    Signal the appropriate condition when we get a floating-point error.
 ;;;
-
-#+(and bsd (not freebsd))
-(define-condition floating-point-exception (arithmetic-error)
-  ((flags :initarg :traps
-	  :reader floating-point-exception-traps))
-  (:report (lambda (condition stream)
-	     (format stream "Arithmetic error ~S signalled.~%"
-		     (type-of condition))
-	     (let ((traps (floating-point-exception-traps condition)))
-	       (if traps
-		   (format stream
-			   "Trapping conditions are: ~%~{ ~s~^~}~%"
-			   traps)
-		   (write-line
-		    "No traps are enabled? How can this be?"
-		    stream))))))
-
-#+freebsd
-(progn
-(defconstant FPE_INTOVF	1)	; integer overflow
-(defconstant FPE_INTDIV	2)	; integer divide by zero
-(defconstant FPE_FLTDIV	3)	; floating point divide by zero
-(defconstant FPE_FLTOVF	4)	; floating point overflow
-(defconstant FPE_FLTUND	5)	; floating point underflow
-(defconstant FPE_FLTRES	6)	; floating point inexact result
-(defconstant FPE_FLTINV	7)	; invalid floating point operation
-(defconstant FPE_FLTSUB 8)	; subscript out of range
-)
-
-#+freebsd
-(defun sigfpe-handler (signal code scp)
-  (declare (ignore signal))
-  (let ((condition
-	 (ecase code
-	   ((#.FPE_INTDIV #.FPE_FLTDIV) 'division-by-zero)
-	   ((#.FPE_FLTINV #.FPE_FLTSUB) 'floating-point-invalid-operation)
-	   ((#.FPE_FLTOVF #.FPE_INTOVF) 'floating-point-overflow)
-	   (#.FPE_FLTUND 'floating-point-underflow)
-	   (#.FPE_FLTRES 'floating-point-inexact)))
-	fop operands
-	(sym (find-symbol "GET-FP-OPERANDS" "VM")))
-    (when (and sym (fboundp sym))
-      (multiple-value-setq (fop operands)
-	(funcall sym (alien:sap-alien scp (* unix:sigcontext)))))
-    (error condition :operation fop :operands operands)))
-
-#-freebsd
 (defun sigfpe-handler (signal code scp)
   (declare (ignore signal code)
 	   (type system-area-pointer scp))
@@ -260,11 +213,6 @@
 	     (error 'floating-point-inexact
 		    :operation fop
 		    :operands operands))
-	    #+BSD
-	    ((zerop (ldb float-exceptions-byte modes))
-	     ;; I can't tell what caused the exception!!
-	     (error 'floating-point-exception
-		    :traps (getf (get-floating-point-modes) :traps)))
 	    (t
 	     (error "SIGFPE with no exceptions currently enabled?"))))))
 
diff --git a/code/macros.lisp b/code/macros.lisp
index 45e9bfe2fc5f2d4ce1a31989d2aa9ad60849bef6..8a5fd8f979169824e41516cee706339527a46820 100644
--- a/code/macros.lisp
+++ b/code/macros.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.110 2007/08/08 12:56:26 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.111 2008/01/03 11:41:51 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1144,7 +1144,7 @@
 (defsetf sap-ref-sap %set-sap-ref-sap)
 (defsetf sap-ref-single %set-sap-ref-single)
 (defsetf sap-ref-double %set-sap-ref-double)
-#+long-float
+#+(or x86 long-float)
 (defsetf sap-ref-long %set-sap-ref-long)
 
 (define-setf-expander getf (place prop &optional default &environment env)
diff --git a/code/sap.lisp b/code/sap.lisp
index bd35e3f4bd0ffd83b8079401200af6a863305f6a..df735a266d15087ae8b00030c291875d3c3d88c2 100644
--- a/code/sap.lisp
+++ b/code/sap.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sap.lisp,v 1.18 2003/10/15 13:16:37 toy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sap.lisp,v 1.19 2008/01/03 11:41:52 cshapiro Rel $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -220,7 +220,7 @@
 	   (type double-float new-value))
   (setf (sap-ref-double sap offset) new-value))
 
-#+long-float
+#+(or x86 long-float)
 (defun %set-sap-ref-long (sap offset new-value)
   (declare (type system-area-pointer sap)
 	   (fixnum offset)
diff --git a/code/x86-vm.lisp b/code/x86-vm.lisp
index c2b33e4ccd2bbad2a34f6902bea11e7a7934c35b..6cbc861e97f881116bdaaabdb3bafc4deec360c4 100644
--- a/code/x86-vm.lisp
+++ b/code/x86-vm.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/x86-vm.lisp,v 1.28 2007/11/14 17:44:07 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/x86-vm.lisp,v 1.29 2008/01/03 11:41:52 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -31,188 +31,12 @@
 
 
 ;;;; The sigcontext structure.
-;;;; Add machine specific features to *features*
 
-(pushnew :x86 *features*)
+(def-alien-type sigcontext system-area-pointer)
 
-
+;;;; Add machine specific features to *features*
 
-#+linux
-(def-alien-type nil 
-  (struct fpreg
-          (significand (array unsigned-short 4))
-          (exponent unsigned-short)))
-#+linux
-(def-alien-type  nil
-   (struct fpstate
-        (cw  unsigned-long)
-        (sw  unsigned-long)
-        (tag  unsigned-long)
-        (ipoff  unsigned-long)
-        (cssel  unsigned-long)
-        (dataoff  unsigned-long)
-        (datasel unsigned-long)
-        (fpreg (array (struct fpreg) 8))
-        (status unsigned-long)))
-
-#+darwin
-(def-alien-type sigcontext-regs
-  (struct nil
-    (trapno unsigned-int)
-    (err unsigned-int)
-    (faultvaddr unsigned-int)
-    (eax unsigned-int)
-    (ebx unsigned-int)
-    (ecx unsigned-int)
-    (edx unsigned-int)
-    (edi unsigned-int)
-    (esi unsigned-int)
-    (ebp unsigned-int)
-    (esp unsigned-int)
-    (ss unsigned-int)
-    (eflags unsigned-int)
-    (eip unsigned-int)
-    (cs unsigned-int)
-    (ds unsigned-int)
-    (es unsigned-int)
-    (fs unsigned-int)
-    (gs unsigned-int)
-    (fpstate (array char 512))))
-
-#+darwin
-(def-alien-type sigcontext
-  (struct nil
-    (sc-onstack int)
-    (sc-sigmask unsigned-int)
-    (sc-stack (array unsigned-int 3))
-    (sc-link system-area-pointer)
-    (sc-mcsize unsigned-int)
-    (sc-mcontext (* sigcontext-regs))))
-
-;;; for FreeBSD
-#+freebsd
-(def-alien-type sigcontext-regs
-  (struct nil
-    (onstack unsigned-int)
-    (gs unsigned-int)
-    (fs unsigned-int)
-    (es unsigned-int)
-    (ds unsigned-int)
-    (edi unsigned-int)
-    (esi unsigned-int)
-    (ebp unsigned-int)
-    (isp unsigned-int)
-    (ebx unsigned-int)
-    (edx unsigned-int)
-    (ecx unsigned-int)
-    (eax unsigned-int)
-    (trapno unsigned-int)
-    (err unsigned-int)
-    (eip unsigned-int)
-    (cs	unsigned-int)
-    (eflags unsigned-int)
-    (esp unsigned-int)
-    (ss unsigned-int)))
-
-#+freebsd
-(def-alien-type sigcontext
-  (struct nil
-    (sc-sigmask (array unsigned-int 4))
-    (sc-mcontext sigcontext-regs)))
-
-;;; OpenBSD also have sigcontext structs that look more like Linux.
-#+openbsd
-(def-alien-type sigcontext
-    (struct nil
-	(sc-gs      unsigned-int)
-	(sc-fs      unsigned-int)
-	(sc-es	    unsigned-int)
-	(sc-ds	    unsigned-int)
-	(sc-edi	    unsigned-int)
-	(sc-esi	    unsigned-int)
-	(sc-fp	    unsigned-int) ;; ebp
-	(sc-ebx	    unsigned-int)
-	(sc-edx	    unsigned-int)
-	(sc-ecx	    unsigned-int)
-	(sc-eax	    unsigned-int)
-	(sc-pc      unsigned-int)
-	(sc-cs	    unsigned-int)
-	(sc-efl     unsigned-int)		; sc_ps
-	(sc-sp      unsigned-int)	
-	(sc-ss	    unsigned-int)
-	(sc-onstack unsigned-int)
-	(sc-mask    unsigned-int)
-	(sc-trapno  unsigned-int)
-	(sc-err     unsigned-int)
-	))
-
-;; NetBSD
-#+netbsd
-(def-alien-type sigcontext-regs
-  (struct nil
-    (gs unsigned-long)
-    (fs unsigned-long)
-    (es unsigned-long)
-    (ds unsigned-long)
-    (edi unsigned-long)
-    (esi unsigned-long)
-    (ebp unsigned-long)
-    (esp unsigned-long)
-    (ebx unsigned-long)
-    (edx unsigned-long)
-    (ecx unsigned-long)
-    (eax unsigned-long)
-    (trapno unsigned-long)
-    (err unsigned-long)
-    (eip unsigned-long)
-    (cs unsigned-long)
-    (efl unsigned-long)
-    (uesp unsigned-long)
-    (ss unsigned-long)))
-
-#+netbsd
-(def-alien-type sigcontext
-  (struct nil
-    (sc-flags unsigned-long)
-    (sc-link system-area-pointer)
-    (sc-sigmask (array unsigned-long 4))
-    (sc-stack (array unsigned-long 3))
-    (sc-mcontext sigcontext-regs)))
-
-;; For Linux...
-#+linux
-(def-alien-type sigcontext-regs
-  (struct nil
-    (gs unsigned-long)
-    (fs unsigned-long)
-    (es unsigned-long)
-    (ds unsigned-long)
-    (edi unsigned-long)
-    (esi unsigned-long)
-    (ebp unsigned-long)
-    (esp unsigned-long)
-    (ebx unsigned-long)
-    (edx unsigned-long)
-    (ecx unsigned-long)
-    (eax unsigned-long)
-    (trapno unsigned-long)
-    (err unsigned-long)
-    (eip unsigned-long)
-    (cs unsigned-long)
-    (eflags unsigned-long)
-    (esp_at_signal unsigned-long)
-    (ss unsigned-long)
-    (fpstate (* (struct fpstate)))
-    (oldmask unsigned-long)
-    (cr2 unsigned-long)))
-
-#+linux
-(def-alien-type sigcontext
-  (struct nil
-    (sc-flags unsigned-long)
-    (sc-link system-area-pointer)
-    (sc-stack (array unsigned-long 3))
-    (sc-mcontext sigcontext-regs)))
+(pushnew :x86 *features*)
 
 
 ;;;; MACHINE-TYPE and MACHINE-VERSION
@@ -380,8 +204,10 @@
 ;;;
 (defun sigcontext-program-counter (scp)
   (declare (type (alien (* sigcontext)) scp))
-  (with-alien ((scp (* sigcontext) scp))
-    (int-sap (slot (slot scp 'sc-mcontext) 'eip))))
+  (let ((fn (extern-alien "os_sigcontext_pc"
+			  (function system-area-pointer
+				    (* sigcontext)))))
+    (sap-ref-sap (alien-funcall fn scp) 0)))
 
 ;;; SIGCONTEXT-REGISTER -- Interface.
 ;;;
@@ -390,30 +216,19 @@
 ;;;
 (defun sigcontext-register (scp index)
   (declare (type (alien (* sigcontext)) scp))
-  (with-alien ((scp (* sigcontext) scp))
-    (case index
-      (#.eax-offset (slot (slot scp 'sc-mcontext) 'eax))
-      (#.ecx-offset (slot (slot scp 'sc-mcontext) 'ecx))
-      (#.edx-offset (slot (slot scp 'sc-mcontext) 'edx))
-      (#.ebx-offset (slot (slot scp 'sc-mcontext) 'ebx))
-      (#.esp-offset (slot (slot scp 'sc-mcontext) 'esp))
-      (#.ebp-offset (slot (slot scp 'sc-mcontext) 'ebp))
-      (#.esi-offset (slot (slot scp 'sc-mcontext) 'esi))
-      (#.edi-offset (slot (slot scp 'sc-mcontext) 'edi)))))
+  (let ((fn (extern-alien "os_sigcontext_reg"
+			  (function system-area-pointer
+				    (* sigcontext)
+				    (integer 32)))))
+    (sap-ref-32 (alien-funcall fn scp index) 0)))
 
 (defun %set-sigcontext-register (scp index new)
   (declare (type (alien (* sigcontext)) scp))
-  (with-alien ((scp (* sigcontext) scp))
-    (case index
-      (#.eax-offset (setf (slot (slot scp 'sc-mcontext) 'eax) new))
-      (#.ecx-offset (setf (slot (slot scp 'sc-mcontext) 'ecx) new))
-      (#.edx-offset (setf (slot (slot scp 'sc-mcontext) 'edx) new))
-      (#.ebx-offset (setf (slot (slot scp 'sc-mcontext) 'ebx) new))
-      (#.esp-offset (setf (slot (slot scp 'sc-mcontext) 'esp) new))
-      (#.ebp-offset (setf (slot (slot scp 'sc-mcontext) 'ebp) new))
-      (#.esi-offset (setf (slot (slot scp 'sc-mcontext) 'esi) new))
-      (#.edi-offset (setf (slot (slot scp 'sc-mcontext) 'edi) new))))
-  new)
+  (let ((fn (extern-alien "os_sigcontext_reg"
+			  (function system-area-pointer
+				    (* sigcontext)
+				    (integer 32)))))
+    (setf (sap-ref-32 (alien-funcall fn scp index) 0) new)))
 
 (defsetf sigcontext-register %set-sigcontext-register)
 
@@ -423,40 +238,23 @@
 ;;; Like SIGCONTEXT-REGISTER, but returns the value of a float register.
 ;;; Format is the type of float to return.
 ;;;
-#+linux
 (defun sigcontext-float-register (scp index format)
   (declare (type (alien (* sigcontext)) scp))
-  (with-alien ((scp (* sigcontext) scp))
-    (let ((reg-sap (alien-sap (deref (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0)
-					   'fpreg)
-				     index))))
-      (coerce (sys:sap-ref-long reg-sap 0) format))))
-
-;;; Not supported on Free/OpenBSD because the floating point state is not
-;;; saved.  For now we assume this is true for all modern BSDs
-#+BSD
-(defun sigcontext-float-register (scp index format)
-  (declare (ignore scp index))
-  (coerce 0l0 format))
-
-#+linux
-(defun %set-sigcontext-float-register (scp index format new-value)
+  (let ((fn (extern-alien "os_sigcontext_fpu_reg"
+			  (function system-area-pointer
+				    (* sigcontext)
+				    (integer 32)))))
+    (coerce (sap-ref-long (alien-funcall fn scp index) 0) format)))
+;;;
+(defun %set-sigcontext-float-register (scp index format new)
   (declare (type (alien (* sigcontext)) scp))
-  (with-alien ((scp (* sigcontext) scp))
-    (let ((reg-sap (alien-sap (deref (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0)
-					    'fpreg)
-				     index))))
-      (declare (ignorable reg-sap))
-      #+not-yet
-      (setf (sys:sap-ref-long reg-sap 0) (coerce new-value 'long-float))
-      (coerce new-value format))))
-
-;;; Not supported on Free/OpenBSD.
-#+BSD
-(defun %set-sigcontext-float-register (scp index format new-value)
-  (declare (ignore scp index))
-  (coerce new-value format))
-
+  (let ((fn (extern-alien "os_sigcontext_fpu_reg"
+			  (function system-area-pointer
+				    (* sigcontext)
+				    (integer 32)))))
+    (let* ((sap (alien-funcall fn scp index))
+	   (result (setf (sap-ref-long sap 0) (coerce new 'long-float))))
+      (coerce result format))))
 ;;;
 (defsetf sigcontext-float-register %set-sigcontext-float-register)
 
@@ -465,25 +263,12 @@
 ;;;    Given a sigcontext pointer, return the floating point modes word in the
 ;;; same format as returned by FLOATING-POINT-MODES.
 ;;;
-
-#+bsd
-(defun sigcontext-floating-point-modes (scp)
-  (declare (type (alien (* sigcontext)) scp)
-	   (ignore scp))
-  ;; This is broken until some future release of FreeBSD/OpenBSD!!!
-  (floating-point-modes))
-  
-#+linux
 (defun sigcontext-floating-point-modes (scp)
   (declare (type (alien (* sigcontext)) scp))
-  (let ((cw (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0) 'cw))
-	(sw (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0) 'sw)))
-    ;;(format t "cw = ~4x~%sw = ~4x~%" cw sw)
-    ;; NOT TESTED -- clear sticky bits to clear interrupt condition
-    (setf (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0) 'sw) (logandc2 sw #x3f))
-    ;;(format t "new sw = ~x~%" (slot (deref (slot (slot scp 'sc-mcontext) 'fpstate) 0) 'sw))
-    ;; simulate floating-point-modes VOP
-    (logior (ash (logand sw #xffff) 16) (logxor (logand cw #xffff) #x3f))))
+  (let ((fn (extern-alien "os_sigcontext_fpu_modes"
+			  (function (integer 32)
+				    (* sigcontext)))))
+    (alien-funcall fn scp)))
 
 
 ;;; EXTERN-ALIEN-NAME -- interface.
diff --git a/compiler/saptran.lisp b/compiler/saptran.lisp
index 4f122122b89d2f89fd740dbf2ab174b0db11fd94..edf3a9f4686a51989db3ce7776fe249dd28804e1 100644
--- a/compiler/saptran.lisp
+++ b/compiler/saptran.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/saptran.lisp,v 1.17 2004/05/24 22:52:35 cwang Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/saptran.lisp,v 1.18 2008/01/03 11:41:52 cshapiro Rel $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -151,7 +151,7 @@
 (defknown %set-sap-ref-double
 	  (system-area-pointer fixnum double-float) double-float
   ())
-#+long-float
+#+(or x86 long-float)
 (defknown %set-sap-ref-long
 	  (system-area-pointer fixnum long-float) long-float
   ())
diff --git a/compiler/x86/float.lisp b/compiler/x86/float.lisp
index 72a629557c77fb0bef30aafbffda5382e8c7cb1b..4e7513842355d50e2a650ab756dd346200a72ea0 100644
--- a/compiler/x86/float.lisp
+++ b/compiler/x86/float.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float.lisp,v 1.52 2007/11/15 22:48:04 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float.lisp,v 1.53 2008/01/03 11:41:52 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -161,7 +161,6 @@
 ;;; The x86 can't store a long-float to memory without popping the
 ;;; stack and marking a register as empty, so it is necessary to
 ;;; restore the register from memory.
-#+long-float
 (defun store-long-float (ea)
    (inst fstpl ea)
    (inst fldl ea))
diff --git a/compiler/x86/sap.lisp b/compiler/x86/sap.lisp
index 1dd7933629d1d4568d3bf7bd8c6e90329d5ea703..f0af32dc3e041b56fa8d83b1133a42701ffef54d 100644
--- a/compiler/x86/sap.lisp
+++ b/compiler/x86/sap.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
- "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/sap.lisp,v 1.9 1999/09/15 15:13:31 dtc Exp $")
+ "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/sap.lisp,v 1.10 2008/01/03 11:41:52 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -467,16 +467,16 @@
      (with-empty-tn@fp-top(result)
         (inst fldl (make-ea :dword :base sap :disp offset)))))
 
-#+long-float
 (define-vop (%set-sap-ref-long)
   (:translate %set-sap-ref-long)
   (:policy :fast-safe)
   (:args (sap :scs (sap-reg) :to (:eval 0))
 	 (offset :scs (signed-reg) :to (:eval 0))
-	 (value :scs (long-reg)))
-  (:arg-types system-area-pointer signed-num long-float)
-  (:results (result :scs (long-reg)))
-  (:result-types long-float)
+	 (value :scs (#+long-float long-reg #-long-float double-reg)))
+  (:arg-types system-area-pointer signed-num #+long-float long-float 
+					     #-long-float double-float)
+  (:results (result :scs (#+long-float long-reg #-long-float double-reg)))
+  (:result-types #+long-float long-float #-long-float double-float)
   (:generator 5
     (cond ((zerop (tn-offset value))
 	   ;; Value is in ST0
diff --git a/lisp/Darwin-os.c b/lisp/Darwin-os.c
index 061239c96ac02c07241bedf80ccbc5d76d46f608..66ec9a42cca12eb505863a94fcf4f89bcfdc21d8 100644
--- a/lisp/Darwin-os.c
+++ b/lisp/Darwin-os.c
@@ -14,7 +14,7 @@
  * Frobbed for OpenBSD by Pierre R. Mai, 2001.
  * Frobbed for Darwin by Pierre R. Mai, 2003.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.13 2007/11/16 05:04:09 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.14 2008/01/03 11:41:53 cshapiro Exp $
  *
  */
 
@@ -23,6 +23,7 @@
 #include <sys/file.h>
 #include <errno.h>
 #include <dlfcn.h>
+#include <string.h>
 #include "os.h"
 #include "arch.h"
 #include "globals.h"
@@ -197,29 +198,78 @@ sc_reg(os_context_t * context, int offset)
     return (int *) 0;
 }
 #elif defined(__i386__)
-int *
-sc_reg(os_context_t *context, int offset)
+unsigned long *
+os_sigcontext_reg(ucontext_t *scp, int index)
 {
-    switch (offset) {
-      case 0:
-	  return (int *) &context->uc_mcontext->__ss.__eax;
-      case 2:
-	  return (int *) &context->uc_mcontext->__ss.__ecx;
-      case 4:
-	  return (int *) &context->uc_mcontext->__ss.__edx;
-      case 6:
-	  return (int *) &context->uc_mcontext->__ss.__ebx;
-      case 8:
-	  return (int *) &context->uc_mcontext->__ss.__esp;
-      case 10:
-	  return (int *) &context->uc_mcontext->__ss.__ebp;
-      case 12:
-	  return (int *) &context->uc_mcontext->__ss.__esi;
-      case 14:
-	  return (int *) &context->uc_mcontext->__ss.__edi;
+    switch (index) {
+    case 0:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__eax;
+    case 2:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__ecx;
+    case 4:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__edx;
+    case 6:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__ebx;
+    case 8:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__esp;
+    case 10:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__ebp;
+    case 12:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__esi;
+    case 14:
+	return (unsigned long *) &scp->uc_mcontext->__ss.__edi;
     }
+    return NULL;
+}
 
-    return (int *) 0;
+unsigned long *
+os_sigcontext_pc(ucontext_t *scp)
+{
+    return (unsigned long *) &scp->uc_mcontext->__ss.__eip;
+}
+
+unsigned char *
+os_sigcontext_fpu_reg(ucontext_t *scp, int index)
+{
+    switch (index) {
+    case 0:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm0;
+    case 1:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm1;
+    case 2:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm2;
+    case 3:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm3;
+    case 4:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm4;
+    case 5:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm5;
+    case 6:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm6;
+    case 7:
+	return (unsigned char *) &scp->uc_mcontext->__fs.__fpu_stmm7;
+    }
+    return NULL;
+}
+
+unsigned long
+os_sigcontext_fpu_modes(ucontext_t *scp)
+{
+    unsigned long modes;
+    unsigned short cw, sw;
+    memcpy(&cw, &scp->uc_mcontext->__fs.__fpu_fcw, sizeof(cw));
+    memcpy(&sw, &scp->uc_mcontext->__fs.__fpu_fsw, sizeof(sw));
+    modes = (sw & 0xff) << 16 | cw;
+    modes ^= 0x3f;
+    return modes;
+}
+
+void
+restore_fpu(ucontext_t *scp)
+{
+    unsigned short cw;
+    memcpy(&cw, &scp->uc_mcontext->__fs.__fpu_fcw, sizeof(cw));
+    __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
 }
 #endif
 
diff --git a/lisp/Darwin-os.h b/lisp/Darwin-os.h
index 1c9fb272ddc34d44232c4256494757c1906d69fb..4f7613eb0daa13c73fff6f2031c702734adf6979 100644
--- a/lisp/Darwin-os.h
+++ b/lisp/Darwin-os.h
@@ -1,6 +1,6 @@
 /*
 
- $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.h,v 1.6 2007/07/15 06:53:34 cshapiro Exp $
+ $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.h,v 1.7 2008/01/03 11:41:54 cshapiro Rel $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -31,8 +31,12 @@ typedef int os_vm_prot_t;
 #define HANDLER_ARGS int signal, siginfo_t *code, os_context_t *context
 #define CODE(code)  ((code) ? code->si_code : 0)
 #define os_context_t ucontext_t
+#ifdef __i386__
+#define RESTORE_FPU(context) restore_fpu(context)
+#endif
 
 int *sc_reg(os_context_t *, int);
+void restore_fpu(ucontext_t *);
 
 #define PROTECTION_VIOLATION_SIGNAL SIGBUS
 
diff --git a/lisp/FreeBSD-os.c b/lisp/FreeBSD-os.c
index a3a0447134ca77340580ec6332a3b51db7943bd4..a41b732a5cb972987b71b39d0a0c16eccfa83cae 100644
--- a/lisp/FreeBSD-os.c
+++ b/lisp/FreeBSD-os.c
@@ -12,12 +12,13 @@
  * Much hacked by Paul Werkowski
  * GENCGC support by Douglas Crosher, 1996, 1997.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.21 2007/12/06 13:51:21 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.22 2008/01/03 11:41:54 cshapiro Exp $
  *
  */
 
 #include "os.h"
 #include <sys/file.h>
+#include <machine/npx.h>
 #include <errno.h>
 #include "arch.h"
 #include "globals.h"
@@ -44,29 +45,78 @@ os_init(void)
     os_vm_page_size = getpagesize();
 }
 
-int *
-sc_reg(ucontext_t *context, int offset)
-{
-    switch (offset) {
-      case 0:
-	  return &context->uc_mcontext.mc_eax;
-      case 2:
-	  return &context->uc_mcontext.mc_ecx;
-      case 4:
-	  return &context->uc_mcontext.mc_edx;
-      case 6:
-	  return &context->uc_mcontext.mc_ebx;
-      case 8:
-	  return &context->uc_mcontext.mc_esp;
-      case 10:
-	  return &context->uc_mcontext.mc_ebp;
-      case 12:
-	  return &context->uc_mcontext.mc_esi;
-      case 14:
-	  return &context->uc_mcontext.mc_edi;
+unsigned long *
+os_sigcontext_reg(ucontext_t *scp, int index)
+{
+    switch (index) {
+    case 0:
+	return (unsigned long *) &scp->uc_mcontext.mc_eax;
+    case 2:
+	return (unsigned long *) &scp->uc_mcontext.mc_ecx;
+    case 4:
+	return (unsigned long *) &scp->uc_mcontext.mc_edx;
+    case 6:
+	return (unsigned long *) &scp->uc_mcontext.mc_ebx;
+    case 8:
+	return (unsigned long *) &scp->uc_mcontext.mc_esp;
+    case 10:
+	return (unsigned long *) &scp->uc_mcontext.mc_ebp;
+    case 12:
+	return (unsigned long *) &scp->uc_mcontext.mc_esi;
+    case 14:
+	return (unsigned long *) &scp->uc_mcontext.mc_edi;
+    }
+    return NULL;
+}
+
+unsigned long *
+os_sigcontext_pc(ucontext_t *scp)
+{
+    return (unsigned long *) &scp->uc_mcontext.mc_eip;
+}
+
+unsigned char *
+os_sigcontext_fpu_reg(ucontext_t *scp, int index)
+{
+    union savefpu *sv = (union savefpu *) scp->uc_mcontext.mc_fpstate;
+    int fpformat = scp->uc_mcontext.mc_fpformat;
+    unsigned char *reg = NULL;
+
+    switch (fpformat) {
+    case _MC_FPFMT_XMM:
+	 reg = sv->sv_xmm.sv_fp[index].fp_acc.fp_bytes;
+	 break;
+    case _MC_FPFMT_387:
+	 reg = sv->sv_87.sv_ac[index].fp_bytes;
+	 break;
+    case _MC_FPFMT_NODEV:
+	 reg = NULL;
+	 break;
     }
+    return reg;
+}
 
-    return (int *) 0;
+unsigned long
+os_sigcontext_fpu_modes(ucontext_t *scp)
+{
+    union savefpu *sv = (union savefpu *) scp->uc_mcontext.mc_fpstate;
+    unsigned long modes;
+    int fpformat = scp->uc_mcontext.mc_fpformat;
+    unsigned short cw, sw;
+
+    if (fpformat == _MC_FPFMT_XMM) {
+	cw = sv->sv_xmm.sv_env.en_cw;
+	sw = sv->sv_xmm.sv_env.en_sw;
+    } else if (fpformat == _MC_FPFMT_387) {
+	cw = sv->sv_87.sv_env.en_cw & 0xffff;
+	sw = sv->sv_87.sv_env.en_sw & 0xffff;
+    } else {  /* _MC_FPFMT_NODEV */
+	cw = 0;
+	sw = 0x3f;
+    }
+    modes = (sw & 0xff) << 16 | cw;
+    modes ^= 0x3f;
+    return modes;
 }
 
 os_vm_address_t os_validate(os_vm_address_t addr, os_vm_size_t len)
@@ -183,11 +233,55 @@ sigbus_handler(int signal, siginfo_t *info, ucontext_t *context)
     interrupt_handle_now(signal, info, context);
 }
 
+/*
+ * Restore the exception flags cleared by the kernel.  These bits must
+ * be set for Lisp to determine which exception caused the signal.  At
+ * present, there is no way to distinguish underflow exceptions from
+ * denormalized operand exceptions.  An underflow exception is assumed
+ * if the subcode is FPE_FLTUND.
+ */
+static void
+sigfpe_handler(int signal, siginfo_t *info, ucontext_t *context)
+{
+     union savefpu *sv = (union savefpu *) context->uc_mcontext.mc_fpstate;
+     int fpformat = context->uc_mcontext.mc_fpformat;
+     int code = info->si_code;
+     unsigned char trap = 0;
+
+     switch (code) {
+     case FPE_FLTDIV:  /* ZE */
+	  trap = 0x04;
+	  break;
+     case FPE_FLTOVF:  /* OE */
+	  trap = 0x08;
+	  break;
+     case FPE_FLTUND:  /* DE or UE */
+	  trap = 0x10;
+	  break;
+     case FPE_FLTRES:  /* PE */
+	  trap = 0x20;
+	  break;
+     case FPE_FLTINV:  /* IE */
+	  trap = 0x01;
+	  break;
+     }
+     switch (fpformat) {
+     case _MC_FPFMT_XMM:
+	  sv->sv_xmm.sv_env.en_sw |= trap;
+	  break;
+     case _MC_FPFMT_387:
+	  sv->sv_87.sv_env.en_sw |= trap;
+	  break;
+     }
+     interrupt_handle_now(signal, info, context);
+}
+
 void
 os_install_interrupt_handlers(void)
 {
     interrupt_install_low_level_handler
 	(PROTECTION_VIOLATION_SIGNAL, sigbus_handler);
+    interrupt_install_low_level_handler(SIGFPE, sigfpe_handler);
 }
 
 void *
@@ -209,3 +303,20 @@ os_dlsym(const char *sym_name, lispobj lib_list)
 
     return dlsym(RTLD_DEFAULT, sym_name);
 }
+
+void
+restore_fpu(ucontext_t *scp)
+{
+    union savefpu *sv = (union savefpu *) scp->uc_mcontext.mc_fpstate;
+    int fpformat = scp->uc_mcontext.mc_fpformat;
+    unsigned short cw;
+
+    if (fpformat == _MC_FPFMT_XMM) {
+	cw = sv->sv_xmm.sv_env.en_cw;
+    } else if (fpformat == _MC_FPFMT_387) {
+	cw = sv->sv_87.sv_env.en_cw & 0xffff;
+    } else {  /* _MC_FPFMT_NODEV */
+	return;
+    }
+    __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
+}
diff --git a/lisp/FreeBSD-os.h b/lisp/FreeBSD-os.h
index 486d30fafe07260e6e21b62c0eba2b30ab26d11f..5a0aa94e8abd28c701f9afa3ad14cf9a63785f3f 100644
--- a/lisp/FreeBSD-os.h
+++ b/lisp/FreeBSD-os.h
@@ -1,6 +1,6 @@
 /*
 
- $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.20 2007/12/07 06:54:28 cshapiro Exp $
+ $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.21 2008/01/03 11:41:54 cshapiro Exp $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -36,8 +36,9 @@ typedef int os_vm_prot_t;
 
 #define HANDLER_ARGS int signal, siginfo_t *code, ucontext_t *context
 #define CODE(code)  ((code) ? code->si_code : 0)
+#define RESTORE_FPU(context) restore_fpu(context)
 
-int *sc_reg(ucontext_t *, int);
+void restore_fpu(ucontext_t *);
 
 #if __FreeBSD_version < 700004
 #define PROTECTION_VIOLATION_SIGNAL SIGBUS
diff --git a/lisp/Linux-os.c b/lisp/Linux-os.c
index 36e645d748c770ccdb8f05eb530a2d9823b0f658..19792b4d4778e406a1cdf3d12e1b2246056fe2a8 100644
--- a/lisp/Linux-os.c
+++ b/lisp/Linux-os.c
@@ -15,7 +15,7 @@
  * GENCGC support by Douglas Crosher, 1996, 1997.
  * Alpha support by Julian Dolby, 1999.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.36 2007/12/17 09:54:35 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.37 2008/01/03 11:41:54 cshapiro Exp $
  *
  */
 
@@ -71,29 +71,65 @@ os_init(void)
     os_vm_page_size = getpagesize();
 }
 
-#ifdef i386
-int *
-sc_reg(ucontext_t *context, int offset)
+#ifdef __i386
+unsigned long *
+os_sigcontext_reg(ucontext_t *scp, int offset)
 {
     switch (offset) {
-      case 0:
-	  return &context->uc_mcontext.gregs[REG_EAX];
-      case 2:
-	  return &context->uc_mcontext.gregs[REG_ECX];
-      case 4:
-	  return &context->uc_mcontext.gregs[REG_EDX];
-      case 6:
-	  return &context->uc_mcontext.gregs[REG_EBX];
-      case 8:
-	  return &context->uc_mcontext.gregs[REG_ESP];
-      case 10:
-	  return &context->uc_mcontext.gregs[REG_EBP];
-      case 12:
-	  return &context->uc_mcontext.gregs[REG_ESI];
-      case 14:
-	  return &context->uc_mcontext.gregs[REG_EDI];
+    case 0:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_EAX];
+    case 2:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_ECX];
+    case 4:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_EDX];
+    case 6:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_EBX];
+    case 8:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_ESP];
+    case 10:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_EBP];
+    case 12:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_ESI];
+    case 14:
+	return (unsigned long *) &scp->uc_mcontext.gregs[REG_EDI];
     }
-    return (int *) 0;
+    return NULL;
+}
+
+unsigned long *
+os_sigcontext_pc(ucontext_t *scp)
+{
+    return (unsigned long *) &scp->uc_mcontext.gregs[REG_EIP];
+}
+
+unsigned char *
+os_sigcontext_fpu_reg(ucontext_t *scp, int offset)
+{
+    fpregset_t fpregs = scp->uc_mcontext.fpregs;
+
+    if (fpregs == NULL) {
+	return NULL;
+    } else {
+	return (unsigned char *) &fpregs->_st[offset];
+    }
+}
+
+unsigned long
+os_sigcontext_fpu_modes(ucontext_t *scp)
+{
+    unsigned long modes;
+    unsigned short cw, sw;
+
+    if (scp->uc_mcontext.fpregs == NULL) {
+	cw = 0;
+	sw = 0x3f;
+    } else {
+	cw = scp->uc_mcontext.fpregs->cw & 0xffff;
+	sw = scp->uc_mcontext.fpregs->sw & 0xffff;
+    }
+    modes = (sw & 0xff) << 16 | cw;
+    modes ^= 0x3f;
+    return modes;
 }
 #endif
 
diff --git a/lisp/Linux-os.h b/lisp/Linux-os.h
index 6a7e5e8fbb11573c9b0567a7da062029b771329f..a6d5edfbaaed3e620ffa25c4512fc7785a657286 100644
--- a/lisp/Linux-os.h
+++ b/lisp/Linux-os.h
@@ -1,4 +1,4 @@
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.27 2007/12/14 12:19:58 cshapiro Exp $
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.28 2008/01/03 11:41:54 cshapiro Rel $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -42,7 +42,6 @@ typedef int os_vm_prot_t;	/* like hpux */
 #define OS_VM_DEFAULT_PAGESIZE	8192	/* like hpux */
 #endif
 
-int *sc_reg(ucontext_t *, int);
 void restore_fpu(ucontext_t *);
 
 #define HANDLER_ARGS int signal, siginfo_t *code, ucontext_t *context
diff --git a/lisp/os.h b/lisp/os.h
index 77650a4f1d19bd19c829d27dc8d3dfcf2a654389..cd4b444e7808195b32e0d158548ad7f404d3e789 100644
--- a/lisp/os.h
+++ b/lisp/os.h
@@ -1,5 +1,5 @@
 /*
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os.h,v 1.20 2007/12/14 12:19:59 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os.h,v 1.21 2008/01/03 11:41:54 cshapiro Exp $
  *
  * Common interface for os-dependent functions.
  *
@@ -108,4 +108,9 @@ extern int os_stack_grows_down(void);
 extern void os_guard_control_stack(int zone, int guard);
 extern int os_control_stack_overflow(void *, os_context_t *);
 
+unsigned long *os_sigcontext_reg(ucontext_t *, int);
+unsigned long *os_sigcontext_pc(ucontext_t *);
+unsigned char *os_sigcontext_fpu_reg(ucontext_t *, int);
+unsigned long os_sigcontext_fpu_modes(ucontext_t *);
+
 #endif /* _OS_H_ */
diff --git a/lisp/x86-lispregs.h b/lisp/x86-lispregs.h
index 15c32f48ce47c05e25320348b5ce56f2fafd5c83..09866b600b1b0b08609db2b855680e4e4961f8e4 100644
--- a/lisp/x86-lispregs.h
+++ b/lisp/x86-lispregs.h
@@ -1,5 +1,5 @@
 /* x86-lispregs.h -*- Mode: C; -*-
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-lispregs.h,v 1.11 2007/12/15 15:26:29 rtoy Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/x86-lispregs.h,v 1.12 2008/01/03 11:41:54 cshapiro Exp $
  */
 
 #ifndef _X86_LISPREGS_H_
@@ -44,21 +44,13 @@
  * xxx-os.c handle it.
  */
 
-#define SC_REG(sc, n) (*sc_reg(sc,n))
+#define SC_REG(scp, offset) (*os_sigcontext_reg(scp, offset))
+#define SC_PC(scp) (*os_sigcontext_pc(scp))
+#define SC_SP(scp) SC_REG(scp, reg_ESP)
 
-#if defined(__NetBSD__)
-#define SC_PC(uc) ((uc)->uc_mcontext.__gregs[_REG_EIP])
-#define SC_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_ESP])
-#elif defined(DARWIN)
-#define SC_PC(sc) ((sc)->uc_mcontext->__ss.__eip)
-#define SC_SP(sc) SC_REG(sc, reg_ESP)
+#if defined(DARWIN)
 #define SC_EFLAGS(sc) ((sc)->uc_mcontext->__ss.__eflags)
-#elif defined(__FreeBSD__)
-#define SC_PC(sc) ((sc)->uc_mcontext.mc_eip)
-#define SC_SP(sc) SC_REG(sc, reg_ESP)
 #elif defined(__linux__)
-#define SC_PC(sc) ((sc)->uc_mcontext.gregs[REG_EIP])
-#define SC_SP(sc) SC_REG(sc, reg_ESP)
 #define SC_EFLAGS(sc) ((sc)->uc_mcontext.gregs[REG_EFL])
 #endif