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.

Examples<br />

<strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 Differences<br />

The distinction between BE <strong>and</strong> BE-32 is not visible if all agents use the same endian format, because a<br />

given memory address always accesses the same location in memory. However, if there are two agents with<br />

different endianness the effect is as shown in Example H-1 <strong>and</strong> Example H-2.<br />

Example H-1 Distinction between BE <strong>and</strong> BE-32 word stores observed by an LE agent<br />

In this example:<br />

Agent1 is big endian, R1=0x1000, R2=0x11223344<br />

Agent2 is little endian, R1=0x1000.<br />

Agent1:<br />

Agent2:<br />

STR R2, [R1]<br />

LDR R2, [R1] // If Agent1 uses BE-32 endian format: R2 = 0x11223344<br />

// If Agent1 uses BE endian format: R2 = 0x44332211<br />

Example H-2 Distinction between BE <strong>and</strong> BE-32 byte stores observed by an LE agent<br />

In this example:<br />

Agent1 is big endian, R1=0x1000, R2=0x44, R3=0x11<br />

Agent2 is little endian, R1=0x1000.<br />

Agent1:<br />

Agent2:<br />

STRB R2, [R1]<br />

STRB R3, [R1, #3]<br />

H.3.3 Semaphore support<br />

LDRB R2, [R1] // If Agent1 uses BE-32 endian format: R2 = 0x11<br />

// If Agent1 uses BE endian format: R2 = 0x44<br />

The only semaphore support in <strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 is provided by the SWP <strong>and</strong> SWPB <strong>ARM</strong> instructions. Use<br />

of these instructions is deprecated in <strong>ARM</strong>v6 <strong>and</strong> <strong>ARM</strong>v7 in favour of the exclusive access mechanism<br />

provided by LDREX, STREX, <strong>and</strong> related instructions.<br />

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

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

Saved successfully!

Ooh no, something went wrong!