[OpenBIOS] sparc32 trap recovery
blauwirbel at gmail.com
Sun Jun 16 22:44:54 CEST 2013
On Sat, Jun 15, 2013 at 5:50 PM, Bob Breuer <breuerr at mc.net> wrote:
> I'm aiming for a cpeek that catches the data faults on sparc32, so I've
> coded up the attached test code.
> The fault handler here is almost trivially simple: set a new instruction
> pointer and return to it. All the magic is done in push_trap_handler
> and do_trap_handler, and they act similar to setjmp/longjmp. Nesting is
> allowed, so it should be possible to use this at the top level for
> printing out pretty error messages for any fault just like OBP.
Instead of (perhaps not so portable) returns_twice function, the trap
handler could just set a flag if a pointer to the flag is not NULL and
return to the caller after skipping the faulting instruction.
> I'm looking for any comments and suggestions. This proof of concept
> only handles mmu data faults, but is extendable. Example tests:
> deadbeef try-fault
> returns false (0),
> 10000 try-fault
> returns true (-1) and the value at 0x10000
More information about the OpenBIOS