aboutsummaryrefslogtreecommitdiff
path: root/src/io.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/io.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/io.rs')
-rw-r--r--src/io.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/io.rs b/src/io.rs
index 27f9d49..6b1139b 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -3,42 +3,42 @@
/// Write 8 bits to port
#[inline]
pub unsafe fn outb(port: u16, val: u8) {
- asm!("outb %al, %dx" :: "{dx}"(port), "{al}"(val));
+ llvm_asm!("outb %al, %dx" :: "{dx}"(port), "{al}"(val));
}
/// Read 8 bits from port
#[inline]
pub unsafe fn inb(port: u16) -> u8 {
let ret: u8;
- asm!("inb %dx, %al" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
+ llvm_asm!("inb %dx, %al" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
ret
}
/// Write 16 bits to port
#[inline]
pub unsafe fn outw(port: u16, val: u16) {
- asm!("outw %ax, %dx" :: "{dx}"(port), "{al}"(val));
+ llvm_asm!("outw %ax, %dx" :: "{dx}"(port), "{al}"(val));
}
/// Read 16 bits from port
#[inline]
pub unsafe fn inw(port: u16) -> u16 {
let ret: u16;
- asm!("inw %dx, %ax" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
+ llvm_asm!("inw %dx, %ax" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
ret
}
/// Write 32 bits to port
#[inline]
pub unsafe fn outl(port: u16, val: u32) {
- asm!("outl %eax, %dx" :: "{dx}"(port), "{al}"(val));
+ llvm_asm!("outl %eax, %dx" :: "{dx}"(port), "{al}"(val));
}
/// Read 32 bits from port
#[inline]
pub unsafe fn inl(port: u16) -> u32 {
let ret: u32;
- asm!("inl %dx, %eax" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
+ llvm_asm!("inl %dx, %eax" : "={ax}"(ret) : "{dx}"(port) :: "volatile");
ret
}