impl sfence_vma & sfence_vma_all
This commit is contained in:
parent
4e16dd85ed
commit
9dc7b40fdd
12
src/asm.rs
12
src/asm.rs
|
@ -22,3 +22,15 @@ instruction!(uret, "uret");
|
|||
instruction!(sret, "sret");
|
||||
instruction!(mret, "mret");
|
||||
instruction!(wfi, "wfi");
|
||||
instruction!(sfence_vma_all, "sfence.vma");
|
||||
|
||||
|
||||
#[inline]
|
||||
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
|
||||
pub unsafe fn sfence_vma(asid: usize, addr: usize) {
|
||||
asm!("sfence.vma $0, $1" :: "r"(asid), "r"(addr) :: "volatile");
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
|
||||
pub fn sfence_vma(_asid: usize, _addr: usize) {}
|
||||
|
|
Loading…
Reference in New Issue