Skip to content

Commit

Permalink
Merge pull request #3 from kennystrawnmusic/patch-3
Browse files Browse the repository at this point in the history
Switch to rust-lang/rust#72016 `asm!` syntax
  • Loading branch information
trashbyte authored Nov 14, 2021
2 parents f1afba8 + 3a29ead commit 9ed3a52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

#![feature(llvm_asm)]
#![feature(asm)]

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

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

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


Expand Down

0 comments on commit 9ed3a52

Please sign in to comment.