[OpenBIOS] sparc32 trap recovery

Bob Breuer breuerr at mc.net
Sat Jun 15 19:50:50 CEST 2013

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.

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


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sparc_trap_test.txt
URL: <http://www.openbios.org/pipermail/openbios/attachments/20130615/528c2105/attachment.txt>

More information about the OpenBIOS mailing list