05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

interrupt <strong>and</strong> asynchronous abort disable bits.<br />

The System Level Programmers’ Model<br />

The non-APSR bits of the CPSR have defined reset values. These are shown in the TakeReset() pseudocode<br />

function, see Reset on page B1-48.<br />

Writes to the CPSR have side-effects on various aspects of processor operation. All of these side-effects,<br />

except for those on memory accesses caused by fetching instructions, are synchronous to the CPSR write.<br />

This means they are guaranteed not to be visible to earlier instructions in the execution stream, <strong>and</strong> they are<br />

guaranteed to be visible to later instructions in the execution stream.<br />

Fetching an instruction causes an instruction fetch memory access. In addition, in a Virtual Memory System<br />

<strong>Architecture</strong> (VMSA) implementation, fetching an instruction can cause a translation table walk. The<br />

privilege of these memory accesses can be affected by changes to the mode field of the CPSR. Also, if the<br />

Security Extensions are implemented the virtual memory space of these accesses can be affected by changes<br />

to the mode field. Those mode changes take effect on the memory accesses as follows:<br />

A mode change by an exception entry is synchronous to the exception entry. This applies to all<br />

exception entries, including the exception entry for a synchronous exception generated directly by an<br />

instruction.<br />

A mode change by an exception return instruction is synchronous to the instruction.<br />

A mode change by an instruction other than an exception return <strong>and</strong> that is not the result of a<br />

synchronous exception generated directly by the instruction. Such a mode change can be the result<br />

of a CPS or MSR instructions, <strong>and</strong>:<br />

— is guaranteed not to be visible to memory accesses caused by fetching earlier instructions in<br />

the execution stream<br />

— is guaranteed to be visible to memory accesses caused by fetching instructions after the next<br />

exception entry, exception return instruction, or ISB instruction in the execution stream<br />

— might or might not affect memory accesses caused by fetching instructions between the mode<br />

change instruction <strong>and</strong> the point where mode changes are guaranteed to be visible.<br />

See Exception return on page B1-38 for the definition of exception return instructions.<br />

The Saved Program Status Registers (SPSRs)<br />

The purpose of an SPSR is to record the pre-exception value of the CPSR. When taking an exception, the<br />

processor copies the CPSR to the SPSR of the exception mode it is about to enter. Saving this value means<br />

the exception h<strong>and</strong>ler can:<br />

on exception return, restore the CPSR to the value it had when the exception was taken<br />

examine the value the CPSR had when the exception was taken, for example to determine the<br />

instruction set state in which the instruction that caused an Undefined Instruction exception was<br />

executed.<br />

The SPSRs do not have defined reset values.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. B1-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!