diff options
author | 2020-04-24 13:53:11 -0700 | |
---|---|---|
committer | 2020-04-24 13:53:11 -0700 | |
commit | 7dfc9751ee1c13a863074fe693fb01c8716ab5c3 (patch) | |
tree | 449ce71f8605179d08e23e566d7a7677afa229e6 /src/lib.rs | |
parent | 5230e09a05b44ae9993d1e1c72be9abf0f689428 (diff) | |
download | rust-x86-7dfc9751ee1c13a863074fe693fb01c8716ab5c3.tar.gz rust-x86-7dfc9751ee1c13a863074fe693fb01c8716ab5c3.tar.zst rust-x86-7dfc9751ee1c13a863074fe693fb01c8716ab5c3.zip |
llvm_asm! instead of asm! to compile on nightly.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,6 +1,6 @@ #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] #![allow(stable_features)] -#![feature(asm, core_intrinsics)] +#![feature(llvm_asm, core_intrinsics)] #![no_std] #![cfg_attr(test, allow(unused_features))] #![cfg_attr(all(test, feature = "vmtest"), feature(custom_test_frameworks))] @@ -88,7 +88,7 @@ pub enum Ring { /// Will cause a general protection fault if used outside of ring 0. #[inline(always)] pub unsafe fn halt() { - asm!("hlt" :::: "volatile"); + llvm_asm!("hlt" :::: "volatile"); } #[cfg(all(test, feature = "vmtest"))] @@ -115,7 +115,7 @@ mod x86testing { #[inline(always)] pub unsafe fn rdpid() -> u64 { let mut pid: u64; - asm!("rdpid $0" : "=r"(pid)); + llvm_asm!("rdpid $0" : "=r"(pid)); return pid; } |