Exception_handlingand algorithms
Exception_handlingand algorithms
063v11 1
Valpont.com, a Technology Content Platform
063v11 2
Valpont.com, a Technology Content Platform
Exception Handling
When an exception occurs, the ARM:
Copies CPSR into SPSR_<mode>
Sets appropriate CPSR bits
If core currently in Thumb state then
ARM state is entered
Mode field bits
Interrupt disable bits (if appropriate)
Stores the return address in LR_<mode>
Sets PC to vector address
Different for v6 with vectored interrupts -
see later
To return, exception handler needs to:
Restore CPSR from SPSR_<mode>
Restore PC from LR_<mode>
063v11 3
Valpont.com, a Technology Content Platform
ARM Exceptions
063v11 4
Valpont.com, a Technology Content Platform
Exception Handling
Exception handling on the ARM is controlled through the use
of an area of memory called the vector table. This lives
(normally) at the bottom of the memory map from 0x0 to 0x1c.
To support WinCE applications, most of the cached cores
allow the vector table to be moved from 0x0 to 0xFFFF0000.
All current cores except 7TDMI, 740T and 7TDMI-S support
this - including SA-1100/1110 and XScale. Selection is either
by asserting HIVECS input on reset or by software control via
CP15.
063v11 5
Valpont.com, a Technology Content Platform
Exception Handling
When one of these exceptions is taken, the ARM goes through a set of actions
(as shown on the slide) in order to invoke the appropriate exception handler.
Return has to be done from ARM state. There is no Thumb instruction to copy
SPSR back into CPSR
v6 vectored interrupts will take the IRQ handler address directly from the VIC via
the IRQADDR input to the core and start executing from that address - see later
slides
Also (as we mention later) the 1156 can take exceptions written in Thumb-2 code
in Thumb state, by setting the TE bit of cp15 register 1. This is set on reset by
the TEINIT signal to the core.
063v11 6
Valpont.com, a Technology Content Platform
In privileged modes this not only updates the PC but also copies the SPSR
into the CPSR
However the actual instruction depends on which exception is being handled.
Also possible to use a Load Multiple instruction (using the ^ qualifier) to return if in
a privileged mode with the PC as the destination.
There are some slides at the end of this module that show how the return
instructions are calculated. However these are really for reference and should not
normally be run through during class (though there is a hyperlink to them on this
slide if needed).
063v11 8
Valpont.com, a Technology Content Platform
Exception Priorities
Several exceptions can occur at the same time
063v11 9
Valpont.com, a Technology Content Platform
Exception Priorities
Because the Data Abort exception has a higher priority that the FIQ exception, the Data Abort
is actually registered before the FIQ is handled. The Data Abort handler is entered, but control
is then passed immediately to the FIQ handler. When the FIQ has been handled, control
returns to the Data Abort Handler. This means that the data transfer error does not escape
detection as it would if the FIQ were handled first.
For prefetch abort, instn is marked as invalid on fetch, but exception not taken until instn
reaches execution stage of the pipeline
Generally, exceptions are taken immediately after the current instruction has completed. This
is not always true, e.g. SWI exception is taken as part of the instruction.
IRQs are disabled for all exceptions and will not be taken during another handler unless they
are re-enabled. Imprecise data aborts on v6 are disabled on entry to Aborts, FIQs, IRQs and
Reset.
FIQs can be non-maskable on the 1156, Cortex-R4 and Cortex-A8 cores. This means that
FIQ and reset will still set the F bit in the CPSR/SPSR, but all you can do in software is clear it
(i.e. re-enable FIQs) - you cannot disable them by setting the F bit. On the 1156, this is set by
the FIQISNMI pin at reset. On the Cortex cores, it’s set by the CFGNMFI pin. It *cannot* be
changed by software, but can be read from cp15 register 1.
063v11 10
Valpont.com, a Technology Content Platform
SWI Handler
SWI Exception handler placed on
0x30000000 appropriate address boundary
> 32 Mbytes 0x2000000
IRQ Handler
IRQ handler within 32MBytes Branch
instruction range
0x1000
< 4 Kbytes Literal pool containing address of
0x30008000
0xFFC Undef Handler
FIQ Handler
0x1C FIQ vector FIQ handler follows vector table
0x18 B IRQ_Handler
IRQ vector
0x14 Reserved
0x10 Data abort vector
0xC Prefetch abort vector
0x8
MOV PC,
SWI#0x30000000
vector
0x4
Undef
LDR PC, vector
[PC, #+0xFF0]
0x0
Reset vector
063v11 11
Valpont.com, a Technology Content Platform
063v11 13
Valpont.com, a Technology Content Platform
The exception handler must ensure that other (corrupted) registers are
restored to their original state upon exit
This can be done by storing the contents of any working registers on the
stack and restoring them before returning
063v11 14
Valpont.com, a Technology Content Platform
SRS and RFE instructions to save and restore r14 and the SPSR
Must adjust the link register before saving it
CPS simplifies changing state and/or modifying the I and F bits in the CPSR
063v11 15
Valpont.com, a Technology Content Platform
Low-latency interrupt mode - see the TRM for your core for full details, however
what it typically does is disable hit-under-miss and allows LDM/STM to normal
(cacheable, bufferable) memory to be abandoned and repeated later on.
The 1156 can take exceptions in Thumb state (written in Thumb-2 code for PSR
access) if the TE bit is set in the cp15 control register 1. This also applies to the
Cortex-A/R cores. The TE bit is set at reset by the TEINIT pin.
063v11 16
Valpont.com, a Technology Content Platform
Interrupt Handling
The ARM has two levels of external interrupt - FIQ and IRQ
However most ARM based systems have more than 2 interrupt sources!
Therefore need an interrupt controller (typically memory mapped) to control how
interrupts are passed onto the ARM
In many systems some interrupts will be higher priority than others - these will
need to preempt any lower priority interrupts that may be being handled at that
point in time
Note: An interrupt handler should always contain code which clears the source
of an interrupt
063v11 17
Valpont.com, a Technology Content Platform
Interrupt Handling
The ARM only directly supports two interrupts, IRQ and FIQ but most systems will
have more sources than two. Thus almost all ARM based systems will need to
have some form of interrupt controller in the hardware system. At a very simple
level such a controller could simply be a mux of the interrupt sources (in which
case, it helps if they are active low, level sensitive as the ARM interrupt inputs are).
When the ARM receives an interrupt it would then need to poll each of the sources
in turn until it found the active source.
However most systems will have a more sophisticated controller than this. In a
typical system the controller will normally provide a set of memory mapped
registers which the ARM can read to work out which source caused the interrupt.
The controller will normally also provide some mechanism for prioritizing interrupt
sources, so that even when the ARM is dealing with a low priority interrupt, the
controller can still flag to the ARM when a more important interrupt occurs (and not
just FIQ). Such a controller will also normally be designed to also allow the ARM to
be interrupted by edge sensitive, active high interrupt sources.
Note also that there are some significant differences on the ARM11 MPcore, as the
interrupt controller is integrated into the core (it has to be, to direct interrupts
between the four cores).
063v11 18
Valpont.com, a Technology Content Platform
FIQ vs IRQ
FIQ and IRQ provide very basic level of prioritization
063v11 19
Valpont.com, a Technology Content Platform
FIQ vs IRQ
FIQs are meant to be for the most important interrupt source or sources in the
system. If you do have more than 1 very critical interrupt source that you want
dealt with as an FIQ it is normally best not to nest the handling of these
sources. Typically the overhead of nesting FIQs adds too much latency to the
FIQ handler (e.g extra banked registers that must be saved). In most cases it
will be more efficient to just finish dealing with the one you are handling now,
return from it and then reenter immediately to deal with the second source.
Servicing an FIQ disables IRQs, so IRQs will not be serviced until after FIQ
handler exits. IRQs may be re-enabled inside FIQ handler, if required.
063v11 20
Valpont.com, a Technology Content Platform
This causes
All corrupted registers used within the function to be preserved
If applicable, any other registers that may be corrupted by a further function call to
be preserved
The function to be exited with the correct return instruction
(sets the pc to lr-4 and restores the cpsr from the spsr)
Make sure that you set up SP_irq and add a vector table entry!
063v11 21
Valpont.com, a Technology Content Platform
This causes
all corrupted registers used within the function to be preserved
if applicable, any other registers that may be corrupted by a further function call to be preserved
the function to be exited with the correct return instruction
(sets the pc to lr-4 and restores the cpsr from the spsr)
Make sure that you set up sp_irq and add a vector table entry!
__irq can also be used to write FIQ handlers in C, but this is NOT recommended (C compiler cannot take
advantage of banked-in r8-r12).
For the Cortex-M3 rev0, (with --cpu Cortex-M3-rev0) the compiler will insert a “dynamic stack veneer” to
account for 8-byte stack alignment and adjust the stack as necessary when you use __irq.
063v11 22
Valpont.com, a Technology Content Platform
063v11 23
Valpont.com, a Technology Content Platform
__irq can also be used to write FIQ handlers in C, but this is NOT recommended
(C compiler cannot take advantage of banked-in r8-r12).
Example routine reads an integer from location 0x80000000 to identify the source
of the interrupt.
If the source equals 1 then call int_handler_1 subroutine
Although only shown as a comment here, the code would normally need to check
for all the other possible sources too.
The interrupt is then cleared by writing 1 to 0x80000004.
Note that the compiled code uses r4 because it will not be corrupted by the
subroutine. If it had used a lower register e.g. r1 then it would need to re-load this
register from memory after the subroutine call.
063v11 24
Valpont.com, a Technology Content Platform
063v11 25
Valpont.com, a Technology Content Platform
Other key point is that interrupts must be disabled as the SPSR is being restored,
otherwise the temporary register used to hold the SPSR after popping of the stack
might be corrupted by another interrupt.
063v11 26
Valpont.com, a Technology Content Platform
Stack issues
The ABI for the ARM Architecture requires 8-byte stack alignment at all
external boundaries
Need to ensure we maintain this for calling external functions
063v11 27
Valpont.com, a Technology Content Platform
Stack issues
The ABI / AAPCS requires 8-byte alignment of the stack at *external* interfaces. So
in interrupt handlers, this means we need to beware of 4 points:
063v11 28
Valpont.com, a Technology Content Platform
063v11 29
Valpont.com, a Technology Content Platform
}
IRQ_Handler
SUB lr, lr, #4
Push LR_irq,
STR lr, [sp, #-4]! SPSR_irq, APCS-
Read interrupt source,
MRS r14, SPSR corruptible registers
clearing interrupt in STMFD sp!, {r0-r4,r12, r14}
and r4 onto the stack
controller
{ BL identify_and_clear_source
{
Switch to system MRS r2, CPSR
mode, keep ORR r2, r2, #0x1f
IRQ disabled MSR CPSR_c, r2 Check SP_usr for 8-byte
Enable IRQ
AND
SUB
STMFD
r1, sp, #4
sp, sp, r1
sp!, {r1, lr} } alignment and save
LR_usr plus a word to
indicate the stack
adjustment used (0 or 4)
and call C
handler, passing { BIC
MSR
BL
r2, r2, #0x80
CPSR_c,r2
C_irq_handler
the source in r0
...
063v11 30
Valpont.com, a Technology Content Platform
First, we store LR_irq. I’ve used a single-word store here as it may typically save a
cycle compared to a one-word STM (which we used in the previous version of this
code).
We then push the user registers (r0-r3, r12) early so that we can write
identify_and_clear_source in C using the AAPCS if necessary. We also need to
push r4 here so that SP_irq is 8-byte aligned; you don’t need to save r4 if your
identify-and-clear code is assembly and you are aware you will not need 8-byte
stack alignment (many people may want to inline this code in their handler). We
also push SPSR_irq, held in r14.
A simple example of clearing an interrupt at your controller is below. This method
masks off the interrupt at the VIC which corresponds to the highest active bit in the
status register and leaves that bit in r0. You would then need to clear the interrupt at
the peripheral and unmask it at the interrupt controller from your main handler. NB:
this is only really for reference as an example if the audience ask - it will depend
entirely on the interrupt controller in use and the design of the interrupt handlers
063v11 31
Valpont.com, a Technology Content Platform
After this, we switch to system mode but keep IRQs disabled - as we need to check the stack
alignment. Remember that the AAPCS requires eight-byte stack alignment, but only at
external boundaries. So it’s entirely possible that we’ll have interrupted some code in the
middle of a function, where SP_usr was not eight-byte aligned. We need to check for this,
correct the stack pointer if necessary. We also push an extra word on the stack to indicate the
adjustment made to SP_usr to restore it later. Note also that we must now push LR_usr as
we have changed mode - fortunately, this also maintains our 8-byte stack alignment. Then we
just re-enable interrupts (staying in system mode) and call the main body of the IRQ handler in
C.
063v11 32
Valpont.com, a Technology Content Platform
Disable IRQ
{ MRS
ORR
MSR
r2, CPSR
r2, r2, #0x80
CPSR_c,r2
}
Restore LR_usr and
LDMFD sp!, {r1,lr}
ADD sp, sp, r1
undo the adjustment
made to SP_usr
{
Switch back BIC r2, r2, #0x1f
to IRQ ORR r2, r2, #0x92
mode MSR CPSR_c,r2
LDMFD
MSR
LDMFD
SPSR_csxf, r14
sp!, {pc}^ }
sp!, {r0-r4, r12, r14}
063v11 33
Valpont.com, a Technology Content Platform
On the way back, we do the reverse operations from the previous slide:
-Restore the LR_usr and “un-adjust” the stack (i.e. if it was misaligned on entry,
we need to misalign it on the way out)
-Restore everything else, including LR_irq and the SPSR and return
063v11 34
Valpont.com, a Technology Content Platform
Enable/disable
{ CPSIE
BL
i
C_irq_handler
System mode stack
Restore registers
and return using { LDMFD
RFEFD
sp!, {r0-r3, r12}
sp!
063v11 35
Valpont.com, a Technology Content Platform
The process is very similar, but notice that this is now much shorter (15 instructions
compared to 25 for v5TE; one less register pushed and popped).
063v11 36
Valpont.com, a Technology Content Platform
Interrupt
VIC
sources
IRQADDR ARM1136JF-S
063v11 37
Valpont.com, a Technology Content Platform
063v11 38
Valpont.com, a Technology Content Platform
On v5TE (e.g. ARM926EJ-S without a dedicated IRQADDR port) you could still set up
vectored interrupts (using e.g. PL190) such that your top-level handler read the address of
the device handler from the VIC, which also acknowledged the interrupt in the VIC’s
prioritization hardware. This eliminated the need for the top-level handler to do
identification and prioritization itself. Even better, if you use your MMU to map the VIC’s
registers to the top of the address range (e.g. 0xFFFF0000) you can use an LDR pc, [pc, #-
offset] in the vector table where the negative offset will wrap around - so this is effectively
the same as the v6 version, plus one branch in the vector table. You could also use this
scheme on a v6 core without an IRQADDR input.
NB: None of this applies to the ARM11 MPcore, as the interrupt controller is integrated into
the core.
063v11 39
Valpont.com, a Technology Content Platform
The handler is now doing everything that the top-level handler does; i.e. you must
store SPSR_irq and LR_irq, change to system mode, check stacks, etc.
You must also return yourself using SUBS pc, lr, #4 as a top-level handler would
VICs usually provide for hardware prioritization of interrupts (but have a maximum
number of vectored interrupts they support). Reduces the IRQ handler overhead
in addition to the branching via the vector table.
063v11 41
Valpont.com, a Technology Content Platform
Internal aborts are those from the core itself - the MMU/MPU
MMU faults may indicate you need to take corrective action and
re-execute the appropriate instruction
063v11 42
Valpont.com, a Technology Content Platform
Abort Handlers
What you do when an abort happens depends on the system
In a simple system without any memory management, this usually indicates a
serious error (e.g. hardware fault, code bug)
With memory management, you may need to identify the cause of the abort and
take corrective action. For example:
Allocate more memory for a process
Load a new page of code or data which the process was trying to access
Terminate the process if it did not have permission to access the aborting address
ARM7TDMI family devices have a different abort model - see appendix
063v11 43
Valpont.com, a Technology Content Platform
Abort Handlers
For the 1156 and Cortex-R4, the MPU also has fault status and address registers
for checking this, although you obviously can’t do memory remapping. However,
may be useful for identifying the location of the fault.
Aborts from cached memory loads may not be seen by the core:
Pre-v6 cores, they won’t be seen by the core so don’t cache memory that may
abort (if you have h/w failure, there’s not much you can do anyway…)
For v6 cores, the following description is based on the 1136 TRM and a brief chat
to Rich A about the behaviour. If in doubt, point customers to their core TRM
and/or support-cores
- I$ linefills that experience an abort will not mark the line as valid. Any
subsequent instruction execution from that line will cause a prefetch abort
- D$ linefills that abort will not mark the line as valid. If the abort is on
the critical word the abort is passed to the core; others will *not* cause a direct
abort (but of course, if they are subsequently accessed and abort again as the
critical word of the fetch, the abort _will_ be seen)
063v11 44
Valpont.com, a Technology Content Platform
V6 also has a WFAR (Watchpoint Fault Address Register) for monitor-mode debug.
Core implementations may also provide an IFAR (instruction fault address register) - but this
is not in e.g. the ARM1136.
With TrustZone, an external abort may also be because you are accessing a secure
peripheral from the non-secure world.
063v11 45
Valpont.com, a Technology Content Platform
Imprecise aborts
Architecture v6 can recognise “imprecise data aborts”
A store to memory held in the write buffer may actually happen and abort
several cycles after the original instruction
Could potentially nest under a precise abort
063v11 46
Valpont.com, a Technology Content Platform
SWI Invocation
In assembler, a SWI is called with an appropriate SWI number: SWI 0x24
Note: SWI has now been renamed to SVC (RVDS 2.2 and later)
Beware that calling a SWI when in Supervisor mode will corrupt LR_svc
Solution: push LR_svc onto stack before calling the SWI
Parameters are passed in:
The SWI number e.g. for semihosting, use 0x123456 (ARM) or 0xAB (Thumb)
Core registers
In C, map a call to a function onto a SWI using the keyword “__swi”
Pass up to 4 parameters in r0-r3
Note: no stack parameters because of the change to supervisor mode
For example... compiles to:
__swi(0x24) void my_swi (char *s); foo
STMFD sp!,{r4,lr}
void foo (void) LDR r0, =text
{ SWI 0x24
my_swi(“Hello world\n”); LDMFD sp!,{r4,pc}
} ...
text DCB “Hello world\n”,0
063v11 47
Valpont.com, a Technology Content Platform
SWI Invocation
Note that the compiler won’t let you use more than four arguments for __swi functions. In theory you could get the user SP, but
that’s awkward and there are simpler ways of designing the handler interface.
SWIs can also be called from inline assembler. See docs for details.
063v11 48
Valpont.com, a Technology Content Platform
Software Interrupts
User program
(C/ASM)
Vector table
SWI handler
(ARM assembly)
SWI handler
(ARM or Thumb
SWI 0x01 C code)
(Optional)
063v11 49
Valpont.com, a Technology Content Platform
Software Interrupts
This slide shows the sequence of actions involved in handling a SWI.
1) The SWI is invoked in the user program (either C or ASM). Parameters may have
been placed in registers before the SWI. The SWI number is embedded in the SWI
instruction itself.
3) The vector points to a handler which is written in ASM. This is where the SWI
number is extracted from the SWI instruction (by back-tracing through LR).
Optionally, parameters may be placed on the stack prior to calling a C handler. If a C
handler is not used, the parameters may be used directly from the registers.
4) Optionally, a C handler may be used to carry out the bulk of the SWI processing.
In order to be able to pass the SWI number plus four other parameters to this routine
(more than we can usually pass in registers), the SWI number is passed in a register
together with a pointer to the other parameters which are placed on the stack prior to
the call.
The C handler is a normal C function.
063v11 50
Valpont.com, a Technology Content Platform
Software Interrupts
As ARM state is automatically entered on taking an exception, and an ARM
instruction is needed to return from an exception, the obvious way to code your
exception handlers is completely in ARM code. This is particularly the case when
performance is critical and the exception handling code can be located in fast 32-bit
wide memory - for instance with interrupt handlers.
This does apply generally to other exceptions, but SWIs are the most common one
that you may want to use Thumb code in (e.g. for a large handler for OS calls)
063v11 51
Valpont.com, a Technology Content Platform
Thumb format:
15 8 7 0
1 1 0 1 1 1 1 1 SWI number
063v11 52
Valpont.com, a Technology Content Platform
{
TST r0, #T_bit
(24 bits if called from ARM, LDRNEH r0, [lr,#-2]
8 bits if called from Thumb) BICNE r0, r0, #0xff00
LDREQ r0, [lr,#-4]
BICEQ r0, r0, #0xff000000
}
code LDR r1, [sp], #4
Restore
MSR spsr_csxf, r1
registers
LDMFD sp!, {r0-r4,r12,pc}^
and return
063v11 53
Valpont.com, a Technology Content Platform
Example C handler:
int C_SWI_Handler(int swinum, int * params)
{
switch(swinum)
{
case 0:
return writechar(params[0], params[1]);
break;
case 1:
return readchar(params[0]);
break;
}
return -1;
}
063v11 54
Valpont.com, a Technology Content Platform
Reset
The operations carried out by a Reset handler depend upon the system in
question
For example it may:
Set up exception vectors
Initialize the memory system (e.g. MMU/PU)
Initialize all required processor mode stacks and registers
Initialize variables required by C
Initialize any critical I/O devices
Enable interrupts
Change processor mode and/or state
Call the main application
Unlike the other exception handlers, there should be no need to ‘return’ from
the Reset handler as it should call your main application.
063v11 55
Valpont.com, a Technology Content Platform
Undefined Instruction
An Undefined Instruction exception can occur if:
The ARM tries to execute a real undefined instruction
The ARM encounters a coprocessor instruction for which the appropriate
coprocessor hardware does not exist in the system.
The ARM encounters a coprocessor instruction for which the appropriate
coprocessor hardware exists, but has not been enabled
The ARM encounters a coprocessor instruction for which the appropriate
coprocessor does exist but rejects the instruction because the ARM is not in a
privileged mode.
For example access to cp15 - the system control coprocessor
Other privileged instructions
Courses of action:
Implement “soft” coprocessor emulation in the handler (such as VFP support code)
Take action based on rogue task attempting forbidden privileged operation
Report error and quit
063v11 56
Valpont.com, a Technology Content Platform
Undefined Instruction
Coprocessors may need to be enabled via cp15 register 1, opcode2 = 4
063v11 57
Valpont.com, a Technology Content Platform
In ARM state:
Upon exception occurring the core sets LR_mode = PC - 4
Handler may need to adjust LR_mode (depending on the exception which occurred)
to return to the correct address
In Thumb state:
The address stored in LR_mode is amended automatically by the processor
depending upon the exception that has occurred
This ensures the ARM return instruction from the handler will return to the correct
address (and to the correct state), regardless of the state that was current when the
exception occurred
063v11 58
Valpont.com, a Technology Content Platform
ARM Thumb
SWI pc-8 pc-4 Exception taken here
xxx pc-4 pc-2 lr = next instruction
yyy pc pc
Return instruction is
MOVS pc,lr
063v11 59
Valpont.com, a Technology Content Platform
The SWI and Undefined Instruction exceptions are generated by the instruction
itself, so the program counter is not updated when the exception is taken. The
processor stores (pc - 4) in lr_ mode. This makes lr_mode point to the next
instruction to be executed. Restoring the program counter from the lr with:
MOVS pc, lr
returns control from the handler.
The handler entry and exit code to stack the return address and pop it on return is:
STMFD sp!,{reglist,lr}
;...
LDMFD sp!,{reglist,pc}^
063v11 60
Valpont.com, a Technology Content Platform
ARM Thumb
www pc - 12 pc - 6 Interrupt occurred during execution
xxx pc - 8 pc - 4
yyy pc - 4 pc - 2 ARM lr = next instruction
zzz pc pc Thumb lr = two instructions ahead
Return instruction is
SUBS pc,lr,#4
063v11 61
Valpont.com, a Technology Content Platform
063v11 62
Valpont.com, a Technology Content Platform
ARM Thumb
www pc – 8 pc - 4 Prefetch Abort occurred here
xxx pc – 4 pc - 2 ARM lr = next instruction
yyy pc pc Thumb lr = two instructions ahead
Return instruction is
SUBS pc,lr,#4
063v11 63
Valpont.com, a Technology Content Platform
063v11 64
Valpont.com, a Technology Content Platform
ARM Thumb
www pc - 12 pc - 6 Data abort occurred here
xxx pc - 8 pc - 4
yyy pc - 4 pc - 2 ARM lr = two instructions ahead
zzz pc pc
aaa pc + 4 pc + 2 Thumb lr = four instructions ahead
Return instruction is
SUBS pc,lr,#8
063v11 65
Valpont.com, a Technology Content Platform
063v11 66
Valpont.com, a Technology Content Platform
LDR r0,[r1,#8]!
causes r1 to be updated
If the memory access results in a data abort, the effect on the base register is
dependent on the particular ARM core in use
“Base Restored Abort Model”
Supported by StrongARM, ARM9 and ARM10, ARM11 and later families
Base register is restored automatically by the ARM core
“Base Updated Abort Model”
Supported by ARM7TDMI family
Base register may have to be restored by the handler before instruction can be
re-executed
Example code for both models is included in RVDS examples directory
063v11 67