49 #ifndef __DEV_PCI_DEVICE_HH__
50 #define __DEV_PCI_DEVICE_HH__
58 #include "params/PciDevice.hh"
61 #define BAR_IO_MASK 0x3
62 #define BAR_MEM_MASK 0xF
63 #define BAR_IO_SPACE_BIT 0x1
64 #define BAR_IO_SPACE(x) ((x) & BAR_IO_SPACE_BIT)
65 #define BAR_NUMBER(x) (((x) - PCI0_BASE_ADDR0) >> 0x2);
125 assert(bar >= 0 && bar < 6);
136 for (
int i = 0;
i <= 5; ++
i)
227 #endif // __DEV_PCI_DEVICE_HH__
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Defines the PCI Express capability register and its associated bitfields for a PCIe device...
PCI device, base implementation is only config space.
const int MSIXCAP_MXC_OFFSET
Addr dmaAddr(Addr addr) const
Calculate the physical address of a prefetchable memory location in the PCI address space...
const PciBusAddr _busAddr
Defines the MSI Capability register and its associated bitfields for the a PCI/PCIe device...
const int PMCAP_PC_OFFSET
const int MSIXCAP_MPBA_OFFSET
Addr pciToDma(Addr pci_addr) const
PciDevice(const PciDeviceParams *params)
Constructor for PCI Dev.
const Params * params() const
const int MSIXCAP_ID_OFFSET
Defines the Power Management capability register and all its associated bitfields for a PCIe device...
bool legacyIO[6]
Whether the BARs are really hardwired legacy IO locations.
void clearInt()
Clear a posted PCI interrupt.
uint64_t Tick
Tick count type.
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
const PciBusAddr & busAddr() const
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
int getBAR(Addr addr)
Which base address register (if any) maps the given address?
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool getBAR(Addr addr, int &bar, Addr &offs)
Which base address register (if any) maps the given address?
std::vector< MSIXTable > msix_table
MSIX Table and PBA Structures.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr BARAddrs[6]
The current address mapping of the BARs.
bool isBAR(Addr addr, int bar) const
Does the given address lie within the space mapped by the given base address register?
uint8_t interruptLine() const
AddrRangeList getAddrRanges() const override
Determine the address ranges that this device responds to.
std::ostream CheckpointOut
Callback interface from PCI devices to the host.
const int PMCAP_ID_OFFSET
std::vector< MSIXPbaEntry > msix_pba
const int PMCAP_BASE
The capability list structures and base addresses.
const int PMCAP_PMCS_OFFSET
PciHost::DeviceInterface hostInterface
void postInt()
Post a PCI interrupt to the CPU.
PCIConfig config
The current config space.
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
uint32_t BARSize[6]
The size of the BARs.
const int MSIXCAP_MTAB_OFFSET