pcid: Move msi from pci to driver_interface
This commit is contained in:
@@ -8,7 +8,7 @@ use std::fs::{self, File};
|
||||
use std::io::{self, prelude::*};
|
||||
use std::num::NonZeroU8;
|
||||
|
||||
use crate::pci::msi::MsiAddrAndData;
|
||||
use crate::driver_interface::msi::MsiAddrAndData;
|
||||
|
||||
/// Read the local APIC ID of the bootstrap processor.
|
||||
pub fn read_bsp_apic_id() -> io::Result<usize> {
|
||||
@@ -180,7 +180,7 @@ pub fn allocate_single_interrupt_vector(cpu_id: usize) -> io::Result<Option<(u8,
|
||||
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
pub fn allocate_single_interrupt_vector_for_msi(cpu_id: usize) -> (MsiAddrAndData, File) {
|
||||
use crate::pci::msi::x86 as x86_msix;
|
||||
use crate::driver_interface::msi::x86 as x86_msix;
|
||||
|
||||
// FIXME for cpu_id >255 we need to use the IOMMU to use IRQ remapping
|
||||
let lapic_id = u8::try_from(cpu_id).expect("CPU id couldn't fit inside u8");
|
||||
|
||||
@@ -9,16 +9,16 @@ use std::os::unix::io::{FromRawFd, RawFd};
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use thiserror::Error;
|
||||
|
||||
pub use crate::pci::msi;
|
||||
pub use crate::pci::PciAddress;
|
||||
pub use bar::PciBar;
|
||||
pub use cap::VendorSpecificCapability;
|
||||
pub use id::FullDeviceId;
|
||||
pub use pci_types::PciAddress;
|
||||
|
||||
mod bar;
|
||||
pub mod cap;
|
||||
mod id;
|
||||
pub mod irq_helpers;
|
||||
pub mod msi;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
pub struct LegacyInterruptLine(pub(crate) u8);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Interface to `pcid`.
|
||||
|
||||
mod driver_interface;
|
||||
mod pci;
|
||||
pub use driver_interface::*;
|
||||
|
||||
@@ -19,7 +19,6 @@ mod cfg_access;
|
||||
mod config;
|
||||
mod driver_handler;
|
||||
mod driver_interface;
|
||||
mod pci;
|
||||
|
||||
#[derive(StructOpt)]
|
||||
#[structopt(about)]
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
pub use pci_types::PciAddress;
|
||||
|
||||
pub mod msi;
|
||||
Reference in New Issue
Block a user