From owner-freebsd-current Sat Oct 4 09:31:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA22342 for current-outgoing; Sat, 4 Oct 1997 09:31:47 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id JAA22336 for ; Sat, 4 Oct 1997 09:31:44 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id CAA32086; Sun, 5 Oct 1997 02:27:09 +1000 Date: Sun, 5 Oct 1997 02:27:09 +1000 From: Bruce Evans Message-Id: <199710041627.CAA32086@godzilla.zeta.org.au> To: freebsd-current@freebsd.org, tomdean@ix.netcom.com Subject: Re: xlock: caught signal 8 while running galaxy mode. Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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