浏览代码

Small fix for build on test platforms

luojia65 4 年之前
父节点
当前提交
ce78730aa7
共有 1 个文件被更改,包括 7 次插入8 次删除
  1. 7 8
      rustsbi/src/privileged.rs

+ 7 - 8
rustsbi/src/privileged.rs

@@ -25,17 +25,16 @@
 #[inline]
 pub unsafe fn enter_privileged(mhartid: usize, dtb_pa: usize) -> ! {
     match () {
-        // todo: todo
-        // #[cfg(riscv)]
+        #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
         () => asm!("
             csrrw   sp, mscratch, sp
             mret
         ", in("a0") mhartid, in("a1") dtb_pa, options(nomem, noreturn)),
-        // #[cfg(not(riscv))]
-        // () => {
-        //     drop(mhartid);
-        //     drop(dtb_pa);
-        //     unimplemented!("not RISC-V instruction set architecture")
-        // }
+        #[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))]
+        () => {
+            drop(mhartid);
+            drop(dtb_pa);
+            unimplemented!("not RISC-V instruction set architecture")
+        }
     }
 }