📄 flushic.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.
//
#include <kxmips.h>
#define __MIPS_ASSEMBLER
#include <oal_cache.h>
#define KSEG0_BASE 0x80000000
//------------------------------------------------------------------------------
//
// Function: OALFlushICache()
//
// This function flush and invalidate all instruction cache
//
LEAF_ENTRY(OALFlushICache)
.set noreorder
// Get cache info address
la t7, g_oalCacheInfo
// Get cache size
lw t0, L1ISize(t7)
// Get cache line size
lw t1, L1ILineSize(t7)
// Get the VA with which to index the cache -- since
// it will go through the MMU, use a KSEG0 address
// to avoid causing TLB faults
li t2, KSEG0_BASE
// Get the last address in this range to process
addu t3, t2, t0
subu t3, t1
// loop through the cache
10: cache INDEX_INVALIDATE_I, 0(t2)
bne t3, t2, 10b
addu t2, t1 // increment in delay slot
// return to the caller
j ra
nop
.end OALFlushICache
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -