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.

The System Level Programmers’ Model<br />

if HaveSecurityExt() then SCR.NS = ‘0’;<br />

ResetCP15Registers();<br />

ResetDebugRegisters();<br />

if HaveAdvSIMDorVFP() then FPEXC.EN = ‘0’; SUBARCHITECTURE_DEFINED further resetting;<br />

if HaveThumbEE() then TEECR.XED = ‘0’;<br />

if HaveJazelle() then JMCR.JE = ‘0’; SUBARCHITECTURE_DEFINED further resetting;<br />

// Further CPSR changes: all interrupts disabled, IT state reset, instruction set<br />

// <strong>and</strong> endianness according to the SCTLR values produced by the above call to<br />

// ResetCP15Registers().<br />

CPSR.I = ‘1’; CPSR.F = ‘1’; CPSR.A = ‘1’;<br />

CPSR.IT = ‘00000000’;<br />

CPSR.J = ‘0’; CPSR.T = SCTLR.TE; // TE=0: <strong>ARM</strong>, TE=1: Thumb<br />

CPSR.E = SCTLR.EE; // EE=0: little-endian, EE=1: big-endian<br />

// All registers, bits <strong>and</strong> fields not reset by the above pseudocode or by the<br />

// BranchTo() call below are UNKNOWN bitstrings after reset. In particular, the<br />

// return information registers R14_svc <strong>and</strong> SPSR_svc have UNKNOWN values, so that<br />

// it is impossible to return from a reset in an architecturally defined way.<br />

// Branch to Reset vector.<br />

BranchTo(ExcVectorBase() + 0);<br />

The <strong>ARM</strong> architecture does not define any way of returning from a reset.<br />

B1.6.11 Undefined Instruction exception<br />

An Undefined Instruction exception might be caused by:<br />

a coprocessor instruction that is not accessible because of the settings in one or both of:<br />

— the Coprocessor Access Control Register, see c1, Coprocessor Access Control Register<br />

(CPACR) on page B3-104 for a VMSA implementation, or c1, Coprocessor Access Control<br />

Register (CPACR) on page B4-51 for a PMSA implementation<br />

— in an implementation that includes the Security Extensions, the Non-Secure Access Control<br />

Register, see c1, Non-Secure Access Control Register (NSACR) on page B3-110<br />

a coprocessor instruction that is not implemented<br />

an instruction that is UNDEFINED<br />

an attempt to execute an instruction in an unsupported instruction set state, see Exception return to<br />

an unsupported instruction set state on page B1-40<br />

division by zero in an SDIV or UDIV instruction in the <strong>ARM</strong>v7-R profile when the SCTLR.DZ bit is set<br />

to 1, see c1, System Control Register (SCTLR) on page B4-45.<br />

The Undefined Instruction exception can be used for:<br />

software emulation of a coprocessor in a system that does not have the physical coprocessor hardware<br />

lazy context switching of coprocessor registers<br />

general-purpose instruction set extension by software emulation<br />

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

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

Saved successfully!

Ooh no, something went wrong!