From e4768ccb66f27bda04348850fae0ba781db7114d Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sun, 18 Jul 2021 17:19:50 +0800 Subject: [PATCH] Replace llvm_asm! with asm --- os/src/main.rs | 2 +- os/src/sbi.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/os/src/main.rs b/os/src/main.rs index a74cc21a..6baf556f 100644 --- a/os/src/main.rs +++ b/os/src/main.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] #![feature(global_asm)] -#![feature(llvm_asm)] +#![feature(asm)] #![feature(panic_info_message)] #[macro_use] diff --git a/os/src/sbi.rs b/os/src/sbi.rs index a9387062..a2970f8a 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -14,11 +14,12 @@ const SBI_SHUTDOWN: usize = 8; fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize { let mut ret; unsafe { - llvm_asm!("ecall" - : "={x10}" (ret) - : "{x10}" (arg0), "{x11}" (arg1), "{x12}" (arg2), "{x17}" (which) - : "memory" - : "volatile" + asm!( + "ecall", + inlateout("x10") arg0 => ret, + in("x11") arg1, + in("x12") arg2, + in("x17") which, ); } ret