Remote GDB: Turn on remote gdb in SE mode.
[gem5.git] / src / dev / platform.hh
index 0e6f4ba4a86d5bcf794a97db20f50fdd67327759..699b168cee484e717b210a6c2a7ef704db877faf 100644 (file)
 #ifndef __DEV_PLATFORM_HH__
 #define __DEV_PLATFORM_HH__
 
+#include <bitset>
+#include <set>
+
 #include "sim/sim_object.hh"
 #include "arch/isa_traits.hh"
+#include "params/Platform.hh"
 
 class PciConfigAll;
 class IntrControl;
@@ -52,25 +56,27 @@ class Platform : public SimObject
     /** Pointer to the interrupt controller */
     IntrControl *intrctrl;
 
-    /** Pointer to the PCI configuration space */
-    PciConfigAll *pciconfig;
-
-    /** Pointer to the UART, set by the uart */
-    Uart *uart;
-
     /** Pointer to the system for info about the memory system. */
     System *system;
 
   public:
-    Platform(const std::string &name, IntrControl *intctrl);
+    typedef PlatformParams Params;
+    Platform(const Params *p);
     virtual ~Platform();
-    virtual void init() { if (pciconfig == NULL) panic("PCI Config not set"); }
     virtual void postConsoleInt() = 0;
     virtual void clearConsoleInt() = 0;
     virtual Tick intrFrequency() = 0;
     virtual void postPciInt(int line);
     virtual void clearPciInt(int line);
     virtual Addr pciToDma(Addr pciAddr) const;
+    virtual Addr calcConfigAddr(int bus, int dev, int func) = 0;
+    virtual void registerPciDevice(uint8_t bus, uint8_t dev, uint8_t func,
+            uint8_t intr);
+
+  private:
+    std::bitset<256> intLines;
+    std::set<uint32_t> pciDevices;
+
 };
 
 #endif // __DEV_PLATFORM_HH__