aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Gerd Zellweger <mail@gerdzellweger.com> 2021-09-29 23:34:39 -0700
committerGravatar Gerd Zellweger <mail@gerdzellweger.com> 2021-09-29 23:34:39 -0700
commitb0dcf8dd08b0a817510d2f55e8bc25edcc4f8809 (patch)
tree83d6ec011b36fc033eb12c2f4bdc78613a26a385 /src/lib.rs
parent4cdaaa20c5e07c4fd90414581de06c3a469784f2 (diff)
downloadrust-x86-b0dcf8dd08b0a817510d2f55e8bc25edcc4f8809.tar.gz
rust-x86-b0dcf8dd08b0a817510d2f55e8bc25edcc4f8809.tar.zst
rust-x86-b0dcf8dd08b0a817510d2f55e8bc25edcc4f8809.zip
Convert some things to asm! syntax.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2c6aec5..a98bf1e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -90,7 +90,7 @@ pub enum Ring {
/// Will cause a general protection fault if used outside of ring 0.
#[inline(always)]
pub unsafe fn halt() {
- llvm_asm!("hlt" :::: "volatile");
+ asm!("hlt", options(att_syntax, nomem, nostack)); // check if preserves_flags
}
#[cfg(all(test, feature = "vmtest"))]
@@ -117,7 +117,7 @@ mod x86testing {
#[inline(always)]
pub unsafe fn rdpid() -> u64 {
let mut pid: u64;
- llvm_asm!("rdpid $0" : "=r"(pid));
+ asm!("rdpid {pid}", pid = out(reg) pid, options(att_syntax));
pid
}