aboutsummaryrefslogtreecommitdiff
path: root/src/dtables.rs
diff options
context:
space:
mode:
authorGravatar Gerd Zellweger <mail@gerdzellweger.com> 2020-04-24 13:53:11 -0700
committerGravatar Gerd Zellweger <mail@gerdzellweger.com> 2020-04-24 13:53:11 -0700
commit7dfc9751ee1c13a863074fe693fb01c8716ab5c3 (patch)
tree449ce71f8605179d08e23e566d7a7677afa229e6 /src/dtables.rs
parent5230e09a05b44ae9993d1e1c72be9abf0f689428 (diff)
downloadrust-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/dtables.rs')
-rw-r--r--src/dtables.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dtables.rs b/src/dtables.rs
index 2bbca40..780d6d4 100644
--- a/src/dtables.rs
+++ b/src/dtables.rs
@@ -56,12 +56,12 @@ impl<T> fmt::Debug for DescriptorTablePointer<T> {
/// Load the GDTR register with the specified base and limit.
pub unsafe fn lgdt<T>(gdt: &DescriptorTablePointer<T>) {
- asm!("lgdt ($0)" :: "r" (gdt) : "memory");
+ llvm_asm!("lgdt ($0)" :: "r" (gdt) : "memory");
}
/// Retrieve base and limit from the GDTR register.
pub unsafe fn sgdt<T>(idt: &mut DescriptorTablePointer<T>) {
- asm!("sgdt ($0)" : "=r" (idt as *mut DescriptorTablePointer<T>) :: "memory");
+ llvm_asm!("sgdt ($0)" : "=r" (idt as *mut DescriptorTablePointer<T>) :: "memory");
}
/// Loads the segment selector into the selector field of the local
@@ -72,7 +72,7 @@ pub unsafe fn sgdt<T>(idt: &mut DescriptorTablePointer<T>) {
/// the segment descriptor for the LDT in the global
/// descriptor table (GDT).
pub unsafe fn load_ldtr(selector: SegmentSelector) {
- asm!("lldt $0" :: "r" (selector.bits()) : "memory");
+ llvm_asm!("lldt $0" :: "r" (selector.bits()) : "memory");
}
/// Returns the segment selector from the local descriptor table register (LDTR).
@@ -81,16 +81,16 @@ pub unsafe fn load_ldtr(selector: SegmentSelector) {
/// (located in the GDT) for the current LDT.
pub unsafe fn ldtr() -> SegmentSelector {
let selector: u16;
- asm!("sldt $0" : "=r"(selector));
+ llvm_asm!("sldt $0" : "=r"(selector));
SegmentSelector::from_raw(selector)
}
/// Load the IDTR register with the specified base and limit.
pub unsafe fn lidt<T>(idt: &DescriptorTablePointer<T>) {
- asm!("lidt ($0)" :: "r" (idt) : "memory");
+ llvm_asm!("lidt ($0)" :: "r" (idt) : "memory");
}
/// Retrieve base and limit from the IDTR register.
pub unsafe fn sidt<T>(idt: &mut DescriptorTablePointer<T>) {
- asm!("sidt ($0)" : "=r" (idt as *mut DescriptorTablePointer<T>) :: "memory");
+ llvm_asm!("sidt ($0)" : "=r" (idt as *mut DescriptorTablePointer<T>) :: "memory");
}