All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: parisc-linux@lists.parisc-linux.org
Cc: csr21@cam.ac.uk
Subject: [parisc-linux] subo -> overflow_trap (12) -> What to do?
Date: Sat, 17 Aug 2002 18:05:45 -0400	[thread overview]
Message-ID: <20020817220545.GF16532@systemhalted> (raw)

[-- 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 */


             reply	other threads:[~2002-08-17 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-17 22:05 Carlos O'Donell [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020817220545.GF16532@systemhalted \
    --to=carlos@baldric.uwo.ca \
    --cc=csr21@cam.ac.uk \
    --cc=parisc-linux@lists.parisc-linux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.