@web-font-path: "roboto-debian.css";
Methods for setting processor exception handlers. More...
Typedefs | |
typedef void(* | exception_handler_t) (void) |
Exception handler function type. | |
Enumerations | |
enum | exception_number { MIN_EXCEPTION_NUM = 2 , NMI_EXCEPTION = 2 , HARDFAULT_EXCEPTION = 3 , SVCALL_EXCEPTION = 11 , PENDSV_EXCEPTION = 14 , SYSTICK_EXCEPTION = 15 , MAX_EXCEPTION_NUM = 15 } |
Exception number definitions. More... | |
Functions | |
exception_handler_t | exception_set_exclusive_handler (enum exception_number num, exception_handler_t handler) |
Set the exception handler for an exception on the executing core. | |
void | exception_restore_handler (enum exception_number num, exception_handler_t original_handler) |
Restore the original exception handler for an exception on this core. | |
exception_handler_t | exception_get_vtable_handler (enum exception_number num) |
Get the current exception handler for the specified exception from the currently installed vector table of the execution core. | |
bool | exception_set_priority (uint num, uint8_t hardware_priority) |
Set specified exception's priority. | |
uint | exception_get_priority (uint num) |
Get specified exception's priority. | |
Methods for setting processor exception handlers.
Exceptions are identified by a exception_number which is a number from -15 to -1; these are the numbers relative to the index of the first IRQ vector in the vector table. (i.e. vector table index is exception_num plus 16)
There is one set of exception handlers per core, so the exception handlers for each core as set by these methods are independent.
typedef void(* exception_handler_t) (void) |
Exception handler function type.
All exception handlers should be of this type, and follow normal ARM EABI register saving conventions
enum exception_number |
Exception number definitions.
On Arm these are vector table indices:
Name | Value | Exception |
---|---|---|
NMI_EXCEPTION | 2 | Non Maskable Interrupt |
HARDFAULT_EXCEPTION | 3 | HardFault |
SVCALL_EXCEPTION | 11 | SV Call PENDSV_EXCEPTION | 14 | Pend SV SYSTICK_EXCEPTION | 15 | System Tick
uint exception_get_priority | ( | uint | num | ) |
Get specified exception's priority.
Numerically-lower values indicate a higher priority. Hardware priorities range from 0 (highest priority) to 255 (lowest priority).
Only the top 2 bits are significant on ARM Cortex-M0+ on RP2040.
num | Exception number exception_number |
exception_handler_t exception_get_vtable_handler | ( | enum exception_number | num | ) |
Get the current exception handler for the specified exception from the currently installed vector table of the execution core.
num | Exception number |
void exception_restore_handler | ( | enum exception_number | num, |
exception_handler_t | original_handler ) |
Restore the original exception handler for an exception on this core.
This method may be used to restore the exception handler for an exception on this core to the state prior to the call to exception_set_exclusive_handler(), so that exception_set_exclusive_handler() may be called again in the future.
num | Exception number exception_number |
original_handler | The original handler returned from exception_set_exclusive_handler |
exception_handler_t exception_set_exclusive_handler | ( | enum exception_number | num, |
exception_handler_t | handler ) |
Set the exception handler for an exception on the executing core.
This method will assert if an exception handler has been set for this exception number on this core via this method, without an intervening restore via exception_restore_handler.
num | Exception number |
handler | The handler to set |
bool exception_set_priority | ( | uint | num, |
uint8_t | hardware_priority ) |
Set specified exception's priority.
num | Exception number exception_number |
hardware_priority | Priority to set. |
Numerically-lower values indicate a higher priority. Hardware priorities range from 0 (highest priority) to 255 (lowest priority).
Only the top 2 bits are significant on ARM Cortex-M0+ on RP2040.