Exception Processing
MOTOROLA
ColdFire2/2M User’s Manual
For More Information On This Product,
Go to: www.freescale.com
4-3
M-bit, in the SR to be cleared and the interrupt priority mask, I[2:0], in the SR to be set
to the level of the current interrupt request
2. The ColdFire2/2M determines the exception vector number. For all faults except
interrupts, the ColdFire2/2M performs this calculation based on the exception type.
For interrupts, the ColdFire2/2M performs an interrupt acknowledge (IACK) bus cycle
to obtain the vector number from a peripheral device. The IACK cycle is mapped to a
special acknowledge address space with the interrupt level encoded in the address.
Refer to
Section 3.7 Interrupt Acknowledge Bus Cycles
.
3. The ColdFire2/2M saves the current context by creating an exception stack frame on
the system stack. The ColdFire2/2M supports a single stack pointer (SP) in the A7
address register, i.e., there is no notion of separate
supervisor- or user- stack pointers.
As a result, the exception stack frame is created at a 0-modulo-4 address on the top
of the current system stack. Additionally, the ColdFire2/2M uses a simplified fixed-
length exception stack frame for all exceptions. The exception type determines
whether the program counter placed in the exception stack frame defines the location
of the faulting instruction or the address of the next instruction to be executed.
4. The ColdFire2/2M calculates the address of the first instruction of the exception
handler. By definition, the exception vector table is aligned on a 1 MByte boundary.
This instruction address is generated by fetching an exception vector from the table
located at the address defined in the vector base register. The index into the exception
table is calculated as (4 x vector_number). Once the exception vector has been
fetched, the contents of the vector determine the address of the first instruction of the
desired exception handler. After the instruction fetch for the first opcode of the
exception handler has been initiated, exception processing terminates and normal
instruction processing continues in the exception handler.
4.1.1 Exception Stack Frame Definition
A diagram of the exception stack frame is shown in
Figure 4-2
. The first long word of the
exception stack frame, pointed to by SP, contains the 16-bit format/vector word (F/V) and
the 16-bit status register, and the second long word contains the 32-bit program counter
address.
31
28 27 26 25
FS[3:2]
18 17 16 15
FS[1:0]
PROGRAM COUNTER[31:0] PC
0
FORMAT
VECTOR[3:2]
STATUS REGISTER
Figure 4-2. Exception Stack Frame Form
F
Freescale Semiconductor, Inc.
n
.