
5-2
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Exception Classes
Unless a catastrophic condition causes a system reset or machine check exception, only one
exception is handled at a time. If, for example, a single instruction encounters multiple
exception conditions, those conditions are handled sequentially. After the exception
handler handles an exception, the instruction execution continues until the next exception
condition is encountered. However, in many cases there is no attempt to re-execute the
instruction. This method of recognizing and handling exception conditions sequentially
guarantees that exceptions are recoverable.
To prevent loss of state information, exception handlers should save the information stored
in SRR0 and SRR1 soon after the exception is taken. This prevents loss of information due
to a system reset or machine check exception or to an instruction-caused exception in the
exception handler before disabling external interrupts.
In this chapter, the following terminology is used to describe the various stages of exception
processing:
Recognition
Exception recognition occurs when the condition that can cause an
exception is identified by the processor.
Taken
An exception is said to be taken when control of instruction
execution is passed to the exception handler; that is, the context is
saved and the instruction at the appropriate vector offset is fetched
and the exception handler routing is executed in supervisor mode.
Handling
Exception handling is performed by the software linked to the
appropriate vector offset. Exception handling is performed at the
supervisor-level.
5.1
Exception Classes
The PowerPC architecture supports four types of exceptions:
Synchronous, precise—These are caused by instructions. All instruction-caused
exceptions are handled precisely; that is, the machine state at the time the exception
occurs is known and can be completely restored. This means that (excluding the trap
and system call exceptions) the address of the faulting instruction is provided to the
exception handler and that neither the faulting instruction nor subsequent
instructions in the code stream will complete execution before the exception is
taken. Once the exception is processed, execution resumes at the address of the
faulting instruction (or at an alternate address provided by the exception handler).
When an exception is taken due to a trap or system call instruction, execution
resumes at an address provided by the handler.
Synchronous, imprecise—The PowerPC architecture defines two imprecise
floating-point exception modes: recoverable and nonrecoverable. Even though the
G2 core provides a means to enable the imprecise modes, it implements these modes
F
Freescale Semiconductor, Inc.
n
.