|
@@ -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) {}
|