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] #![no_std]
#![feature(llvm_asm)] #![feature(asm)]
#![feature(linkage)] #![feature(linkage)]
#![feature(panic_info_message)] #![feature(panic_info_message)]

View file

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