Hardware Detection of Exceptions
Each of the exception types results in a hardware interrupt. For each such interrupt, a first-level interrupt handler (FLIH) saves the state of the executing program and calls a second-level handler (SLIH). The SLIH is passed a pointer to the machine-state save structure and a code indicating the cause of the interrupt.
When a SLIH determines that a hardware interrupt should actually be considered a synchronous exception, it sets up the machine-state save to invoke the longjmpx kernel service, and then returns. The FLIH then resumes the instruction stream at the entry to the longjmpx service.
The longjmpx service then invokes the top exception handler on the stack or takes the system default action as previously described.