43#include "debug/PciUpstream.hh"
46#include "params/PciConfigError.hh"
47#include "params/PciUpstream.hh"
87 auto map_entry =
devices.emplace(dev_addr, device);
92 fatal_if(!map_entry.second,
"%02x:%02x.%i: PCI bus ID collision\n",
102 return device !=
devices.end() ? device->second :
nullptr;
109 return device !=
devices.end() ? device->second :
nullptr;
145 device.second->recvBusChange();
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Addr pioAddr
Address that the device listens to.
Addr pioSize
Size that the device's address range.
ClockedObject(const ClockedObjectParams &p)
ClockedObjectParams Params
Parameters of ClockedObject.
IsaFake(const Params &p)
The constructor for Isa Fake just registers itself with the MMU.
PciConfigError(const Params &p)
void setAddrRange(AddrRange range)
Base class to represent a PCI device.
Callback interface from PCI devices to the upstream.
void clearInt()
Clear a posted PCI interrupt.
const PciIntPin interruptPin
void postInt()
Post a PCI interrupt to the CPU.
friend class gem5::PciUpstream
const std::string name() const
void sendBusChange()
Inform each PCI devices connected to this upstream of a bus number change.
virtual PciBusNum getBusNum() const =0
Get the PCI bus number assign to that upstream.
PciUpstream(const Params &p)
PciUpDownBridge * upToDown
The two one way bridges to connect both side buses.
PciDevice * getDevice(const PciDevAddr &addr)
Retrieve a PCI device from its bus address.
virtual DeviceInterface registerDevice(PciDevice *device, PciDevAddr dev_addr, PciIntPin pin)
Register a PCI device with the host.
std::map< PciDevAddr, PciDevice * > devices
Currently registered PCI interfaces.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual AddrRange getConfigAddrRange() const =0
Get the range for the configuration memory space for which this PCI upstream is responsible.
PciConfigError * configErrorDevice
PioPort< PioDevice > pioPort
The pioPort that handles the requests for us and provides us requests that it sees.
bool valid() const
Determine if the range is valid.
Addr start() const
Get the start address of the range.
Addr size() const
Get the size of the address range.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Copyright (c) 2024 Arm Limited All rights reserved.
std::string csprintf(const char *format, const Args &...args)