Programmer’s Model
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
2-36
ID012310
Non-Confidential, Unrestricted Access
2.12
Exceptions
Exceptions occur whenever the normal flow of a program has to be halted temporarily. For
example, to service an interrupt from a peripheral. Before attempting to handle an exception, the
processor preserves the current processor state so that the original program can resume when the
handler routine has finished.
If two or more exceptions occur simultaneously, the exceptions are dealt with in the fixed order
given in
Exception priorities
on page 2-57.
This section provides details of the processor exception handling:
•
Exception entry and exit summary
on page 2-37
•
Entering an ARM exception
on page 2-38
•
Leaving an ARM exception
on page 2-38.
Several enhancements are made in ARM architecture v6 to the exception model, mostly to
improve interrupt latency, as follows:
•
New instructions are added to give a choice of stack to use for storing the exception return
state after exception entry, and to simplify changes of processor mode and the disabling
and enabling of interrupts.
•
The interrupt vector definitions on ARMv6 are changed to support the addition of
hardware to prioritize the interrupt sources and to look up the start vector for the related
interrupt handling routine.
•
A low interrupt latency configuration is added in ARMv6. In terms of the instruction set
architecture, it specifies that multi-access load/store instructions, ARM LDC, LDM,
LDRD, STC, STM, and STRD, and Thumb LDMIA, POP, PUSH, and STMIA, can be
interrupted and then restarted after the interrupt has been processed.
•
Support for an imprecise Data Abort that behaves as an interrupt rather than as an abort,
in that it occurs asynchronously relative to the instruction execution. Support involves the
masking of a pending imprecise Data Abort at times when entry into Abort mode is
deemed unrecoverable.
2.12.1
New instructions for exception handling
This section describes the instructions added to accelerate the handling of exceptions. Full
details of these instructions are given in the
ARM Architecture Reference Manual
.
Store Return State (SRS)
This instruction stores R14_<current_mode> and SPSR_<current_mode> to sequential
addresses, using the banked version of R13 for a specified mode to supply the base address, and
to be written back to if base register Write-Back is specified. This enables an exception handler
to store its return state on a stack other than the one automatically selected by its exception entry
sequence.
The addressing mode used is a version of an ARM addressing mode, modified to assume a
{R14,SPSR} register list rather than using a list specified by a bit mask in the instruction. For
more information see the
ARM Architecture Reference Manual
. This enables the SRS
instruction to access stacks in a manner compatible with the normal use of STM instructions for
stack accesses.
When in Non-secure state, specifying Secure Monitor mode in <mode> parameter field causes
the SRS to be an Undefined exception. The behavior prevents the Secure Monitor stack values
being altered.