From: David Daney <ddaney@avtrex.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: gcc@gcc.gnu.org, linux-mips@linux-mips.org, java@gcc.gnu.org
Subject: Re: [RFC] MIPS division by zero and libgcj...
Date: Fri, 11 Jun 2004 08:34:25 -0700 [thread overview]
Message-ID: <40C9D101.3070001@avtrex.com> (raw)
In-Reply-To: <Pine.LNX.4.55.0406111554420.13062@jurand.ds.pg.gda.pl>
Maciej W. Rozycki wrote:
>On Thu, 10 Jun 2004, David Daney wrote:
>
>
>
>>It appears that gcc configured for mipsel-linux will execute a "break 7"
>>instruction on integer division by zero.
>>
>>This causes the kernel (I am using 2.4.25) to send SIGTRAP.
>>
>>
>
> It looks like you have a problem in your configuration. A "break 7"
>(or "teq <divisor>,$zero,7" -- but that's currently implemented in gas
>only) is indeed emitted and exectuted in the case of division by zero, but
>Linux has the ability to recognize this special break code and sends
>SIGFPE instead. There are actually two special codes defined, the other
>being "6" for an overflow. Both are handled by Linux, with si_code in
>struct siginfo being set to FPE_INTDIV or FPE_INTOVF, respectively. You
>can handle this appropriately in a signal handler.
>
My kernel sources are from linux-mips.org, it is little-endian running on:
# cat /proc/cpuinfo
system type : ATI-Xilleon
processor : 0
cpu model : MIPS 4Kc V0.7
BogoMIPS : 299.00
wait instruction : yes
microsecond timers : yes
tlb_entries : 16
extra interrupt vector : yes
hardware watchpoint : yes
VCED exceptions : not available
VCEI exceptions : not available
Could you point me to where in the kernel source this is handled? I
will try to see what when wrong.
David Daney.
next prev parent reply other threads:[~2004-06-11 15:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-10 19:12 [RFC] MIPS division by zero and libgcj David Daney
2004-06-10 19:31 ` Andrew Haley
2004-06-10 19:39 ` Andrew Haley
2004-06-10 19:48 ` David Daney
2004-06-10 19:58 ` Andrew Haley
2004-06-10 20:31 ` David Daney
2004-06-10 20:27 ` Ralf Baechle
2004-06-11 14:01 ` Maciej W. Rozycki
2004-06-11 15:34 ` David Daney [this message]
2004-06-11 15:39 ` Maciej W. Rozycki
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=40C9D101.3070001@avtrex.com \
--to=ddaney@avtrex.com \
--cc=gcc@gcc.gnu.org \
--cc=java@gcc.gnu.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@ds2.pg.gda.pl \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox