forked from AbleOS/ableos
17 lines
290 B
Rust
17 lines
290 B
Rust
|
use cpuio::{inb, inl, outb, outl};
|
||
|
|
||
|
pub fn read32(reg: u16) -> u32 {
|
||
|
unsafe { inl(reg) }
|
||
|
}
|
||
|
pub fn read8(reg: u16) -> u8 {
|
||
|
unsafe { inb(reg) }
|
||
|
}
|
||
|
|
||
|
pub fn write32(reg: u16, val: u32) {
|
||
|
unsafe { outl(val, reg) }
|
||
|
}
|
||
|
|
||
|
pub fn write8(reg: u16, val: u8) {
|
||
|
unsafe { outb(val, reg) }
|
||
|
}
|