diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-27 16:16:28 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-01-27 16:16:28 +0000 |
commit | e4e7fa53836f3e4df92922382229f61df1b0ac80 (patch) | |
tree | c55298d8549eaba1911db630b6e251a34a56a6d1 /sys/arch/mac68k | |
parent | 95302659848f005f2a4cc00f3dc1347f0e791138 (diff) |
Only install the fpsp exception vectors if the cpu is a 68040.
Thus, it becomes unnecessary to check for the cpu type in the exception
handlers, saving a few cycles and a few bytes.
Tested by various people on hp300, mac68k, mvme68k, 68040 and non-68040.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r-- | sys/arch/mac68k/mac68k/machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/vectors.s | 30 |
2 files changed, 28 insertions, 12 deletions
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index bdeede84b01..6700d3bc7e0 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.109 2003/12/20 20:08:17 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.110 2004/01/27 16:16:27 miod Exp $ */ /* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */ /* @@ -523,6 +523,9 @@ initcpu() #ifdef M68040 void buserr40(void); #endif +#ifdef FPSP + extern u_long fpvect_tab, fpvect_end, fpsp_tab; +#endif switch (cputype) { #ifdef M68060 @@ -535,11 +538,16 @@ initcpu() case CPU_68040: vectab[2] = buserr40; vectab[3] = addrerr4060; +#ifdef FPSP + bcopy(&fpsp_tab, &fpvect_tab, + (&fpvect_end - &fpvect_tab) * sizeof (fpvect_tab)); +#endif break; #endif default: break; } + DCIS(); } diff --git a/sys/arch/mac68k/mac68k/vectors.s b/sys/arch/mac68k/mac68k/vectors.s index fe0dccc4301..6747505c8c7 100644 --- a/sys/arch/mac68k/mac68k/vectors.s +++ b/sys/arch/mac68k/mac68k/vectors.s @@ -1,4 +1,4 @@ -/* $OpenBSD: vectors.s,v 1.5 2003/06/04 22:08:15 deraadt Exp $ */ +/* $OpenBSD: vectors.s,v 1.6 2004/01/27 16:16:27 miod Exp $ */ | $NetBSD: vectors.s,v 1.9 1997/09/03 06:16:24 scottr Exp $ | Copyright (c) 1988 University of Utah @@ -96,15 +96,8 @@ GLOBAL(vectab) VECTOR(illinst) /* 45: TRAP instruction vector */ VECTOR(illinst) /* 46: TRAP instruction vector */ VECTOR(trap15) /* 47: TRAP instruction vector */ -#ifdef FPSP - ASVECTOR(bsun) /* 48: FPCP branch/set on unordered cond */ - ASVECTOR(inex) /* 49: FPCP inexact result */ - ASVECTOR(dz) /* 50: FPCP divide by zero */ - ASVECTOR(unfl) /* 51: FPCP underflow */ - ASVECTOR(operr) /* 52: FPCP operand error */ - ASVECTOR(ovfl) /* 53: FPCP overflow */ - ASVECTOR(snan) /* 54: FPCP signalling NAN */ -#else + +GLOBAL(fpvect_tab) VECTOR(fpfault) /* 48: FPCP branch/set on unordered cond */ VECTOR(fpfault) /* 49: FPCP inexact result */ VECTOR(fpfault) /* 50: FPCP divide by zero */ @@ -112,7 +105,8 @@ GLOBAL(vectab) VECTOR(fpfault) /* 52: FPCP operand error */ VECTOR(fpfault) /* 53: FPCP overflow */ VECTOR(fpfault) /* 54: FPCP signalling NAN */ -#endif +GLOBAL(fpvect_end) + VECTOR(fpunsupp) /* 55: FPCP unimplemented data type */ VECTOR(badtrap) /* 56: unassigned, reserved */ VECTOR(badtrap) /* 57: unassigned, reserved */ @@ -134,3 +128,17 @@ GLOBAL(vectab) BADTRAP16 /* 64-255: user interrupt vectors */ BADTRAP16 /* 64-255: user interrupt vectors */ BADTRAP16 /* 64-255: user interrupt vectors */ + +#ifdef FPSP + /* + * 68040: this chunk of vectors is copied into the fpfault zone + */ +GLOBAL(fpsp_tab) + ASVECTOR(fpsp_bsun) /* 48: FPCP branch/set on unordered cond */ + ASVECTOR(inex) /* 49: FPCP inexact result */ + ASVECTOR(dz) /* 50: FPCP divide by zero */ + ASVECTOR(fpsp_unfl) /* 51: FPCP underflow */ + ASVECTOR(fpsp_operr) /* 52: FPCP operand error */ + ASVECTOR(fpsp_ovfl) /* 53: FPCP overflow */ + ASVECTOR(fpsp_snan) /* 54: FPCP signalling NAN */ +#endif /* FPSP */ |