Replace llvm_asm! with asm

This commit is contained in:
Yifan Wu 2021-07-18 19:21:16 +08:00
parent 4388e6ddec
commit 258516a3ca
6 changed files with 23 additions and 16 deletions

View file

@ -86,10 +86,15 @@ pub fn trap_return() -> ! {
}
let restore_va = __restore as usize - __alltraps as usize + TRAMPOLINE;
unsafe {
llvm_asm!("fence.i" :::: "volatile");
llvm_asm!("jr $0" :: "r"(restore_va), "{a0}"(trap_cx_ptr), "{a1}"(user_satp) :: "volatile");
asm!(
"fence.i",
"jr {restore_va}",
restore_va = in(reg) restore_va,
in("a0") trap_cx_ptr,
in("a1") user_satp,
options(noreturn)
);
}
panic!("Unreachable in back_to_user!");
}
#[no_mangle]