Memory Management Unit
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
6-25
ID012310
Non-Confidential, Unrestricted Access
2.
If A1 and A2 are generated by the same instruction, then:
•
If A1 and A2 are the load and store generated by a SWP or SWPB instruction, then:
—
A1 < A2 if A1 is the load and A2 is the store
—
A2 < A1 if A2 is the load and A1 is the store.
•
If A1 and A2 are two word loads generated by an LDC, LDRD, or LDM instruction,
or two word stores generated by an STC, STRD, or STM instruction, but excluding
LDM or STM instructions whose register list includes the PC, then:
—
A1 <= A2 if the address of A1 is less than the address of A2
—
A2 <= A1 if the address of A2 is less than the address of A1.
•
If A1 and A2 are two word loads generated by an LDM instruction whose register
list includes the PC or two word stores generated by an STM instruction whose
register list includes the PC, then the program order of the memory operations is not
defined.
Multiple load and store instructions, such as LDM, LDRD, STM, and STRD, generate multiple
word accesses, each being a separate access to determine ordering.
6.7.5
Explicit Memory Barriers
This section describes two explicit Memory Barrier operations:
•
Data Memory Barrier
•
Data Synchronization Barrier.
In addition, to ensure correct operation where the processor writes code, an explicit Flush
Prefetch Buffer operation is provided.
These operations are implemented by writing to the CP15 Cache operation register c7. For
details on how to use this register see
c7, Cache operations
on page 3-69. For more information
on explicit memory barriers, see the
ARM Architecture Reference Manual
.
Data Memory Barrier
This memory barrier ensures that all explicit memory transactions occurring in program order
before this instruction are completed. No explicit memory transactions occurring in program
order after this instruction are started until this instruction completes. Other instructions can
complete out of order with the Data Memory Barrier instruction.
Data Synchronization Barrier
This memory barrier completes when all explicit memory transactions occurring in program
order before this instruction are completed. No explicit memory transactions occurring in
program order after this instruction are started until this instruction completes. In fact, no
instructions occurring in program order after the Data Synchronization Barrier complete, or
change the interrupt masks, until this instruction completes.
Flush Prefetch Buffer
The Flush Prefetch Buffer operation flushes the pipeline in the processor, so that all instructions
following the pipeline flush are fetched from memory, including the cache, after the instruction
has been completed. Combined with Data Synchronization Barrier, and potentially invalidating
the Instruction Cache, this ensures that any instructions written by the processor are executed.
This guarantee is required as part of the mechanism for handling self-modifying code.
Performing a Data Synchronization Barrier operation and invalidating the Instruction Cache and
Branch Target Cache are also required for the handling of self-modifying code. The Flush