1 // Copyright 2018 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 //! Implements pci devices and busses. 6 7 #[cfg(feature = "audio")] 8 mod ac97; 9 #[cfg(feature = "audio")] 10 mod ac97_bus_master; 11 #[cfg(feature = "audio")] 12 mod ac97_mixer; 13 #[cfg(feature = "audio")] 14 mod ac97_regs; 15 mod msix; 16 mod pci_configuration; 17 mod pci_device; 18 mod pci_root; 19 mod vfio_pci; 20 21 #[cfg(feature = "audio")] 22 pub use self::ac97::{Ac97Backend, Ac97Dev, Ac97Parameters}; 23 pub use self::msix::{MsixCap, MsixConfig, MsixStatus}; 24 pub use self::pci_configuration::{ 25 PciBarConfiguration, PciBarPrefetchable, PciBarRegionType, PciCapability, PciCapabilityID, 26 PciClassCode, PciConfiguration, PciDisplaySubclass, PciHeaderType, PciProgrammingInterface, 27 PciSerialBusSubClass, PciSubclass, 28 }; 29 pub use self::pci_device::Error as PciDeviceError; 30 pub use self::pci_device::PciDevice; 31 pub use self::pci_root::{PciAddress, PciConfigIo, PciConfigMmio, PciRoot}; 32 pub use self::vfio_pci::VfioPciDevice; 33 34 /// PCI has four interrupt pins A->D. 35 #[derive(Copy, Clone)] 36 pub enum PciInterruptPin { 37 IntA, 38 IntB, 39 IntC, 40 IntD, 41 } 42 43 impl PciInterruptPin { to_mask(self) -> u3244 pub fn to_mask(self) -> u32 { 45 self as u32 46 } 47 } 48