Caches
3-14
Copyright © ARM Limited 2000. All rights reserved.
7.
Write to CP15 register 9, setting IL=0 and Iindex=1.
If there are more instructions to lockdown, at the final step, the IL bit must be left HIGH
and the process repeated. The IL bit must only be set LOW when all the lockdown
instructions have been loaded. The Iindex bits must be set to the next available segment.
The only significant difference between the sequence of operations for the DCache and
ICache is that an
MCR
instruction must be used to force the linefill in the ICache, instead
of an
LDR
. The rest of the sequence is the same as for DCache lockdown.
The
MCR
to perform the ICache fetch is a CP15 register 7 operation:
MCR p15, 0, Rd, c7, c13, 1
Example ICache lockdown subroutine
A subroutine that you can use to lock down code in the ICache is:
; Subroutine lock_i_cache
; r1 contains the start address
; r2 contains the end address
; Assumes that r2 - r1 fits within one cache set
; The subroutine performs a lockdown of instructions in the
; instruction cache
; It first reads the current lock_down index and then locks
; down the number of sets required
; Note - This subroutine must be located in a noncachable
; region of memory
; - Interrupts must be disabled
; - Subroutine must be called using the BL instruction
; - r1-r3 can be corrupted in line with ARM/Thumb
; Procedure Call Standards (ATPCS)
; - Returns final ICache lockdown index in r0 if successful
; - Returns 0xFFFFFFFF in r0 if an error occurred
lock_I_cache
BIC
r1, r1, #0x7f
;Align address to cache line
MRC
p15, 0, r3, c9, c0, 1
;Get current ICache index
AND
r3, r3, #0x3
;Mask unwanted bits
CMP
r3, #0x3
;Check for available set
BEQ
error
;If no sets available,
;generate an error
ORR r3, r3, #0x8000000
;Set the lockdown bit
MCR p15, 0, r3, c9, c0, 1
;Write lockdown register
Содержание ARM946E-S
Страница 1: ...ARM DDI 0155A ARM946E S Technical Reference Manual ...
Страница 6: ...vi Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A 04 Limited Confidential ...
Страница 54: ...Programmer s Model 2 34 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Страница 70: ...Caches 3 16 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Страница 78: ...Protection Unit 4 8 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Страница 98: ...Bus Interface Unit and Write Buffer 6 14 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Страница 112: ...Coprocessor Interface 7 14 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...