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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Application Level Memory Model<br />

For applications of the <strong>ARM</strong>v7-R profile, there are some legacy code situations where the arrangement of<br />

the bytes in the object files cannot be adjusted by the linker. For these object files to be used by an <strong>ARM</strong>v7-R<br />

processor the byte order of the instructions must be reversed by the processor at runtime. Therefore, the<br />

<strong>ARM</strong>v7-R profile permits configuration of the instruction endianness.<br />

Instruction endianness static configuration, <strong>ARM</strong>v7-R only<br />

To provide support for legacy big-endian object code, the <strong>ARM</strong>v7-R profile supports optional byte order<br />

reversal hardware as a static option from reset. The <strong>ARM</strong>v7-R profile includes a read-only bit in the CP15<br />

Control Register, SCTLR.IE, bit [31]. For more information, see c1, System Control Register (SCTLR) on<br />

page B4-45.<br />

A3.3.3 Element size <strong>and</strong> endianness<br />

The effect of the endianness mapping on data transfers depends on the size of the data element or elements<br />

transferred by the load/store instructions. Table A3-5 lists the element sizes of all the load/store instructions,<br />

for all instruction sets.<br />

Instructions Element size<br />

LDRB, LDREXB, LDRBT, LDRSB, LDRSBT, STRB, STREXB, STRBT, SWPB, TBB Byte<br />

LDRH, LDREXH, LDRHT, LDRSH, LDRSHT, STRH, STREXH, STRHT, TBH Halfword<br />

LDR, LDRT, LDREX, STR, STRT, STREX Word<br />

LDRD, LDREXD, STRD, STREXD Word<br />

All forms of LDM, PUSH, POP, RFE, SRS, all forms of STM, SWP Word<br />

LDC, LDC2, STC, STC2, VLDM, VLDR, VSTM, VSTR Word<br />

Table A3-5 Element size of load/store instructions<br />

VLD1, VLD2, VLD3, VLD4, VST1, VST2, VST3, VST4 Element size of the Advanced SIMD access<br />

A3.3.4 Instructions to reverse bytes in a general-purpose register<br />

An application or device driver might have to interface to memory-mapped peripheral registers or shared<br />

memory structures that are not the same endianness as the internal data structures. Similarly, the endianness<br />

of the operating system might not match that of the peripheral registers or shared memory. In these cases,<br />

the processor requires an efficient method to transform explicitly the endianness of the data.<br />

In <strong>ARM</strong>v7, the <strong>ARM</strong> <strong>and</strong> Thumb instruction sets provide this functionality. There are instructions to:<br />

Reverse word (four bytes) register, for transforming big <strong>and</strong> little-endian 32-bit representations. See<br />

REV on page A8-272.<br />

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

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

Saved successfully!

Ooh no, something went wrong!