Start using the pci_types crate
This commit is contained in:
@@ -6,8 +6,7 @@ use std::sync::Mutex;
|
||||
use syscall::io::{Io as _, Pio};
|
||||
|
||||
use log::info;
|
||||
|
||||
use crate::pci::{CfgAccess, PciAddress};
|
||||
use pci_types::{ConfigRegionAccess, PciAddress};
|
||||
|
||||
pub(crate) struct Pci {
|
||||
lock: Mutex<()>,
|
||||
@@ -58,7 +57,11 @@ impl Pci {
|
||||
}
|
||||
}
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
impl CfgAccess for Pci {
|
||||
impl ConfigRegionAccess for Pci {
|
||||
fn function_exists(&self, _address: PciAddress) -> bool {
|
||||
todo!();
|
||||
}
|
||||
|
||||
unsafe fn read(&self, address: PciAddress, offset: u16) -> u32 {
|
||||
let _guard = self.lock.lock().unwrap();
|
||||
|
||||
@@ -86,7 +89,11 @@ impl CfgAccess for Pci {
|
||||
}
|
||||
}
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
impl CfgAccess for Pci {
|
||||
impl ConfigRegionAccess for Pci {
|
||||
fn function_exists(&self, _address: PciAddress) -> bool {
|
||||
todo!();
|
||||
}
|
||||
|
||||
unsafe fn read(&self, addr: PciAddress, offset: u16) -> u32 {
|
||||
let _guard = self.lock.lock().unwrap();
|
||||
todo!("Pci::CfgAccess::read on this architecture")
|
||||
|
||||
@@ -2,8 +2,8 @@ use std::sync::Mutex;
|
||||
use std::{fmt, fs, io, mem, ptr, slice};
|
||||
|
||||
use log::info;
|
||||
use pci_types::{ConfigRegionAccess, PciAddress};
|
||||
|
||||
use crate::pci::{CfgAccess, PciAddress};
|
||||
use fallback::Pci;
|
||||
|
||||
mod fallback;
|
||||
@@ -221,7 +221,11 @@ impl Pcie {
|
||||
}
|
||||
}
|
||||
|
||||
impl CfgAccess for Pcie {
|
||||
impl ConfigRegionAccess for Pcie {
|
||||
fn function_exists(&self, _address: PciAddress) -> bool {
|
||||
todo!();
|
||||
}
|
||||
|
||||
unsafe fn read(&self, address: PciAddress, offset: u16) -> u32 {
|
||||
let _guard = self.lock.lock().unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user