[cmucl-cvs] CMUCL commit: cross-sol-x86-branch src/lisp (solaris-os.c)

Raymond Toy rtoy at common-lisp.net
Mon Dec 20 15:12:26 UTC 2010


    Date: Monday, December 20, 2010 @ 10:12:26
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/lisp
     Tag: cross-sol-x86-branch

Modified: solaris-os.c

Add implementation of os_sigcontext_fpu_reg.  Tested to work with
SSE2.  X87 not yet tested.


--------------+
 solaris-os.c |   34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)


Index: src/lisp/solaris-os.c
diff -u src/lisp/solaris-os.c:1.26.4.4 src/lisp/solaris-os.c:1.26.4.5
--- src/lisp/solaris-os.c:1.26.4.4	Sun Dec 19 23:17:28 2010
+++ src/lisp/solaris-os.c	Mon Dec 20 10:12:26 2010
@@ -1,5 +1,5 @@
 /*
- * $Header: /project/cmucl/cvsroot/src/lisp/solaris-os.c,v 1.26.4.4 2010-12-20 04:17:28 rtoy Exp $
+ * $Header: /project/cmucl/cvsroot/src/lisp/solaris-os.c,v 1.26.4.5 2010-12-20 15:12:26 rtoy Exp $
  *
  * OS-dependent routines.  This file (along with os.h) exports an
  * OS-independent interface to the operating system VM facilities.
@@ -541,6 +541,38 @@
     return (unsigned long *) &scp->uc_mcontext.gregs[EIP];
 }
 
+
+unsigned char *
+os_sigcontext_fpu_reg(ucontext_t *scp, int offset)
+{
+    fpregset_t *fpregs = &scp->uc_mcontext.fpregs;
+    unsigned char *reg = NULL;
+
+    if (offset < 8) {
+        unsigned char *fpustate;
+        unsigned char *stregs;
+
+        /*
+         * Not sure this is right.  There is no structure defined for
+         * the x87 fpu state in /usr/include/sys/regset.h
+         */
+        
+        /* Point to the fpchip_state */
+        fpustate = (unsigned char*) &fpregs->fp_reg_set.fpchip_state.state[0];
+        /* Skip to where the x87 fp registers are */
+        stregs = fpustate + 24;
+    
+        reg = stregs + 16*offset;
+    }
+#ifdef FEATURE_SSE2
+    else {
+        reg = &fpregs->fp_reg_set.fpchip_state.xmm[offset - 8];
+    }
+#endif
+
+    return reg;
+}
+
 unsigned int
 os_sigcontext_fpu_modes(ucontext_t *scp)
 {




More information about the cmucl-cvs mailing list