Go to the documentation of this file.
45 #ifndef __DEV_PCI_DEVICE_HH__
46 #define __DEV_PCI_DEVICE_HH__
54 #include "params/PciDevice.hh"
57 #define BAR_IO_MASK 0x3
58 #define BAR_MEM_MASK 0xF
59 #define BAR_IO_SPACE_BIT 0x1
60 #define BAR_IO_SPACE(x) ((x) & BAR_IO_SPACE_BIT)
61 #define BAR_NUMBER(x) (((x) - PCI0_BASE_ADDR0) >> 0x2);
130 assert(bar >= 0 && bar < 6);
141 for (
int i = 0;
i <= 5; ++
i)
232 #endif // __DEV_PCI_DEVICE_HH__
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
void postInt()
Post a PCI interrupt to the CPU.
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
const int PMCAP_PC_OFFSET
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
Callback interface from PCI devices to the host.
uint8_t interruptLine() const
uint64_t Tick
Tick count type.
PCIConfig config
The current config space.
const PciBusAddr _busAddr
std::vector< MSIXPbaEntry > msix_pba
const int MSIXCAP_MTAB_OFFSET
const int PMCAP_PMCS_OFFSET
PciDevice(const PciDeviceParams *params)
Constructor for PCI Dev.
PciHost::DeviceInterface hostInterface
uint32_t BARSize[6]
The size of the BARs.
void clearInt()
Clear a posted PCI interrupt.
const PciBusAddr & busAddr() const
bool isBAR(Addr addr, int bar) const
Does the given address lie within the space mapped by the given base address register?
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
const int PMCAP_BASE
The capability list structures and base addresses.
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
bool isLargeBAR(int bar) const
Does the given BAR represent 32 lower bits of a 64-bit address?
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const int MSIXCAP_MXC_OFFSET
std::vector< MSIXTable > msix_table
MSIX Table and PBA Structures.
const Params * params() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::ostream CheckpointOut
const int MSIXCAP_MPBA_OFFSET
const int PMCAP_ID_OFFSET
Addr BARAddrs[6]
The current address mapping of the BARs.
const int MSIXCAP_ID_OFFSET
int getBAR(Addr addr)
Which base address register (if any) maps the given address?
bool legacyIO[6]
Whether the BARs are really hardwired legacy IO locations.
Addr dmaAddr(Addr addr) const
Calculate the physical address of a prefetchable memory location in the PCI address space.
PCI device, base implementation is only config space.
bool getBAR(Addr addr, int &bar, Addr &offs)
Which base address register (if any) maps the given address?
Addr pciToDma(Addr pci_addr) const
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17