📄 cach1100.s
字号:
TEXTAREA
LEAF_ENTRY TLBClear
;++
; Routine Description:
; Flush and invalidate the Instruction & Data TLBs
;
; Syntax:
; void TLBClear(void);
;
; Arguments:
; -- none --
;
; Return Value:
; -- none --
;--
mcr p15, 0, r0, c8, c7, 0 ; flush I+D TLBs
IF Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF
LEAF_ENTRY FlushICache
;++
; Routine Description:
; Flush and invalidate the Instruction Cache
;
; Syntax:
; void FlushICache(void);
;
; Arguments:
; -- none --
;
; Return Value:
; -- none --
;--
mcr p15, 0, r0, c7, c5, 0 ; flush the icache
IF Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF
LEAF_ENTRY FlushDCache
;++
; Routine Description:
; Flush and invalidate the Data Cache
;
; The following code is called to flush the dcache on the SA1100
; it currently flushes the main dcache, then baby dcache.
;
; The cache flush is done by reading 8K of the c=1/b=1 zero space. this will
; cause the needed number of misses and fills to force any dirty data
; that is in the cache to be pushed out. For the baby cache an additional
; read of 1KB is done from the c=1/b=0 zero space
;
; at the end of this routine any data in cache at call has been invalidated
; if interrupted other data may be in the cache and all the blocks of zeros
; may also be there.
;
; Syntax:
; void FlushDCache(void);
;
; Arguments:
; -- none --
;
; Return Value:
; -- none --
; r0..r2 junk
; CC flags junk
;--
;first do main dcache
;++ next line should be a symb
; change once tom adds it in
mov r0, #0x88000000
add r0, r0, #0x00C00000 ; get pointer to C=1/B=1 zero space
mov r1, #256 ; get count of blocks to read
; 8KB / 32Bytes/block = 256 blocks
10
ldr r2, [r0], #+32 ; take a miss and inc the pointer
subs r1, r1, #1 ; dec the count
bne %b10 ; loop till done
;now do baby dcache
mov r0, #0x88000000
add r0, r0, #0x00D00000 ; get pointer to C=1/B=0 zero space
mov r1, #32 ; get count of blocks to read
; .5KB / 32Bytes/block = 16 blocks * 2 for LRU = 32
20
ldr r2, [r0], #+32 ; take a miss and inc the pointer
subs r1, r1, #1 ; dec the count
bne %b20 ; loop till done
IF Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -