diff options
Diffstat (limited to 'src/dev/io_device.cc')
-rw-r--r-- | src/dev/io_device.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index be5756ab7..657739e2c 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -32,7 +32,6 @@ #include "base/chunk_generator.hh" #include "base/trace.hh" #include "dev/io_device.hh" -#include "sim/builder.hh" #include "sim/system.hh" @@ -55,6 +54,10 @@ PioPort::getDeviceAddressRanges(AddrRangeList &resp, bool &snoop) } +PioDevice::PioDevice(const Params *p) + : MemObject(p), platform(p->platform), sys(p->system), pioPort(NULL) +{} + PioDevice::~PioDevice() { if (pioPort) @@ -82,6 +85,11 @@ PioDevice::drain(Event *de) return count; } +BasicPioDevice::BasicPioDevice(const Params *p) + : PioDevice(p), pioAddr(p->pio_addr), pioSize(0), + pioDelay(p->pio_latency) +{} + void BasicPioDevice::addressRanges(AddrRangeList &range_list) { @@ -149,7 +157,7 @@ DmaPort::recvTiming(PacketPtr pkt) return true; } -DmaDevice::DmaDevice(Params *p) +DmaDevice::DmaDevice(const Params *p) : PioDevice(p), dmaPort(NULL), minBackoffDelay(p->min_backoff_delay), maxBackoffDelay(p->max_backoff_delay) { } @@ -262,8 +270,8 @@ DmaPort::sendDma() assert(transmitList.size()); PacketPtr pkt = transmitList.front(); - System::MemoryMode state = sys->getMemoryMode(); - if (state == System::Timing) { + Enums::MemoryMode state = sys->getMemoryMode(); + if (state == Enums::timing) { if (backoffEvent.scheduled() || inRetry) { DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n"); return; @@ -290,7 +298,7 @@ DmaPort::sendDma() backoffTime+curTick); backoffEvent.schedule(backoffTime+curTick); } - } else if (state == System::Atomic) { + } else if (state == Enums::atomic) { transmitList.pop_front(); Tick lat; @@ -330,5 +338,3 @@ DmaDevice::~DmaDevice() if (dmaPort) delete dmaPort; } - - |