From e87fb6a4cbc5da15b229256214fd426ddb000764 Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Tue, 21 Jun 2022 23:57:33 +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 8e0c8567..50fcd975 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 { core::arch::asm!( + "li x16, 0", "ecall", inlateout("x10") arg0 => ret, in("x11") arg1,