![Intel IXP45X Скачать руководство пользователя страница 91](http://html1.mh-extra.com/html/intel/ixp45x/ixp45x_developers-manual_2073092091.webp)
Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
August 2006
Developer’s Manual
Order Number: 306262-004US
91
Intel XScale
®
Processor—Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
This same register also provides the command to invalidate the entire data cache and
mini-data cache. Refer to
Table 20, “Cache Functions” on page 104
for a listing of the
commands. These global invalidate commands have no effect on lines locked in the
data cache. Locked lines must be unlocked before they can be invalidated. This is
accomplished by the Unlock Data Cache command found in
.
A simple software routine is used to globally clean the data cache. It takes advantage
of the line-allocate data cache operation, which allocates a line into the data cache.
This allocation evicts any cache dirty data back to external memory.
how data cache can be cleaned.
The line-allocate operation does not require physical memory to exist at the virtual
address specified by the instruction, since it does not generate a load/fill request to
external memory. Also, the line-allocate operation does not set the 32 bytes of data
associated with the line to any known value. Reading this data will produce
unpredictable results.
The line-allocate command will not operate on the mini Data Cache, so system software
must clean this cache by reading 2KByte of contiguous unused data into it. This data
must be unused and reserved for this purpose so that it will not already be in the
cache. It must reside in a page that is marked as mini Data Cache cacheable (see
).
Example 9. Global Clean Operation
; Global Clean/Invalidate THE DATA CACHE
; R1 contains the virtual address of a region of cacheable memory reserved for
; this clean operation
; R0 is the loop count; Iterate 1024 times which is the number of lines in the
; data cache
;; Macro ALLOCATE performs the line-allocation cache operation on the
;; address specified in register Rx.
;;
MACRO ALLOCATE Rx
MCR P15, 0, Rx, C7, C2, 5
ENDM
MOV R0, #1024
LOOP1:
ALLOCATE R1
; Allocate a line at the virtual address
; specified by R1.
ADD R1, R1, #32
; Increment the address in R1 to the next cache line
SUBS R0, R0, #1
; Decrement loop count
BNE LOOP1
;
;Clean the Mini-data Cache
; Can’t use line-allocate command, so cycle 2KB of unused data through.
; R2 contains the virtual address of a region of cacheable memory reserved for
; cleaning the Mini-data Cache
; R0 is the loop count; Iterate 64 times which is the number of lines in the
; Mini-data Cache.
MOV R0, #64
LOOP2:
LDR R3,[R2],#32 ; Load and increment to next cache line
SUBS R0, R0, #1
; Decrement loop count
BNE LOOP2
;
; Invalidate the data cache and mini-data cache
MCR P15, 0, R0, C7, C6, 0
;