|To:||"Maciej W. Rozycki" <email@example.com>|
|Subject:||Re: [RFC] MIPS division by zero and libgcj...|
|From:||David Daney <firstname.lastname@example.org>|
|Date:||Fri, 11 Jun 2004 08:34:25 -0700|
|Cc:||email@example.com, firstname.lastname@example.org, email@example.com|
|User-agent:||Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030|
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 gasonly) 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 availableCould you point me to where in the kernel source this is handled? I will try to see what when wrong.
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||Re: [RFC] MIPS division by zero and libgcj..., Maciej W. Rozycki|
|Next by Date:||Re: [RFC] MIPS division by zero and libgcj..., Maciej W. Rozycki|
|Previous by Thread:||Re: [RFC] MIPS division by zero and libgcj..., Maciej W. Rozycki|
|Next by Thread:||Re: [RFC] MIPS division by zero and libgcj..., Maciej W. Rozycki|
|Indexes:||[Date] [Thread] [Top] [All Lists]|