xref: /DragonOS/kernel/src/arch/x86_64/mm/barrier.rs (revision 06b09f34ed64a006a80ae8df383e3c8b176f02e0)
1 #![allow(dead_code)]
2 use core::arch::asm;
3 
4 #[inline(always)]
mfence()5 pub fn mfence() {
6     unsafe {
7         asm!("mfence");
8     }
9 }
10 
11 #[inline(always)]
lfence()12 pub fn lfence() {
13     unsafe {
14         asm!("lfence");
15     }
16 }
17 
18 #[inline(always)]
sfence()19 pub fn sfence() {
20     unsafe {
21         asm!("sfence");
22     }
23 }
24