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

This commit is contained in:
Yifan Wu 2021-08-26 19:51:08 +08:00
parent 859afce7e3
commit 5a24228565
5 changed files with 8 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View file

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

View file

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

View file

@ -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