A Mach exception handler is a thread; on receipt of an exception notice
from the port of the process it is handling, it must receive access to the
thread management capability for the thread that raised the exception.
Using this capability, it can (by messages to the thread management server)
request a copy of the thread's registers, make changes, and then update
the thread's registers before restarting the thread. The exception handler
must also have access to the thread's memory address space, either
directly (if the handler runs in that address space) or indirectly (perhaps
using the process management capability for that thread.
To force the delivery of a UNIX-style signal to the thread that raised the
exception, the handler must make changes to the thread's registers and
memory region that simulate a call to the signal handler. The details of
this simulation depend on the instruction set and the calling conventions
for external functions, but on a steriotypical machine, this simulation might
involve pushing the PC on the thread's stack (using the thread's SP
register), then setting the thread's PC to the handler address.