The processor supports the following three processor modes:
In addition, the processor supports the following two non-processing states:
Emulation and Supervisor modes have unrestricted access to the core resources. User mode has restricted access to certain system resources, thus providing a protected software environment.
User mode is considered the domain of application programs. Supervisor mode and Emulation mode are usually reserved for the kernel code of an operating system.
The processor mode is determined by the Event Controller. When servicing an interrupt, a nonmaskable interrupt (NMI), or an exception, the processor is in Supervisor mode. When servicing an emulation event, the processor is in Emulation mode. When not servicing any events, the processor is in User mode.
The current processor mode may be identified by interrogating the IPEND memory-mapped register (MMR).
Event | Mode | IPEND |
---|---|---|
Interrupt | Supervisor | ≥ 0x10, but IPEND[0], IPEND[1], IPEND[2], and IPEND[3] = 0. |
Exception | Supervisor | ≥ 0x08 The core is processing an exception event if IPEND[0] = 0, IPEND[1] = 0, IPEND[2] = 0, IPEND[3] = 1, and IPEND[15:4] are 0’s or 1’s. |
NMI | Supervisor | ≥ 0x04 The core is processing an NMI event if IPEND[0] = 0, IPEND[1] = 0, IPEND[2] = 1, and IPEND[15:2] are 0’s or 1’s. |
Reset | Supervisor | = 0x02 As the reset state is exited, IPEND is set to 0x02, and the reset vector runs in Supervisor mode. |
Emulation | Emulator | = 0x01, The processor is in Emulation mode if IPEND[0] = 1, regardless of the state of the remaining bits IPEND[15:1]. |
None | User | = 0x00 |
The figure illustrates the processor modes and states as well as the transition conditions between them.