From 76fe5af2c97df3a556f2b079353f26691ad6bff4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 4 Feb 1997 23:42:46 +0000 Subject: [PATCH] provide fpe fault addr; thanks for help from torek@bsdi.com --- sys/arch/sparc/fpu/fpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/arch/sparc/fpu/fpu.c b/sys/arch/sparc/fpu/fpu.c index dd634891240..6a502402613 100644 --- a/sys/arch/sparc/fpu/fpu.c +++ b/sys/arch/sparc/fpu/fpu.c @@ -110,6 +110,7 @@ fpu_cleanup(p, fs) { register int i, fsr = fs->fs_fsr, error; union instr instr; + caddr_t pc = (caddr_t)p->p_md.md_tf->tf_pc; /* XXX only approximate */ struct fpemu fe; switch ((fsr >> FSR_FTT_SHIFT) & FSR_FTT_MASK) { @@ -119,10 +120,9 @@ fpu_cleanup(p, fs) break; case FSR_TT_IEEE: - /* XXX missing trap address! */ if ((i = fsr & FSR_CX) == 0) panic("fpu ieee trap, but no exception"); - trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], 0); + trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - i], pc); break; /* XXX should return, but queue remains */ case FSR_TT_UNFIN: @@ -139,7 +139,7 @@ fpu_cleanup(p, fs) log(LOG_ERR, "fpu hardware error (%s[%d])\n", p->p_comm, p->p_pid); uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid); - trapsignal(p, SIGFPE, -1, FPE_FLTINV, 0); /* ??? */ + trapsignal(p, SIGFPE, -1, FPE_FLTINV, pc); /* ??? */ goto out; default: @@ -164,11 +164,11 @@ fpu_cleanup(p, fs) case FPE: trapsignal(p, SIGFPE, fpu_codes[(fs->fs_fsr & FSR_CX) - 1], - fpu_types[(fs->fs_fsr & FSR_CX) - 1], 0); + fpu_types[(fs->fs_fsr & FSR_CX) - 1], pc); break; case NOTFPU: - trapsignal(p, SIGILL, 0, ILL_COPROC, 0); + trapsignal(p, SIGILL, 0, ILL_COPROC, pc); break; default: -- 2.20.1