📄 lockcache.s
字号:
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;
; Use of this source code is subject to the terms of the Microsoft end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to use
; this source code. For a copy of the EULA, please see the LICENSE.RTF on your
; install media.
;
;-------------------------------------------------------------------------------
;
; File: flushdc.s
;
; This file implement OALFlushDCache function for ARM926 CPU.
;
AREA CacheLock, CODE, READONLY
; the OALLockCache function descriptor
; r0 ---> the start addr for lock cahce
; r1 ----> the numbers of the ways that will be locked
; r2 ---> the flag for ICache or DCache
LockCache
EXPORT LockCache
mrs r3, spsr
orr r3, r3, #0xc0
msr spsr_cxsf, r3
cmp r1, #0
beq unlock
tst r2, #0x01
beq exit
mrc p15, 0, r3, c9, c0, 1
bic r3, r3, #0xf
orr r3, r3, #0xe
mcr p15, 0, r3, c9, c0, 1
ldr r10, =128 ;[r4, #L1ISetsPerWay]
10
mcr p15, 0, r0, c7, c5, 1
mcr p15, 0, r0, c7, c13, 1
add r0, r0, #32
subs r10, r10, #1
bgt %b10
mrc p15, 0, r3, c9, c0, 1
bic r3, r3, #0xe
orr r3, r3, #1
mcr p15, 0, r3, c9, c0, 1
b exit
unlock
mrc p15, 0, r3, c9, c0, 1
bic r3, r3, #0xf
mcr p15, 0, r3, c9, c0, 1
exit
mrs r3, spsr
bic r3, r3, #0xc0
msr spsr_cxsf, r3
bx lr
FlushICache
EXPORT FlushICache
mov r0, #0
mcr p15, 0, r0, c7, c5, 0
bx lr
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -