From abc76f20cb98c90e8dab416dd16dfd4a954013ba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Jul 2007 21:51:38 -0700 Subject: Major changes to how SimObjects are created and initialized. Almost all creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed --- src/dev/pcidev.hh | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'src/dev/pcidev.hh') diff --git a/src/dev/pcidev.hh b/src/dev/pcidev.hh index 5ddbe84a0..a08092689 100644 --- a/src/dev/pcidev.hh +++ b/src/dev/pcidev.hh @@ -42,6 +42,7 @@ #include "dev/io_device.hh" #include "dev/pcireg.h" #include "dev/platform.hh" +#include "params/PciDevice.hh" #include "sim/byteswap.hh" #define BAR_IO_MASK 0x3 @@ -105,32 +106,12 @@ class PciDev : public DmaDevice }; public: - struct Params : public DmaDevice::Params + typedef PciDeviceParams Params; + const Params * + params() const { - /** - * A pointer to the object that contains the first 64 bytes of - * config space - */ - PciConfigData *configData; - - /** The bus number we are on */ - uint32_t busNum; - - /** The device number we have */ - uint32_t deviceNum; - - /** The function number */ - uint32_t functionNum; - - /** The latency for pio accesses. */ - Tick pio_delay; - - /** The latency for a config access. */ - Tick config_delay; - }; - - public: - const Params *params() const { return (const Params *)_params; } + return dynamic_cast(_params); + } protected: /** The current config space. Unlike the PciConfigData this is @@ -266,8 +247,8 @@ class PciDev : public DmaDevice if (if_name == "config") { if (configPort != NULL) panic("pciconfig port already connected to."); - configPort = new PciConfigPort(this, params()->busNum, - params()->deviceNum, params()->functionNum, + configPort = new PciConfigPort(this, params()->pci_bus, + params()->pci_dev, params()->pci_func, params()->platform); return configPort; } -- cgit v1.2.3