#include "dev/pcireg.h"
#include "dev/platform.hh"
#include "mem/packet.hh"
-#include "sim/builder.hh"
+#include "mem/packet_access.hh"
+#include "params/PciConfigAll.hh"
#include "sim/system.hh"
using namespace std;
-PciConfigAll::PciConfigAll(Params *p)
+PciConfigAll::PciConfigAll(const Params *p)
: PioDevice(p)
{
pioAddr = p->platform->calcConfigAddr(params()->bus,0,0);
Tick
-PciConfigAll::read(Packet *pkt)
+PciConfigAll::read(PacketPtr pkt)
{
- assert(pkt->result == Packet::Unknown);
pkt->allocate();
default:
panic("invalid access size(?) for PCI configspace!\n");
}
- pkt->result = Packet::Success;
- return params()->pio_delay;
+ pkt->makeAtomicResponse();
+ return params()->pio_latency;
}
Tick
-PciConfigAll::write(Packet *pkt)
+PciConfigAll::write(PacketPtr pkt)
{
- assert(pkt->result == Packet::Unknown);
panic("Attempting to write to config space on non-existant device\n");
+ M5_DUMMY_RETURN
}
+
void
PciConfigAll::addressRanges(AddrRangeList &range_list)
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(PciConfigAll)
-
- Param<Tick> pio_latency;
- Param<int> bus;
- Param<Addr> size;
- SimObjectParam<Platform *> platform;
- SimObjectParam<System *> system;
-
-END_DECLARE_SIM_OBJECT_PARAMS(PciConfigAll)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(PciConfigAll)
-
- INIT_PARAM(pio_latency, "Programmed IO latency"),
- INIT_PARAM(bus, "Bus that this object handles config space for"),
- INIT_PARAM(size, "The size of config space"),
- INIT_PARAM(platform, "platform"),
- INIT_PARAM(system, "system object")
-
-END_INIT_SIM_OBJECT_PARAMS(PciConfigAll)
-
-CREATE_SIM_OBJECT(PciConfigAll)
+PciConfigAll *
+PciConfigAllParams::create()
{
- PciConfigAll::Params *p = new PciConfigAll::Params;
- p->pio_delay = pio_latency;
- p->platform = platform;
- p->system = system;
- p->bus = bus;
- p->size = size;
-
- return new PciConfigAll(p);
+ return new PciConfigAll(this);
}
-REGISTER_SIM_OBJECT("PciConfigAll", PciConfigAll)
-
#endif // DOXYGEN_SHOULD_SKIP_THIS