All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] subo -> overflow_trap (12) -> What to do?
@ 2002-08-17 22:05 Carlos O'Donell
  2002-08-20 11:49 ` [parisc-linux] mcontext registers on parisc64 (was Re: subo -> overflow_trap (12) -> What to do?) Christophe Rhodes
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos O'Donell @ 2002-08-17 22:05 UTC (permalink / raw)
  To: parisc-linux; +Cc: csr21

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

pa,

Talking with Christophe Rhodes who is porting some Common Lisp code[1]
to parisc-linux and he has some old-ish code from HPUX (circa 1994)
that does some interesting things :)

The code does a 'subo' and it _does_ cause an overflow_trap (12) which is
currently unhandled in our traps.c ... this trickles into a SIGBUS, which
is questionable (as the comment notes).

In HPUX the code sets si_code to FPE_INTOVF as well as sending a SIGFPE
to the offending application. From there the handler does all the 'bignum'
cleanup and Lisp land is all happy.

So I've gone ahead and implemented this functionality into traps.c, but
I'm not sure if this is the right way to go. What do people think?
If any HPUX people would like to chime in? :)

Patch attached.

c.

[1] Package is 'sbcl'


[-- Attachment #2: kernel-parisc-trap.c.diff --]
[-- Type: text/plain, Size: 747 bytes --]

--- linux/arch/parisc/kernel/traps.c.orig       2002-08-17 17:37:26.000000000 -0400
+++ linux/arch/parisc/kernel/traps.c    2002-08-17 17:58:39.000000000 -0400
@@ -561,6 +561,14 @@
                force_sig_info(SIGILL, &si, current);
                return;

+       case 12:
+               /* Overflow Trap, let the userland signal handler do the cleanup */
+               si.si_signo = SIGFPE;
+               si.si_code = FPE_INTOVF;
+               si.si_addr = (void *) regs->iaoq[0];
+               force_sig_info(SIGFPE, &si, current);
+               return;
+
        case 14:
                /* Assist Exception Trap, i.e. floating point exception. */
                die_if_kernel("Floating point exception", regs, 0); /* quiet */


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-20 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-17 22:05 [parisc-linux] subo -> overflow_trap (12) -> What to do? Carlos O'Donell
2002-08-20 11:49 ` [parisc-linux] mcontext registers on parisc64 (was Re: subo -> overflow_trap (12) -> What to do?) Christophe Rhodes
2002-08-20 13:22   ` [parisc-linux] mcontext registers on parisc64 Carlos O'Donell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.