diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-30 21:26:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-30 21:26:20 +0000 |
commit | b222cad611d176c0b88ddbc610bd2a8d2b14d6c2 (patch) | |
tree | b45e00e016ea2522a465ad5003356a342fbe649a /sys | |
parent | eb5d0663b74366fdf3577bc7a3f7f6881e867933 (diff) |
When delivering SIGFOO, make sure the siginfo code is a FOO_xxx constant;
also deliver SIGILL/ILL_COPROC rather than SIGFPE/FPE_FLTINV for disabled
or missing floating point support.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mac68k/mac68k/trap.c | 16 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/trap.c | 11 | ||||
-rw-r--r-- | sys/arch/solbourne/solbourne/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/trap.c | 6 |
6 files changed, 13 insertions, 32 deletions
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index 327f028a023..4f8ae17d1de 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.49 2006/01/30 21:23:24 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.50 2006/01/30 21:26:17 miod Exp $ */ /* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */ /* @@ -365,24 +365,14 @@ copyfault: * User coprocessor violation */ case T_COPERR|T_USER: - typ = FPE_FLTINV; + typ = ILL_COPROC; ucode = 0; - i = SIGFPE; /* XXX What is a proper response here? */ + i = SIGILL; break; /* * 6888x exceptions */ case T_FPERR|T_USER: - /* - * We pass along the 68881 status register which locore - * stashed in code for us. Note that there is a - * possibility that the bit pattern of this register - * will conflict with one of the FPE_* codes defined - * in signal.h. Fortunately for us, the only such - * codes we use are all in the range 1-7 and the low - * 3 bits of the status register are defined as 0 so - * there is no clash. - */ typ = FPE_FLTRES; ucode = code; i = SIGFPE; diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index a9f12985b3d..2ebeab657b4 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.61 2005/12/17 07:31:26 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.62 2006/01/30 21:26:19 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -344,15 +344,6 @@ copyfault: break; case T_FPERR|T_USER: /* 68881 exceptions */ - /* - * We pass along the 68881 status register which locore stashed - * in code for us. Note that there is a possibility that the - * bit pattern of this register will conflict with one of the - * FPE_* codes defined in signal.h. Fortunately for us, the - * only such codes we use are all in the range 1-7 and the low - * 3 bits of the status register are defined as 0 so there is - * no clash. - */ typ = FPE_FLTRES; ucode = code; i = SIGFPE; diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index 53e5f20d8d0..9ea3d9eb6a1 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.5 2005/12/25 00:22:47 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.6 2006/01/30 21:26:19 miod Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -527,7 +527,7 @@ badtrap: case T_CPDISABLED: uprintf("coprocessor instruction\n"); /* XXX */ - trapsignal(p, SIGILL, 0, FPE_FLTINV, sv); + trapsignal(p, SIGILL, 0, ILL_COPROC, sv); break; case T_BREAKPOINT: diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 47d8649cd12..80ea6b1f571 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.46 2005/12/25 00:22:47 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.47 2006/01/30 21:26:19 miod Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -520,7 +520,7 @@ badtrap: case T_CPDISABLED: uprintf("coprocessor instruction\n"); /* XXX */ - trapsignal(p, SIGILL, 0, FPE_FLTINV, sv); + trapsignal(p, SIGILL, 0, ILL_COPROC, sv); break; case T_BREAKPOINT: diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 062f2523385..b16e3c4b5dc 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.38 2005/12/30 21:14:16 millert Exp $ */ +/* $OpenBSD: trap.c,v 1.39 2006/01/30 21:26:19 miod Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -578,7 +578,7 @@ badtrap: * Since All UltraSPARC CPUs have an FPU how can this happen? */ if (!foundfpu) { - trapsignal(p, SIGFPE, 0, FPE_FLTINV, sv); + trapsignal(p, SIGILL, 0, ILL_COPROC, sv); break; } diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 9774a6b33ad..2f164d1c27c 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.33 2005/12/23 19:49:00 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.34 2006/01/30 21:26:19 miod Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -298,13 +298,13 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n", break; case T_XFCFLT|T_USER: - typ = ILL_ILLOPC; /* XXX hmm */ + typ = EMT_TAGOVF; sig = SIGEMT; break; case T_ARITHFLT|T_USER: sv.sival_int = frame->code; - typ = 0; /* XXX */ + typ = FPE_FLTINV; sig = SIGFPE; break; |