![Intel IXP45X Скачать руководство пользователя страница 81](http://html1.mh-extra.com/html/intel/ixp45x/ixp45x_developers-manual_2073092081.webp)
Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
August 2006
Developer’s Manual
Order Number: 306262-004US
81
Intel XScale
®
Processor—Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
The entire instruction cache along with the fetch buffers are invalidated by writing to
coprocessor 15, register 7. (See
Table 20, “Cache Functions” on page 104
for the exact
command.) The invalidate command does not unlock any lines that were locked in the
instruction cache nor does it invalidate those locked lines. To invalidate the entire cache
including locked lines, the unlock instruction cache command needs to be executed
before the invalidate command. The unlock command can also be found in
“Cache Lock-Down Functions” on page 105
.
There is an inherent delay from the execution of the instruction cache invalidate
command to where the next instruction will see the result of the invalidate. The
following routine can be used to guarantee proper synchronization.
The Intel XScale processor also supports invalidating an individual line from the
instruction cache. See
Table 20, “Cache Functions” on page 104
for the exact
command.
Software has the ability to lock performance critical routines into the instruction cache.
Up to 28 lines in each set can be locked; hardware will ignore the lock command if
software is trying to lock all the lines in a particular set (i.e., ways 28-31can never be
locked). When all ways in a particular set are requested to be locked, the instruction
cache line will still be allocated into the cache but the lock will be ignored. The round-
robin pointer will stay at way 31 for that set.
Cache lines can be locked into the instruction cache by initiating a write to
Table 22, “Cache Lock-Down Functions” on page 105
for the
exact command.) Register Rd contains the virtual address of the line to be locked into
the cache.
There are several requirements for locking down code:
• The routine used to lock lines down in the cache must be placed in non-cacheable
memory, which means the MMU is enabled.
As a result: no fetches of cacheable code should occur while locking instructions
into the cache.
Example 5. Enabling the Instruction Cache
; Enable the ICache
MRC P15, 0, R0, C1, C0, 0
; Get the control register
ORR R0, R0, #0x1000
; set bit 12 -- the I bit
MCR P15, 0, R0, C1, C0, 0
; Set the control register
CPWAIT
Example 6. Invalidating the Instruction Cache
MCR P15,0,R1,C7,C5,0
; Invalidate the instruction cache and branch
; target buffer
CPWAIT
; The instruction cache is guaranteed to be invalidated at this point; the next
; instruction sees the result of the invalidate command.