![Intel XScale Core Скачать руководство пользователя страница 31](http://html.mh-extra.com/html/intel/xscale-core/xscale-core_developers-manual_2073165031.webp)
Developer’s Manual
January, 2004
31
Intel XScale® Core
Developer’s Manual
Programming Model
2.3.3
Additions to CP15 Functionality
To accommodate the functionality in the Intel XScale
®
core, registers in CP15 and CP14 have been
added or augmented. See
Chapter 7, “Configuration”
for details.
At times it is necessary to be able to guarantee exactly when a CP15 update takes effect. For
example, when enabling memory address translation (turning on the MMU), it is vital to know
when the MMU is actually guaranteed to be in operation. To address this need, a processor-specific
code sequence is defined for the core. The sequence -- called CPWAIT -- is shown in
Example 2-1
on page 2-31
.
Example 2-1. CPWAIT: Canonical method to wait for CP15 update
When setting multiple CP15 registers, system software may opt to delay the assurance of their
update. This is accomplished by executing CPWAIT only after the sequence of MCR instructions.
Note:
The CPWAIT sequence guarantees that CP15 side-effects are complete by the time the CPWAIT is
complete. It is possible, however, that the CP15 side-effect will take place before CPWAIT
completes or is issued. Programmers should take care that this does not affect the correctness of
their code.
;; The following macro should be used when software needs to be
;; assured that a CP15 update has taken effect.
;; It may only be used while in a privileged mode, because it
;; accesses CP15.
MACRO CPWAIT
MRC P15, 0, R0, C2, C0, 0
; arbitrary read of CP15
MOV R0, R0
; wait for it
SUB PC, PC, #4
; branch to next instruction
; At this point, any previous CP15 writes are
; guaranteed to have taken effect.
ENDM