Skip to content

Commit 9ed3a52

Browse files
authored
Merge pull request #3 from kennystrawnmusic/patch-3
Switch to rust-lang/rust#72016 `asm!` syntax
2 parents f1afba8 + 3a29ead commit 9ed3a52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#![doc(html_root_url = "https://docs.rs/tinypci")]
66

7-
#![feature(llvm_asm)]
7+
#![feature(asm)]
88

99
#![cfg_attr(not(feature="std"), no_std)]
1010

@@ -30,14 +30,14 @@ pub use enums::*;
3030
#[inline]
3131
unsafe fn read_from_port(port: u16) -> u32 {
3232
let value: u32;
33-
llvm_asm!("inl %dx, %eax" : "={eax}"(value) : "{dx}"(port) :: "volatile");
33+
asm!("inl eax, dx", out("eax") value, in("dx") port);
3434
value
3535
}
3636

3737
// extracted from the `x86_64` crate.
3838
#[inline]
3939
unsafe fn write_to_port(port: u16, value: u32) {
40-
llvm_asm!("outl %eax, %dx" :: "{dx}"(port), "{eax}"(value) :: "volatile");
40+
asm!("outl dx, eax", out("dx") port, in("eax") value);
4141
}
4242

4343

0 commit comments

Comments
 (0)