|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 18 – Fault Dispatcher & Precise Exceptions > 18.1 Exception Classification |
Every exceptional event in EMulatR carries a two-level classification. The high-level PendingEventKind (exceptionLib/PendingEventKind.h) distinguishes the broad event category:
enum class PendingEventKind : quint8 {
None = 0,
Exception, // Synchronous fault/trap
Interrupt, // Asynchronous interrupt
Ast, // Asynchronous System Trap
MachineCheck, // Machine check (non-maskable)
Reset, // Reset/wakeup
PalCall // CALL_PAL event
};
The fine-grained ExceptionClass_EV6 (exceptionLib/ExceptionClass_EV6.h) carries 32 values that determine the specific PAL vector and delivery semantics. The full enumeration includes: Reset, MachineCheck, InternalProcessorError, BugCheck, Arithmetic, Interrupt, DStream, ItbMiss, ItbAcv, OpcDec, Fen, Unalign, Dfault, DtbAcv, Dtb_miss_double_4, Dtb_miss_single, Dtb_miss_native, MT_FPCR, IllegalInstruction, MemoryFault, SoftwareTrap, BreakPoint, Panic, PrivilegeViolation, ReservedOperand, CallPal, and others.
The design principle: pipeline code creates a PendingEvent with an ExceptionClass. The FaultDispatcher resolves the PalVectorId during delivery preparation. Detection and delivery are decoupled — the same PendingEvent structure flows through both phases.
Each event carries an EventPriority that determines dispatch order when multiple events are pending simultaneously:
Priority |
Event Types |
|---|---|
Reset (highest) |
System/CPU reset |
Critical |
Machine check, internal processor error |
High |
Arithmetic exceptions, alignment faults, TLB faults, access violations |
Normal |
Illegal instruction, software traps, CALL_PAL |
Low (lowest) |
Hardware interrupts, IPIs, device completion — maskable by IPL |
When multiple events are pending, the FaultDispatcher delivers the highest-priority event first. Lower-priority events remain queued until the higher-priority event is resolved.
See Also: exceptionLib/PendingEventKind.h; exceptionLib/ExceptionClass_EV6.h; 7.2 Terminology and Classification; 7.7 Priority Ordering.