From 03a7e2f0b95752a2d056c4000fdbb3fe189885f2 Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Tue, 21 Jun 2022 23:45:12 +0800 Subject: [PATCH] sbi spec uses a6, a7 as sbicall id, so we need to set a6 to 0 --- os/src/sbi.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/os/src/sbi.rs b/os/src/sbi.rs index 2e2804b2..cfd59a07 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -17,6 +17,7 @@ fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let mut ret; unsafe { asm!( + "li x16, 0", "ecall", inlateout("x10") arg0 => ret, in("x11") arg1,