/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2004-2005 The Regents of The University of Michigan
* All rights reserved.
*
#define __DEV_PCIDEV_HH__
#include <cstring>
+#include <vector>
#include "dev/dma_device.hh"
#include "dev/pcireg.h"
/**
* PCI device, base implementation is only config space.
*/
-class PciDev : public DmaDevice
+class PciDevice : public DmaDevice
{
class PciConfigPort : public SimpleTimingPort
{
protected:
- PciDev *device;
+ PciDevice *device;
virtual Tick recvAtomic(PacketPtr pkt);
- virtual AddrRangeList getAddrRanges();
+ virtual AddrRangeList getAddrRanges() const;
Platform *platform;
Addr configAddr;
public:
- PciConfigPort(PciDev *dev, int busid, int devid, int funcid,
+ PciConfigPort(PciDevice *dev, int busid, int devid, int funcid,
Platform *p);
};
protected:
/** The current config space. */
PCIConfig config;
+ /** The capability list structures and base addresses
+ * @{
+ */
+ const int PMCAP_BASE;
+ PMCAP pmcap;
+
+ const int MSICAP_BASE;
+ MSICAP msicap;
+
+ const int MSIXCAP_BASE;
+ MSIXCAP msixcap;
+
+ const int PXCAP_BASE;
+ PXCAP pxcap;
+ /** @} */
+
+ /** MSIX Table and PBA Structures */
+ std::vector<MSIXTable> msix_table;
+ std::vector<MSIXPbaEntry> msix_pba;
/** The size of the BARs */
uint32_t BARSize[6];
*
* @return a list of non-overlapping address ranges
*/
- AddrRangeList getAddrRanges();
+ AddrRangeList getAddrRanges() const;
/**
* Constructor for PCI Dev. This function copies data from the
* config file object PCIConfigData and registers the device with
* a PciConfigAll object.
*/
- PciDev(const Params *params);
+ PciDevice(const Params *params);
virtual void init();
virtual void unserialize(Checkpoint *cp, const std::string §ion);
- virtual unsigned int drain(Event *de);
+ virtual unsigned int drain(DrainManager *dm);
- virtual SlavePort &getSlavePort(const std::string &if_name, int idx = -1)
+ virtual BaseSlavePort &getSlavePort(const std::string &if_name,
+ PortID idx = InvalidPortID)
{
if (if_name == "config") {
return configPort;