__preemptive
In this section:
Syntax
See Syntax for type attributes used on functions.
Description
When the __preemptive keyword is used on an interrupt function, the enter sequence saves some control and status registers (CSR) and enables global interrupts. This allows nested interrupts. The values will be automatically restored when the function exits.
These CSRs are saved:
For machine interrupts:
mcauseandmepcFor supervisor interrupts:
scauseandsepcFor user interrupts:
ucauseanduepc
If the device needs to save additional CSRs, use the #pragma preemptive directive.
Example
__preemptive __interrupt void myInterruptFunction(void);