[Zion][Yellowstone] First pass at adding PCI ioport access.

This commit is contained in:
Drew Galbraith 2025-05-07 01:44:09 -07:00
parent f2c2cff98a
commit b677633248
16 changed files with 337 additions and 199 deletions

View file

@ -472,3 +472,25 @@ pub fn semaphone_wait(sem_cap: &Capability) -> Result<(), ZError> {
},
)
}
pub fn pci_read(
pci_cap: &Capability,
bus: u8,
slot: u8,
func: u8,
offset: u8,
) -> Result<u32, ZError> {
let mut data: u32 = 0;
syscall(
zion::kZionPciRead,
&zion::ZPciReadReq {
pci_cap: pci_cap.raw(),
bus,
slot,
func,
offset,
output: &mut data as *mut u32,
},
)?;
Ok(data)
}