cleanuc.s

来自「Windows CE 6.0 BSP for VOIPAC Board (PXA」· S 代码 · 共 85 行

S
85
字号
;
; 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: cleanuc.s
;
;  This file implement OALCleanUCache function.
;
        INCLUDE kxarm.h
        INCLUDE armmacros.s
        INCLUDE oal_cache.inc

        IMPORT g_oalCacheInfo

        TEXTAREA

;-------------------------------------------------------------------------------
;
;  Function:  OALClearUCache
;

        LEAF_ENTRY OALCleanUCache

        ; save registers
        stmfd   sp!, {r4,r5}

        ldr     r0, =g_oalCacheInfo

        ; first we need to get index bit
        ldr     r1, [r0, #L1DNumWays]
        mov     r5, #32
10      movs    r1, r1, lsr #1
        beq     %F20
        sub     r5, r5, #1
        b       %B10
20      

        ldr     r1, [r0, #L1DNumWays]
        sub     r1, r1, #1
        mov     r1, r1, lsl r5
        mov     r2, #1
        mov     r2, r2, lsl r5
        
        ldr     r3, [r0, #L1DLineSize]
30      ldr     r4, [r0, #L1DSetsPerWay]

        mov     r5, r1
        
        ; clean line
40      mcr     p15, 0, r5, c7, c11, 2

        ; add the set index
        add     r5, r5, r3

        ; decrement the set number
        subs    r4, r4, #1
        bgt     %b40

        ; test last index
        cmp     r1, #0
        beq     %f50
        
        ; decrement index
        sub     r1, r1, r2
        b       %b30

        ; drain the write buffer
50      mov     r0, #0
        mcr     p15, 0, r0, c7, c10, 4
    
        ; restore registers
        ldmfd   sp!, {r4,r5}

        RETURN

        END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?