Update rustc && rustsbi; llvm_asm -> asm in user
This commit is contained in:
parent
859afce7e3
commit
5a24228565
5 changed files with 8 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue