
MOTOROLA
Chapter 5. Exceptions
5-9
Exception Processing
completed. The exception is then taken without completing the exception-causing
instruction. If any other exception condition is created in completing these previous
instructions in the machine, that exception takes priority over the pending
instruction dispatch/execution exception, which will then be forgotten.
Post-instruction execution—(trace). This type of exception is generated following
execution and completion of an instruction while a trace mode is enabled. If
executing the instruction produces conditions for another type of interrupt, that
exception is taken and the post-instruction execution exception is forgotten for that
instruction.
5.2
Exception Processing
When an exception is taken, the processor uses the save/restore registers, SRR0 and SRR1,
to save the contents of the machine state register for user-level mode and to identify where
instruction execution should resume after the exception is handled.
5.2.1
Exception Processing Registers
The G2 core implements the SRR0 and SRR1 registers that are used for saving processor
state on an exception. The G2_LE core also uses these registers; additionally, the G2_LE
core implements CSRR0 and CSRR1 to specifically save state for critical interrupt
exceptions.
5.2.1.1
SRR0 and SRR1 Bit Settings
When an exception occurs, SRR0 is set to point to the instruction at which instruction
processing should resume when the exception handler returns control to the interrupted
process. All instructions in the program flow preceding this one will have completed and
no subsequent instruction will have completed. This may be the address of the instruction
that caused the exception or the next one (as in the case of a system call exception). The
instruction addressed can be determined from the exception type and status bits. This
address is used to resume instruction processing in the interrupted process, typically when
an
rfi
instruction is executed. The SRR0 register is shown in Figure 5-1
.
Figure 5-1. Machine Status Save/Restore Register 0 (SSR0)
The save/restore register 1 (SRR1) is used to save machine status (the contents of the MSR)
on exceptions and to restore those values when
rfi
is executed. SRR1 is shown in
Figure 5-2.
SRR0 (holds EA for resuming program execution)
0
31
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.