summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2006-05-14 21:58:06 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2006-05-14 21:58:06 +0000
commitbd27ebd11e2771222a4298a7f3e5107489e8a773 (patch)
tree9a3fc953840dbd4f759cbd356dc3e2b5612c12b7
parent3fcd9754f5ee6402bcdafb1b698feb149f1ec61b (diff)
Make the array of fpu exception types/codes big enough.
Fix a typo too, such that we actually read beyond element 0 in all cases. ok miod@
-rw-r--r--sys/arch/sparc/fpu/fpu.c14
-rw-r--r--sys/arch/sparc64/fpu/fpu.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/arch/sparc/fpu/fpu.c b/sys/arch/sparc/fpu/fpu.c
index c9989b399ed..59dd54e7a10 100644
--- a/sys/arch/sparc/fpu/fpu.c
+++ b/sys/arch/sparc/fpu/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.11 2003/06/02 23:27:54 millert Exp $ */
+/* $OpenBSD: fpu.c,v 1.12 2006/05/14 21:58:05 kettenis Exp $ */
/* $NetBSD: fpu.c,v 1.6 1997/07/29 10:09:51 fair Exp $ */
/*
@@ -87,11 +87,11 @@ static u_char fpu_codes[] = {
};
static int fpu_types[] = {
- FPE_FLTRES,
- FPE_FLTDIV,
- FPE_FLTUND,
- FPE_FLTOVF,
- FPE_FLTINV,
+ X1(FPE_FLTRES),
+ X2(FPE_FLTDIV),
+ X4(FPE_FLTUND),
+ X8(FPE_FLTOVF),
+ X16(FPE_FLTINV)
};
/*
@@ -128,7 +128,7 @@ fpu_cleanup(p, fs)
case FSR_TT_IEEE:
if ((i = fsr & FSR_CX) == 0)
panic("fpu ieee trap, but no exception");
- trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], sv);
+ trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - 1], sv);
break; /* XXX should return, but queue remains */
case FSR_TT_UNFIN:
diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c
index b5558333eb2..f328d48865d 100644
--- a/sys/arch/sparc64/fpu/fpu.c
+++ b/sys/arch/sparc64/fpu/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.10 2003/06/02 23:27:55 millert Exp $ */
+/* $OpenBSD: fpu.c,v 1.11 2006/05/14 21:58:05 kettenis Exp $ */
/* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */
/*
@@ -158,11 +158,11 @@ static u_char fpu_codes[] = {
};
static int fpu_types[] = {
- FPE_FLTRES,
- FPE_FLTDIV,
- FPE_FLTUND,
- FPE_FLTOVF,
- FPE_FLTINV,
+ X1(FPE_FLTRES),
+ X2(FPE_FLTDIV),
+ X4(FPE_FLTUND),
+ X8(FPE_FLTOVF),
+ X16(FPE_FLTINV)
};
void
@@ -218,7 +218,7 @@ fpu_cleanup(p, fs)
case FSR_TT_IEEE:
if ((i = fsr & FSR_CX) == 0)
panic("fpu ieee trap, but no exception");
- trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], sv);
+ trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - 1], sv);
break; /* XXX should return, but queue remains */
case FSR_TT_UNFIN: