diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-02-08 23:36:59 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1997-02-08 23:36:59 +0000 |
commit | 9cd6b8623aead37e3ae799fbaacbe1e8f4f090c9 (patch) | |
tree | 0dbf784a1fde6bc60e30372c104596113b5057b9 /sys | |
parent | 4e4cedd75f2b75d434f5d46cd42b7ae45f025454 (diff) |
Provide more information on FP exceptions
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/isa/npx.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 683332aeb9a..37d8d28a0ee 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,3 +1,4 @@ +/* $OpenBSD: npx.c,v 1.13 1997/02/08 23:36:58 tholo Exp $ */ /* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */ #if 0 @@ -439,16 +440,28 @@ npxintr(arg) * just before it is used). */ p->p_md.md_regs = (struct trapframe *)&frame->if_es; -#ifdef notyet + /* * Encode the appropriate code for detailed information on * this exception. */ - code = XXX_ENCODE(addr->sv_ex_sw); -#else - code = 0; /* XXX */ + if (addr->sv_ex_sw & EN_SW_IE) + code = FPE_FLTINV; +#ifdef notyet + else if (addr->sv_ex_sw & EN_SW_DE) + code = FPE_FLTDEN; #endif - trapsignal(p, SIGFPE, code, 0, 0); /* XXX type? */ + else if (addr->sv_ex_sw & EN_SW_ZE) + code = FPE_FLTDIV; + else if (addr->sv_ex_sw & EN_SW_OE) + code = FPE_FLTOVF; + else if (addr->sv_ex_sw & EN_SW_UE) + code = FPE_FLTUND; + else if (addr->sv_ex_sw & EN_SW_PE) + code = FPE_FLTRES; + else + code = 0; /* XXX unknown */ + trapsignal(p, SIGFPE, T_ARITHTRAP, code, frame->if_eip); } else { /* * Nested interrupt. These losers occur when: |