amd64: add cache flushing mechanism
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
86091c6acb
commit
f0337ee0fd
4 changed files with 34 additions and 1 deletions
|
|
@ -3,3 +3,4 @@ obj-y += msr.o
|
|||
obj-y += page.o
|
||||
obj-y += reg.o
|
||||
obj-y += stack.o
|
||||
obj-y += cache.o
|
||||
|
|
|
|||
16
amd64/arch/cache.S
Normal file
16
amd64/arch/cache.S
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
.intel_syntax noprefix
|
||||
|
||||
.global cache_flush_range
|
||||
cache_flush_range:
|
||||
and rdi, ~0x3f
|
||||
add rsi, rdi
|
||||
cmp rdi, rsi
|
||||
jae .done
|
||||
.loop:
|
||||
clflush [rdi]
|
||||
add rdi, 64
|
||||
cmp rdi, rsi
|
||||
jb .loop
|
||||
.done:
|
||||
mfence
|
||||
ret
|
||||
Loading…
Reference in a new issue