X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fplatform.cc;h=c6078078682f9b20c13b81ffd5d2b2b93c401f29;hb=ec80224188500183604eaf6cbe19d0ac16616f9c;hp=ed021e3b673e414bd1bb04e5e1648b56a56c5f29;hpb=15a8f050605919579e81b6abb98a0b596334216d;p=gem5.git diff --git a/src/dev/platform.cc b/src/dev/platform.cc index ed021e3b6..c60780786 100644 --- a/src/dev/platform.cc +++ b/src/dev/platform.cc @@ -29,15 +29,15 @@ * Nathan Binkert */ +#include "base/misc.hh" +#include "config/the_isa.hh" #include "dev/platform.hh" -#include "sim/builder.hh" #include "sim/sim_exit.hh" using namespace std; -using namespace TheISA; -Platform::Platform(const string &name, IntrControl *intctrl) - : SimObject(name), intrctrl(intctrl) +Platform::Platform(const Params *p) + : SimObject(p), intrctrl(p->intrctrl) { } @@ -61,7 +61,20 @@ Addr Platform::pciToDma(Addr pciAddr) const { panic("No PCI dma support in platform."); + M5_DUMMY_RETURN } -DEFINE_SIM_OBJECT_CLASS_NAME("Platform", Platform) +void +Platform::registerPciDevice(uint8_t bus, uint8_t dev, uint8_t func, uint8_t intr) +{ + uint32_t bdf = bus << 16 | dev << 8 | func << 0; + if (pciDevices.find(bdf) != pciDevices.end()) + fatal("Two PCI devices have same bus:device:function\n"); + + if (intLines.test(intr)) + fatal("Two PCI devices have same interrupt line: %d\n", intr); + pciDevices.insert(bdf); + + intLines.set(intr); +}