Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 1997 02:27:09 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@freebsd.org, tomdean@ix.netcom.com
Subject:   Re: xlock: caught signal 8 while running galaxy mode.
Message-ID:  <199710041627.CAA32086@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>FreeBSD clears the exception register in the fpu when the trap code
>catches an fpu exception prior to calling the user's handler, if any.
>
>In npx.c, the exception register is cleared prior to sending a SIGFPE
>to the process.
>
>I want to be able to catch an exception, if I want, and determine what
>the cause of the problem was, and, possibly work around it.  I want my
>exception handler to know exactly what the exception was.

Here is the (unfinished) code for it (in npx.c):

---
#ifdef notyet
		/*
		 * Encode the appropriate code for detailed information on
		 * this exception.
		 */
		code = XXX_ENCODE(curpcb->pcb_savefpu.sv_ex_sw);
#else
		code = 0;	/* XXX */
#endif
---

The signal code for a SIGFPE can also be FPE_INTDIV_TRAP (integer divide
fault), FPE_INTOVF_TRAP (integer overflow fault), FPE_SUBRNG_TRAP (bounds
check fault) or FPE_FPU_NP_TRAP (no FPU h/w and no FPU emulator).  This
already works.  See trap.c and trap.h.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710041627.CAA32086>