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 />

Accessing the execution state bits<br />

The execution state bits are the IT[7:0], J, E, <strong>and</strong> T bits. In exception modes you can read or write these bits<br />

in the current SPSR.<br />

In the CPSR, unless the processor is in Debug state:<br />

The execution state bits, other than the E bit, are RAZ when read by an MRS instruction.<br />

Writes to the execution state bits, other than the E bit, by an MSR instruction are:<br />

— For <strong>ARM</strong>v7 <strong>and</strong> <strong>ARM</strong>v6T2, ignored in all modes.<br />

— For architecture variants before <strong>ARM</strong>v6T2, ignored in User mode <strong>and</strong> required to write zeros<br />

in privileged modes. If a nonzero value is written in a privileged mode, behavior is<br />

UNPREDICTABLE.<br />

Instructions other than MRS <strong>and</strong> MSR that access the execution state bits can read <strong>and</strong> write them in any mode.<br />

Unlike the other execution state bits in the CPSR, CPSR.E can be read by an MRS instruction <strong>and</strong> written by<br />

an MSR instruction. However, using the CPSR.E value read by an MRS instruction is deprecated, <strong>and</strong> using an<br />

MSR instruction to change the value of CPSR.E is deprecated.<br />

Note<br />

Use the SETEND instruction to change the current endianness.<br />

To determine the current endianness, use an LDR instruction to load a word of memory whose value is<br />

known <strong>and</strong> will differ if the endianness is reversed. For example, use an LDR (literal) instruction to<br />

load a word whose four bytes are 0x01, 0x00, 0x00, <strong>and</strong> 0x00 in ascending order of memory address.<br />

The LDR instruction loads the destination register with:<br />

— 0x00000001 if the current endianness is little-endian<br />

— 0x01000000 if the current endianness is big-endian.<br />

For more information about the behavior of these bits in Debug state see Behavior of the PC <strong>and</strong> CPSR in<br />

Debug state on page C5-7.<br />

Non-maskable fast interrupts<br />

Exceptions, debug events <strong>and</strong> checks on page A2-81 introduces the two levels of external interrupts to an<br />

<strong>ARM</strong> processor, Interrupt Requests or IRQs <strong>and</strong> higher priority Fast Interrupt Requests or FIQs. Both IRQs<br />

<strong>and</strong> FIQs can be masked by bits in the CPSR, see Program Status Registers (PSRs) on page B1-14:<br />

when the CPSR.I bit is set to 1, IRQ interrupts are masked<br />

when the CPSR.F bit is set to 1, FIQ interrupts are masked.<br />

<strong>ARM</strong>v7 supports an operating mode where FIQs are not maskable by software. This Non-maskable Fast<br />

Interrupt (NMFI) operation is controlled by a configuration input signal to the processor, that is asserted<br />

HIGH to enable NMFI operation. There is no software control of NMFI operation.<br />

Software can detect whether FIQs are maskable by reading the SCTLR.NMFI bit:<br />

NMFI == 0 Software can mask FIQs by setting the CPSR.F bit to 1<br />

NMFI == 1 Software cannot mask FIQs.<br />

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

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

Saved successfully!

Ooh no, something went wrong!