[OpenBIOS] [RFC 3/3] SPARC32/64: Mimic Sun's OBP behaviour if a divide by zero occurs.

Programmingkid programmingkidx at gmail.com
Mon Jan 7 19:44:08 CET 2013


On Jan 7, 2013, at 1:41 PM, Tarl Neustaedter wrote:

> On 2013-Jan-7 12:04 , Mark Cave-Ayland wrote:
>>> 
>>> NAK. Either my memory is cheating on me or there is some other Artyom
>>> Tarasenko who reported it. OBP produces an exception in case of
>>> division by zero.
>> 
>> Here is the post I referenced sent by your imposter: http://lists.openbios.org/pipermail/openbios/2011-August/006626.html. 
> 
> Artyom's post says it returns no value _IFF_ he gets a trap 3e. A trap 3e (on SPARC) is a non-resumable trap; the world has gone to shit, all you can do is poke around in the debris and find out what blew up. In this case, it re-enters forth clobbering anything that might have been in progress.
> 
> I think Mark's patch is the correct one if this is indeed what PPC does; I'm suspicious because I see elsewhere that current PPCs do indeed trap on divide by zero. Rather than allowing divide by zero, I'd think it would make more sense to figure out where that is coming from and prevent whatever parameter is causing this from ever being set to values that will cause a trap.

What PowerPC systems trap on divide by zero? 


More information about the OpenBIOS mailing list