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

Tarl Neustaedter tarl-b2 at tarl.net
Mon Jan 7 19:41:04 CET 2013


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.




More information about the OpenBIOS mailing list