Draft: Add a system for C++-like exception handlers
This change adds support for "Stack-based exception handlers", aka "SEH". Each privileged mode stack can contain a linked list of special exception handler stack frames, with the pointer to the head node stored in one of the words near the base of the stack memory (i.e. next to the C relocation offsets).
Each SEH node in the stack has a handler function associated with it.
When the kernel (or other SEH-aware components) flatten a stack, the corresponding handler functions will be called, to allow the code to perform suitable recovery actions, such as unlocking any spinlocks that the aborted operation was holding.
Currently there's no support for the handler to "catch" the exception and halt the stack flattening - the stack will be flattened, the only thing the SEH handlers can do is try and make sure the system isn't left in a broken state.
AbortTrap has been modified to make use of SEH (to protect its use of synclib), and a new test (attest_err3) has been added to make sure that it's working correctly.
SEH functions & values are exposed via OS_ReadSysInfo 6, to allow external code to push/pop nodes or to invoke the handlers before they flatten the stack(s).
Note: If you're going to try this code yourself, be aware of this issue with SyncLib.