summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-07-25 13:16:09 +0000
committercracauer <cracauer@FreeBSD.org>1999-07-25 13:16:09 +0000
commit36a7b829a04919c4ca14a6e4fe1bf3797c135a82 (patch)
tree8748ed38e03651976646062add8e82dac5601f42 /sys/kern/subr_trap.c
parent1c17b991d77a8dc353f1efc23d293b80176cb18b (diff)
downloadFreeBSD-src-36a7b829a04919c4ca14a6e4fe1bf3797c135a82.zip
FreeBSD-src-36a7b829a04919c4ca14a6e4fe1bf3797c135a82.tar.gz
On FPU exceptions, pass a useful error code (one of the FPE_...
macros) to the signal handler, for old-style BSD signal handlers as the second (int) argument, for SA_SIGINFO signal handlers as siginfo_t->si_code. This is source-compatible with Solaris, except that we have no <siginfo.h> (which isn't even mentioned in POSIX 1003.1b). An rather complete example program is at http://www3.cons.org/cracauer/freebsd-signal.c This will be added to the regression tests in src/. This commit also adds code to disable the (hardware) FPU from userconfig, so that you can use a software FP emulator on a machine that has hardware floating point. See LINT.
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 1d9d216..e717563 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.138 1999/06/01 18:19:47 jlemon Exp $
+ * $Id: trap.c,v 1.139 1999/06/18 14:32:16 bde Exp $
*/
/*
@@ -360,7 +360,7 @@ restart:
break;
case T_DIVIDE: /* integer divide fault */
- ucode = FPE_INTDIV_TRAP;
+ ucode = FPE_INTDIV;
i = SIGFPE;
break;
@@ -382,12 +382,12 @@ restart:
#endif /* NISA > 0 */
case T_OFLOW: /* integer overflow fault */
- ucode = FPE_INTOVF_TRAP;
+ ucode = FPE_INTOVF;
i = SIGFPE;
break;
case T_BOUND: /* bounds check fault */
- ucode = FPE_SUBRNG_TRAP;
+ ucode = FPE_FLTSUB;
i = SIGFPE;
break;
OpenPOWER on IntegriCloud