|
The Pedigree Project 0.1
|
#include <Pci.h>
Collaboration diagram for PciBus:Classes | |
| struct | ConfigSpace |
| class | DmaMapping |
Public Member Functions | |
| void | initialise () |
| uint32_t | readConfigSpace (Device *pDev, uint8_t offset) |
| uint32_t | readConfigSpace (uint8_t bus, uint8_t device, uint8_t function, uint8_t offset) |
| void | writeConfigSpace (Device *pDev, uint8_t offset, uint32_t data) |
| void | writeConfigSpace (uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint32_t data) |
| bool | readConfig8 (Device *device, uint16_t offset, uint8_t &value) |
| bool | readConfig16 (Device *device, uint16_t offset, uint16_t &value) |
| bool | readConfig32 (Device *device, uint16_t offset, uint32_t &value) |
| bool | writeConfig8 (Device *device, uint16_t offset, uint8_t value) |
| bool | writeConfig16 (Device *device, uint16_t offset, uint16_t value) |
| bool | writeConfig32 (Device *device, uint16_t offset, uint32_t value) |
| PciExtendedCapabilities::FindResult | findExtendedCapability (Device *device, uint16_t id, PciExtendedCapabilities::Capability &result) |
| bool | reserveLegacyInterrupt (uint8_t irq) |
| bool | updateCommand (Device *device, uint16_t clearBits, uint16_t setBits) |
| bool | inspectFunction (Device *device, PciFunctionState::State &state, bool requireLegacyInterrupt=true) |
| bool | disableMessageInterrupts (Device *device, const PciFunctionState::State &state) |
| bool | enableMsi (Device *device, uint64_t address, uint16_t data) |
| bool | disableMsi (Device *device) |
| bool | enableMsix (Device *device, uint64_t address, uint32_t data) |
| bool | enableMsixVectors (Device *device, uint64_t address, const uint32_t *data, size_t count, bool *touched=nullptr, const uint64_t *addresses=nullptr) |
| bool | setMsixVectorMask (Device *device, size_t index, bool masked) |
| bool | disableMsix (Device *device) |
| bool | resourcesUnchanged (Device *device, const PciFunctionState::State &state) |
| bool | translateAddress (uint64_t pciAddress, uint64_t bytes, bool io, uint64_t &cpuPhysical) |
| bool | busRange (uint8_t &first, uint8_t &last) |
| uint32_t | interruptRoute (uint8_t bus, uint8_t device, uint8_t function, uint8_t pin) |
| bool | assignBar (Device *device, uint8_t index, uint32_t low, uint32_t high, uint32_t maskLow, uint32_t maskHigh) |
| bool | attachDmaRemapping (Device *device) |
| bool | hasDmaRemapping (Device *device) const |
| bool | attachIsolatedDma (Device *device) |
| bool | detachIsolatedDma (Device *device) |
| bool | isolatedDmaIdle (Device *device) const |
| bool | detachDisabledIsolatedDma (Device *device) |
| bool | hasDmaIsolation (Device *device) const |
| bool | mapDmaPage (Device *device, physical_uintptr_t physical, size_t bytes, DmaMapping &mapping) |
| void | unmapDmaPage (Device *device, uint16_t token) |
| struct PciBus::ConfigSpace | __attribute__ ((packed)) |
Static Public Member Functions | |
| static PciBus & | instance () |
Static Private Attributes | |
| static PciBus | m_Instance |
| PciBus::PciBus | ( | ) |
Definition at line 176 of file mach_pc/Pci.cc.
|
virtual |
Definition at line 177 of file mach_pc/Pci.cc.
| bool PciBus::assignBar | ( | Device * | device, |
| uint8_t | index, | ||
| uint32_t | low, | ||
| uint32_t | high, | ||
| uint32_t | maskLow, | ||
| uint32_t | maskHigh | ||
| ) |
Assign an unconfigured BAR from a host bridge window.
Definition at line 360 of file mach_pc/Pci.cc.
| bool PciBus::attachDmaRemapping | ( | Device * | device | ) |
Attach a PCI function to a translated DMA domain before bus mastering.
Definition at line 364 of file mach_pc/Pci.cc.
| bool PciBus::attachIsolatedDma | ( | Device * | device | ) |
Restrict this function to explicitly mapped DMA pages before bus mastering.
Definition at line 382 of file mach_pc/Pci.cc.
| bool PciBus::busRange | ( | uint8_t & | first, |
| uint8_t & | last | ||
| ) |
The host bridge's enumerable bus range.
Definition at line 343 of file mach_pc/Pci.cc.
| bool PciBus::detachDisabledIsolatedDma | ( | Device * | device | ) |
PF owner has cleared VFE and waited for VF removal before this call.
Definition at line 409 of file mach_pc/Pci.cc.
| bool PciBus::detachIsolatedDma | ( | Device * | device | ) |
Revoke an idle isolated domain after bus mastering has been disabled.
Definition at line 391 of file mach_pc/Pci.cc.
| bool PciBus::disableMessageInterrupts | ( | Device * | device, |
| const PciFunctionState::State & | state | ||
| ) |
Definition at line 266 of file mach_pc/Pci.cc.
| bool PciBus::disableMsi | ( | Device * | device | ) |
Definition at line 277 of file mach_pc/Pci.cc.
| bool PciBus::disableMsix | ( | Device * | device | ) |
Definition at line 320 of file mach_pc/Pci.cc.
| bool PciBus::enableMsi | ( | Device * | device, |
| uint64_t | address, | ||
| uint16_t | data | ||
| ) |
Definition at line 270 of file mach_pc/Pci.cc.
| bool PciBus::enableMsix | ( | Device * | device, |
| uint64_t | address, | ||
| uint32_t | data | ||
| ) |
Definition at line 284 of file mach_pc/Pci.cc.
| bool PciBus::enableMsixVectors | ( | Device * | device, |
| uint64_t | address, | ||
| const uint32_t * | data, | ||
| size_t | count, | ||
| bool * | touched = nullptr, |
||
| const uint64_t * | addresses = nullptr |
||
| ) |
Definition at line 287 of file mach_pc/Pci.cc.
|
inline |
| bool PciBus::hasDmaIsolation | ( | Device * | device | ) | const |
Definition at line 426 of file mach_pc/Pci.cc.
| bool PciBus::hasDmaRemapping | ( | Device * | device | ) | const |
Definition at line 373 of file mach_pc/Pci.cc.
| void PciBus::initialise | ( | ) |
Initialises the object for use.
Definition at line 179 of file mach_pc/Pci.cc.
Referenced by Pc::initialiseDeviceTree(), and VirtMachine::initialiseDeviceTree().
Here is the caller graph for this function:| bool PciBus::inspectFunction | ( | Device * | device, |
| PciFunctionState::State & | state, | ||
| bool | requireLegacyInterrupt = true |
||
| ) |
Definition at line 258 of file mach_pc/Pci.cc.
| uint32_t PciBus::interruptRoute | ( | uint8_t | bus, |
| uint8_t | device, | ||
| uint8_t | function, | ||
| uint8_t | pin | ||
| ) |
Definition at line 356 of file mach_pc/Pci.cc.
| bool PciBus::isolatedDmaIdle | ( | Device * | device | ) | const |
Caller serializes VF lifecycle and prevents new mappings during teardown.
Definition at line 400 of file mach_pc/Pci.cc.
| bool PciBus::mapDmaPage | ( | Device * | device, |
| physical_uintptr_t | physical, | ||
| size_t | bytes, | ||
| DmaMapping & | mapping | ||
| ) |
Map one pinned physical page to a 32-bit device address for the mapping lifetime.
Definition at line 435 of file mach_pc/Pci.cc.
References TargetInfo::getPageSize().
Referenced by ScsiDisk::flushCachePage().
Here is the caller graph for this function:| bool PciBus::readConfig16 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint16_t & | value | ||
| ) |
Definition at line 223 of file mach_pc/Pci.cc.
| bool PciBus::readConfig32 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint32_t & | value | ||
| ) |
Definition at line 230 of file mach_pc/Pci.cc.
| bool PciBus::readConfig8 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint8_t & | value | ||
| ) |
Definition at line 216 of file mach_pc/Pci.cc.
| uint32_t PciBus::readConfigSpace | ( | Device * | pDev, |
| uint8_t | offset | ||
| ) |
Reads from the configuration space
| pDev | the device to read configuration space for |
| offset | the dword index into the configuration space to read |
Definition at line 191 of file mach_pc/Pci.cc.
Referenced by PciAtaController::PciAtaController().
Here is the caller graph for this function:| uint32_t PciBus::readConfigSpace | ( | uint8_t | bus, |
| uint8_t | device, | ||
| uint8_t | function, | ||
| uint8_t | offset | ||
| ) |
Reads from the configuration space
| bus | bus number for the read address |
| device | device number for the read address |
| function | function number for the read address |
| offset | the dword index into the configuration space to read |
Definition at line 196 of file mach_pc/Pci.cc.
| bool PciBus::reserveLegacyInterrupt | ( | uint8_t | irq | ) |
Definition at line 477 of file mach_pc/Pci.cc.
| bool PciBus::resourcesUnchanged | ( | Device * | device, |
| const PciFunctionState::State & | state | ||
| ) |
Definition at line 332 of file mach_pc/Pci.cc.
| bool PciBus::setMsixVectorMask | ( | Device * | device, |
| size_t | index, | ||
| bool | masked | ||
| ) |
Definition at line 307 of file mach_pc/Pci.cc.
| bool PciBus::translateAddress | ( | uint64_t | pciAddress, |
| uint64_t | bytes, | ||
| bool | io, | ||
| uint64_t & | cpuPhysical | ||
| ) |
Translate a PCI BAR address into the CPU's physical address space.
Definition at line 338 of file mach_pc/Pci.cc.
| void PciBus::unmapDmaPage | ( | Device * | device, |
| uint16_t | token | ||
| ) |
Definition at line 466 of file mach_pc/Pci.cc.
| bool PciBus::updateCommand | ( | Device * | device, |
| uint16_t | clearBits, | ||
| uint16_t | setBits | ||
| ) |
Definition at line 242 of file mach_pc/Pci.cc.
| bool PciBus::writeConfig16 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint16_t | value | ||
| ) |
Definition at line 236 of file mach_pc/Pci.cc.
| bool PciBus::writeConfig32 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint32_t | value | ||
| ) |
Definition at line 239 of file mach_pc/Pci.cc.
| bool PciBus::writeConfig8 | ( | Device * | device, |
| uint16_t | offset, | ||
| uint8_t | value | ||
| ) |
Definition at line 233 of file mach_pc/Pci.cc.
| void PciBus::writeConfigSpace | ( | Device * | pDev, |
| uint8_t | offset, | ||
| uint32_t | data | ||
| ) |
Writes to the configuration space
| pDev | the device to write configuration space for |
| offset | the dword index into the configuration space to write |
| data | the data to write |
Definition at line 205 of file mach_pc/Pci.cc.
Referenced by PciAtaController::PciAtaController().
Here is the caller graph for this function:| void PciBus::writeConfigSpace | ( | uint8_t | bus, |
| uint8_t | device, | ||
| uint8_t | function, | ||
| uint8_t | offset, | ||
| uint32_t | data | ||
| ) |
Writes to the configuration space
| bus | bus number for the write address |
| device | device number for the write address |
| function | function number for the write address |
| offset | the dword index into the configuration space to write |
| data | the data to write |
Definition at line 208 of file mach_pc/Pci.cc.