
MOTOROLA
6-10
EXCEPTIONS
For More Information On This Product,
Go to: www.freescale.com
RCPU
REFERENCE MANUAL
in the MSR is then cleared. Each exception handler should set the RI bit in the MSR
(using the
mtmsr
instruction) at the end of its prologue, after saving the program
state (SRR0, SRR1, and, in some cases, DSISR and DAR). At the start of its epi-
logue (before saving the machine state), each exception handler should clear the
RI bit in the MSR.
In this way, the exception handler for an unordered exception can read the RI bit
in SRR1 to determine whether the processor can recover from the exception. If the
exception occurs while the machine state is being saved or restored during the pro-
cessing of a previous exception, the RI bit in SRR1 will be cleared, indicating that
the processor cannot recover from the exception. If the exception occurs at any
other time, the RI bit in SRR1 will be set, indicating the processor can recover from
the exception.
In critical code sections where MSR[EE] is negated but SRR0 and SRR1 are not
busy, MSR[RI] should be left asserted. In these cases if an exception occurs,the
processor can be restarted.
6.5.3 Commands to Alter MSR[EE] and MSR[RI]
The processor includes special commands to facilitate the software manipulation
of the MSR[RI] and MSR[EE] bits. These commands are executed by issuing the
mtspr
instruction
with one of the pseudo-SPRs shown in
Table 6-4
. Writing any
data to one of these locations performs the operation specified in the table. A read
(
mfspr
) of any of these locations is treated as an unimplemented instruction, re-
sulting in a software emulation exception.
6.6 Exception Order and Priority
When multiple conditions that can cause an exception are present, the highest-pri-
ority exception is taken. Exceptions are roughly prioritized by exception class, as
follows:
Table 6-4 Manipulating EE and RI Bits
SPR #
(Decimal)
Mnemonic
MSR[EE]
MSR[RI]
Use
80
EIE
1
1
External Interrupt Enable:
End of exception handler’s prologue, to enable nested
external interrupts;
End of critical code segment in which external interrupts
were disabled
81
EID
0
1
External Interrupt Disable, but other interrupts are
recoverable:
End of exception handler’s prologue, to keep external
nested interrupts disabled;
Start of critical code segment in which external interrupts
are disabled
82
NRI
0
0
Non-Recoverable Interrupt:
Start of exception handler’s epilogue
F
Freescale Semiconductor, Inc.
n
.