Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to rust-lang/rust#72016 asm! syntax #3

Merged
merged 2 commits into from
Nov 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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