EasyManuals Logo

ARM ARM1176JZF-S User Manual

Default Icon
759 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #394 background imageLoading...
Page #394 background image
Level Two Interface
ARM DDI 0301H Copyright © 2004-2009 ARM Limited. All rights reserved. 8-7
ID012310 Non-Confidential, Unrestricted Access
8.2.2 Store-exclusive instruction
Store-exclusive performs a conditional store to memory. The store only takes place if the
physical address is tagged as exclusive-access for the requesting processor. This operation
returns a status value. If the store updates memory the return value is 0, otherwise it is 1. In both
cases, the physical address is no longer tagged as exclusive-access for any processor.
8.2.3 Example of LDREX and STREX usage
This is an example of typical usage. Suppose you are trying to claim a lock:
Lock address : LockAddr
Lock free : 0x00
Lock taken : 0xFF
MOV R1, #0xFF ; load the ‘lock taken’ value
try LDREX R0, [LockAddr] ; load the lock value
CMP R0, #0 ; is the lock free?
STREXEQ R0, R1, [LockAddr] ; try and claim the lock
CMPEQ R0, #0 ; did this succeed?
BNE try ; no – try again ....
; yes – we have the lock
The typical case, where the lock is free and you have exclusive-access, is six instructions.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ARM ARM1176JZF-S and is the answer not in the manual?

ARM ARM1176JZF-S Specifications

General IconGeneral
BrandARM
ModelARM1176JZF-S
CategoryComputer Hardware
LanguageEnglish

Related product manuals