Visible to Intel only — GUID: srj1733362425664
Ixiasoft
Visible to Intel only — GUID: srj1733362425664
Ixiasoft
9.2.1.2.1. Trap Handling System Structure
The trap handling system consists of the following components:
- The trap handling code
- The interrupt dispatcher
- ISR for timer interrupts
- ISR for software interrupts
- ISR for each peripheral that generates platform interrupts
- The exception dispatcher
- Handler for instruction-related exception
With the CLINT-Direct, all traps start from the same trap handling code. The trap handling code manages the processor context switch and RTOS overhead (if any). Next, it determines the source of the trap, and executes the correct dispatcher:
- If the trap is an interrupt, the interrupt dispatcher is executed.
- If the trap is an exception, the exception dispatcher is executed.
The interrupt dispatcher passes control to the relevant ISRs, while the exception dispatcher passes control to the correct exception handler.
The following files provides the HAL API for the trap handling system:
- <Project directory>\software\bsp\HAL\src\intel_niosv_irq.c
- <Project directory>\software\bsp\HAL\src\machine_trap.S
- <Project directory>\software\bsp\HAL\src\alt_irq_handler.c
Traps | Address Computation | Action Taken |
---|---|---|
All Exceptions | pc <= Exception Vector | Enters trap handling code |
Machine software interrupt | ||
Machine timer interrupt | ||
Platform interrupt 0 | ||
… | ||
Platform interrupt 16 |