head	1.4;
access;
symbols
	RELEASE_6_2_0:1.3
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2;
locks; strict;
comment	@# @;


1.4
date	2006.12.02.00.20.41;	author miwi;	state dead;
branches;
next	1.3;

1.3
date	2006.06.28.21.52.29;	author itetcu;	state Exp;
branches;
next	1.2;

1.2
date	2006.01.28.15.52.14;	author pav;	state Exp;
branches;
next	1.1;

1.1
date	2005.10.08.18.21.19;	author pav;	state Exp;
branches;
next	;


desc
@@


1.4
log
@- Update to 1.0

Submitted by:   NIIMI Satoshi <sa2c@@sa2c.net> (maintainer)
@
text
@Index: src/code/float-trap.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/float-trap.lisp,v
retrieving revision 1.19
diff -u -r1.19 float-trap.lisp
--- src/code/float-trap.lisp	6 Oct 2005 19:43:00 -0000	1.19
+++ src/code/float-trap.lisp	28 Jun 2006 10:34:15 -0000
@@@@ -153,10 +153,28 @@@@
   `(not (zerop (logand ,(dpb (float-trap-mask traps) float-traps-byte 0)
                        (floating-point-modes)))))
 
+;;; SIGFPE code to floating-point error
+#+freebsd
+(defparameter *sigfpe-code-error-alist*
+  (list (cons sb!unix::fpe-intovf 'floating-point-overflow)
+        (cons sb!unix::fpe-intdiv 'division-by-zero)
+        (cons sb!unix::fpe-fltdiv 'division-by-zero)
+        (cons sb!unix::fpe-fltovf 'floating-point-overflow)
+        (cons sb!unix::fpe-fltund 'floating-point-underflow)
+        (cons sb!unix::fpe-fltres 'floating-point-inexact)
+        (cons sb!unix::fpe-fltinv 'floating-point-invalid-operation)
+        (cons sb!unix::fpe-fltsub 'floating-point-exception)))
+
 ;;; Signal the appropriate condition when we get a floating-point error.
 (defun sigfpe-handler (signal info context)
-  (declare (ignore signal info))
+  (declare (ignore signal #!-freebsd info))
+  #!+freebsd
+  (declare (type system-area-pointer info))
   (declare (type system-area-pointer context))
+  #!+freebsd
+  (let ((code (sb!unix::siginfo-code info)))
+    (error (or (cdr (assoc code *sigfpe-code-error-alist*))
+               'floating-point-exception)))
   (let* ((modes (context-floating-point-modes
                  (sb!alien:sap-alien context (* os-context-t))))
          (traps (logand (ldb float-exceptions-byte modes)
Index: src/code/target-signal.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/target-signal.lisp,v
retrieving revision 1.34
diff -u -r1.34 target-signal.lisp
--- src/code/target-signal.lisp	10 Apr 2006 16:08:45 -0000	1.34
+++ src/code/target-signal.lisp	28 Jun 2006 10:34:15 -0000
@@@@ -163,6 +163,10 @@@@
 
 ;;;; etc.
 
+;;; extract si_code from siginfo_t
+(sb!alien:define-alien-routine ("siginfo_code" siginfo-code) sb!alien:int
+  (info system-area-pointer))
+
 ;;; CMU CL comment:
 ;;;   Magically converted by the compiler into a break instruction.
 (defun receive-pending-interrupt ()
Index: src/runtime/interrupt.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/interrupt.c,v
retrieving revision 1.113
diff -u -r1.113 interrupt.c
--- src/runtime/interrupt.c	7 Jun 2006 16:25:10 -0000	1.113
+++ src/runtime/interrupt.c	28 Jun 2006 10:34:15 -0000
@@@@ -1376,3 +1376,9 @@@@
     SHOW("returning from interrupt_init()");
 #endif
 }
+
+int
+siginfo_code(siginfo_t *info)
+{
+    return info->si_code;
+}
Index: tools-for-build/grovel-headers.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tools-for-build/grovel-headers.c,v
retrieving revision 1.15
diff -u -r1.15 grovel-headers.c
--- tools-for-build/grovel-headers.c	18 Jun 2006 23:47:58 -0000	1.15
+++ tools-for-build/grovel-headers.c	28 Jun 2006 10:34:15 -0000
@@@@ -338,6 +338,16 @@@@
     defsignal("sigxcpu", SIGXCPU);
     defsignal("sigxfsz", SIGXFSZ);
 #endif
+#ifdef __FreeBSD__
+    defconstant("fpe-intovf", FPE_INTOVF);
+    defconstant("fpe-intdiv", FPE_INTDIV);
+    defconstant("fpe-fltdiv", FPE_FLTDIV);
+    defconstant("fpe-fltovf", FPE_FLTOVF);
+    defconstant("fpe-fltund", FPE_FLTUND);
+    defconstant("fpe-fltres", FPE_FLTRES);
+    defconstant("fpe-fltinv", FPE_FLTINV);
+    defconstant("fpe-fltsub", FPE_FLTSUB);
+#endif
 #endif // _WIN32
     return 0;
 }
@


1.3
log
@Update lang/sbcl to 0.9.14.

PR:		ports/99582
Submitted by:	maintainer
@
text
@@


1.2
log
@- Update to 0.9.9

PR:		ports/92398
Submitted by:	NIIMI Satoshi <sa2c@@sa2c.net> (maintainer)
@
text
@d7 1
a7 1
+++ src/code/float-trap.lisp	26 Jan 2006 20:43:33 -0000
d41 5
a45 5
retrieving revision 1.33
diff -u -r1.33 target-signal.lisp
--- src/code/target-signal.lisp	17 Oct 2005 09:18:47 -0000	1.33
+++ src/code/target-signal.lisp	26 Jan 2006 20:43:33 -0000
@@@@ -164,6 +164,10 @@@@
d59 5
a63 41
retrieving revision 1.109
diff -u -r1.109 interrupt.c
--- src/runtime/interrupt.c	5 Jan 2006 14:13:14 -0000	1.109
+++ src/runtime/interrupt.c	26 Jan 2006 20:43:33 -0000
@@@@ -454,7 +454,7 @@@@
         check_interrupts_enabled_or_lose(context);
 #endif
 
-#ifdef LISP_FEATURE_LINUX
+#if defined(LISP_FEATURE_LINUX) || defined(__FreeBSD__)
     /* Under Linux on some architectures, we appear to have to restore
        the FPU control word from the context, as after the signal is
        delivered we appear to have a null FPU control word. */
@@@@ -644,7 +644,7 @@@@
     os_context_t *context = arch_os_get_context(&void_context);
     struct thread *thread=arch_os_get_current_thread();
     struct interrupt_data *data=thread->interrupt_data;
-#ifdef LISP_FEATURE_LINUX
+#if defined(LISP_FEATURE_LINUX) || defined(__FreeBSD__)
     os_restore_fp_control(context);
 #endif
     if(maybe_defer_handler(interrupt_handle_now,data,signal,info,context))
@@@@ -661,7 +661,7 @@@@
 {
     os_context_t *context = (os_context_t*)void_context;
 
-#ifdef LISP_FEATURE_LINUX
+#if defined(LISP_FEATURE_LINUX) || defined(__FreeBSD__)
     os_restore_fp_control(context);
 #endif
     check_blockables_blocked_or_lose();
@@@@ -679,7 +679,7 @@@@
     os_context_t *context = arch_os_get_context(&void_context);
     struct thread *thread=arch_os_get_current_thread();
     struct interrupt_data *data=thread->interrupt_data;
-#ifdef LISP_FEATURE_LINUX
+#if defined(LISP_FEATURE_LINUX) || defined(__FreeBSD__)
     os_restore_fp_control(context);
 #endif
     if(maybe_defer_handler(low_level_interrupt_handle_now,data,
@@@@ -1276,3 +1276,9 @@@@
a72 76
Index: src/runtime/x86-arch.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-arch.c,v
retrieving revision 1.36
diff -u -r1.36 x86-arch.c
--- src/runtime/x86-arch.c	3 Jan 2006 09:52:38 -0000	1.36
+++ src/runtime/x86-arch.c	26 Jan 2006 20:43:33 -0000
@@@@ -248,7 +248,7 @@@@
        single-stepping (as far as I can tell) this is somewhat moot,
        but it might be worth either moving this code up or deleting
        the single-stepping code entirely.  -- CSR, 2002-07-15 */
-#ifdef LISP_FEATURE_LINUX
+#if defined(LISP_FEATURE_LINUX) || defined(__FreeBSD__)
     os_restore_fp_control(context);
 #endif
 
Index: src/runtime/x86-bsd-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-bsd-os.c,v
retrieving revision 1.7
diff -u -r1.7 x86-bsd-os.c
--- src/runtime/x86-bsd-os.c	14 Jul 2005 15:41:21 -0000	1.7
+++ src/runtime/x86-bsd-os.c	26 Jan 2006 20:43:33 -0000
@@@@ -85,6 +85,52 @@@@
 #endif  /* __NetBSD__ */
 
 
+#ifdef __FreeBSD__
+#if __FreeBSD_version >= 500000
+/*
+ * FreeBSD 5.0 or later initializes FPU control word for signal
+ * handler.
+ */
+#include <machine/npx.h>
+
+static __inline__ void
+fldcw(unsigned short cw)
+{
+    __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
+}
+
+void
+os_restore_fp_control(os_context_t *context)
+{
+    union savefpu *addr;
+
+    addr = (union savefpu *)context->uc_mcontext.mc_fpstate;
+    switch (context->uc_mcontext.mc_fpformat) {
+    case _MC_FPFMT_387:
+        /* FPU state is saved by fnsave */
+        fldcw((unsigned short)addr->sv_87.sv_env.en_cw);
+        break;
+    case _MC_FPFMT_XMM:
+        /* FPU/SSE state is saved by fxsave */
+        fldcw(addr->sv_xmm.sv_env.en_cw);
+        break;
+    default:
+        /* No FPU state is saved. */
+        break;
+    }
+}
+#else /* __FreeBSD_version < 500000 */
+/*
+ * FreeBSD befoer 5.0 does not touch FPU control word for signal
+ * handler.
+ */
+void
+os_restore_fp_control(os_context_t *context)
+{
+    /* DO NOTHING */
+}
+#endif /* __FreeBSD_version */
+#endif /* __FreeBSD__ */
 
 /* FIXME: If this can be a no-op on BSD/x86, then it
  * deserves a more precise name.
d76 5
a80 5
retrieving revision 1.12
diff -u -r1.12 grovel-headers.c
--- tools-for-build/grovel-headers.c	16 Jan 2006 15:39:58 -0000	1.12
+++ tools-for-build/grovel-headers.c	26 Jan 2006 20:43:33 -0000
@@@@ -234,6 +234,16 @@@@
@


1.1
log
@- Update to 0.9.5

PR:		ports/87123
Submitted by:	Paul Ledbetter <aeacides@@gmail.com> (maintainer)
@
text
@d4 4
a7 4
retrieving revision 1.18
diff -u -r1.18 float-trap.lisp
--- src/code/float-trap.lisp	14 Jul 2005 16:30:34 -0000	1.18
+++ src/code/float-trap.lisp	27 Sep 2005 22:36:42 -0000
d41 6
a46 6
retrieving revision 1.28
diff -u -r1.28 target-signal.lisp
--- src/code/target-signal.lisp	4 Sep 2005 20:14:49 -0000	1.28
+++ src/code/target-signal.lisp	27 Sep 2005 22:36:42 -0000
@@@@ -149,6 +149,10 @@@@
 
d59 5
a63 6
retrieving revision 1.94
diff -u -r1.94 interrupt.c
--- src/runtime/interrupt.c	13 Sep 2005 12:28:41 -0000	1.94
+++ src/runtime/interrupt.c	27 Sep 2005 22:36:42 -0000
@@@@ -426,7 +426,7 @@@@
     if (sigismember(&deferrable_sigset,signal))
d65 1
d72 1
a72 1
@@@@ -606,7 +606,7 @@@@
d81 1
a81 1
@@@@ -623,7 +623,7 @@@@
d90 1
a90 1
@@@@ -641,7 +641,7 @@@@
d99 1
a99 2
@@@@ -1139,3 +1139,9 @@@@
 
d101 1
d112 5
a116 5
retrieving revision 1.32
diff -u -r1.32 x86-arch.c
--- src/runtime/x86-arch.c	27 Sep 2005 15:52:50 -0000	1.32
+++ src/runtime/x86-arch.c	27 Sep 2005 22:36:42 -0000
@@@@ -229,7 +229,7 @@@@
d131 1
a131 1
+++ src/runtime/x86-bsd-os.c	27 Sep 2005 22:36:42 -0000
d188 5
a192 5
retrieving revision 1.10
diff -u -r1.10 grovel-headers.c
--- tools-for-build/grovel-headers.c	14 Jul 2005 20:24:19 -0000	1.10
+++ tools-for-build/grovel-headers.c	27 Sep 2005 22:36:42 -0000
@@@@ -223,5 +223,15 @@@@
d206 1
@

