rustubs/machine/
device_io.rs

1#[cfg(target_arch = "x86_64")]
2pub use crate::arch::x86_64::io_port::*;
3
4// either use the io functions directly, or via a IOPort instance.
5pub struct IOPort(u16);
6impl IOPort {
7	pub const fn new(port: u16) -> Self { Self(port) }
8	pub fn inw(&self) -> u16 { inw(self.0) }
9	pub fn inb(&self) -> u8 { inb(self.0) }
10	pub fn outw(&self, val: u16) { outw(self.0, val); }
11	pub fn outb(&self, val: u8) { outb(self.0, val); }
12}