Update rustc && rustsbi; llvm_asm -> asm in user

ch3-dev
Yifan Wu 4 years ago
parent 5276068c27
commit 254bd6f8c3

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
nightly
nightly-2021-08-25

@ -1,5 +1,5 @@
#![no_std]
#![feature(llvm_asm)]
#![feature(asm)]
#![feature(linkage)]
#![feature(panic_info_message)]

@ -6,11 +6,12 @@ const SYSCALL_GET_TIME: usize = 169;
fn syscall(id: usize, args: [usize; 3]) -> isize {
let mut ret: isize;
unsafe {
llvm_asm!("ecall"
: "={x10}" (ret)
: "{x10}" (args[0]), "{x11}" (args[1]), "{x12}" (args[2]), "{x17}" (id)
: "memory"
: "volatile"
asm!(
"ecall",
inlateout("x10") args[0] => ret,
in("x11") args[1],
in("x12") args[2],
in("x17") id
);
}
ret

Loading…
Cancel
Save