summaryrefslogtreecommitdiff
path: root/src/dev/io_device.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-01-17 12:55:09 -0600
committerAndreas Hansson <andreas.hansson@arm.com>2012-01-17 12:55:09 -0600
commit07cf9d914b292008ead7021182ec2ef8fc4671f1 (patch)
treef99ab26383bcdde2f8761af1e75a431d7a84c634 /src/dev/io_device.cc
parent142380a373e28cd61b79d348361ec1ed4ed330e5 (diff)
downloadgem5-07cf9d914b292008ead7021182ec2ef8fc4671f1.tar.xz
MEM: Separate queries for snooping and address ranges
This patch simplifies the address-range determination mechanism and also unifies the naming across ports and devices. It further splits the queries for determining if a port is snooping and what address ranges it responds to (aiming towards a separation of cache-maintenance ports and pure memory-mapped ports). Default behaviours are such that most ports do not have to define isSnooping, and master ports need not implement getAddrRanges.
Diffstat (limited to 'src/dev/io_device.cc')
-rw-r--r--src/dev/io_device.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc
index 9b7b6ec50..6cb7bbed7 100644
--- a/src/dev/io_device.cc
+++ b/src/dev/io_device.cc
@@ -47,13 +47,10 @@ PioPort::recvAtomic(PacketPtr pkt)
return pkt->isRead() ? device->read(pkt) : device->write(pkt);
}
-void
-PioPort::getDeviceAddressRanges(AddrRangeList &resp, bool &snoop)
+AddrRangeList
+PioPort::getAddrRanges()
{
- snoop = false;
- device->addressRanges(resp);
- for (AddrRangeIter i = resp.begin(); i != resp.end(); i++)
- DPRINTF(BusAddrRanges, "Adding Range %#x-%#x\n", i->start, i->end);
+ return device->getAddrRanges();
}
@@ -72,7 +69,7 @@ PioDevice::init()
{
if (!pioPort)
panic("Pio port of %s not connected to anything!", name());
- pioPort->sendStatusChange(Port::RangeChange);
+ pioPort->sendRangeChange();
}
Port *
@@ -105,13 +102,14 @@ BasicPioDevice::BasicPioDevice(const Params *p)
pioDelay(p->pio_latency)
{}
-void
-BasicPioDevice::addressRanges(AddrRangeList &range_list)
+AddrRangeList
+BasicPioDevice::getAddrRanges()
{
assert(pioSize != 0);
- range_list.clear();
+ AddrRangeList ranges;
DPRINTF(BusAddrRanges, "registering range: %#x-%#x\n", pioAddr, pioSize);
- range_list.push_back(RangeSize(pioAddr, pioSize));
+ ranges.push_back(RangeSize(pioAddr, pioSize));
+ return ranges;
}
@@ -121,7 +119,7 @@ DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff,
pendingCount(0), actionInProgress(0), drainEvent(NULL),
backoffTime(0), minBackoffDelay(min_backoff),
maxBackoffDelay(max_backoff), inRetry(false), recvSnoops(recv_snoops),
- snoopRangeSent(false), backoffEvent(this)
+ backoffEvent(this)
{ }
bool