|Home > Functional description > Programmers Model > Exceptions > Exception handling and prioritization|
The processor core and the Nested Vectored Interrupt Controller (NVIC) together prioritize and handle all exceptions.
When handling exceptions:
The processor supports tail-chaining that enables back-to-back interrupts without the overhead of state saving and restoration.
You configure the number of interrupts, and bits of interrupt priority, during implementation. Software can choose only to enable a subset of the configured number of interrupts, and can choose how many bits of the configured priorities to use.
When the Armv8‑M Security Extension is included, exceptions can be specified as either Secure or Non-secure. When an exception is taken the processor switches to the associated security state. The priority of Secure and Non-secure exceptions can be programmed independently. It is possible to deprioritize Non-secure configurable exceptions using the AIRCR.PRIS bit field to enable Secure interrupts to take priority.
When taking and returning from an exception, the register state is always stored using the stack pointer associated with the background security state. When taking a Non-secure exception from Secure state, all the register state is stacked and then registers are cleared to prevent Secure data being available to the Non-secure handler. The vector base address is banked between Secure and Non-secure state. VTOR_S contains the Secure vector base address, and VTOR_NS contains the Non-secure vector base address. These registers can be programmed by software, and also initialized at reset by the system. If the Armv8‑M Security Extension is not included all exceptions are Non-secure and only VTOR_NS is used to determine the vector base address.