diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:34 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:34 -0400 |
commit | 46d9adb68c96b94ae25bbe92d34e375daf532ece (patch) | |
tree | 8a0792d1d67958eeb65ee978edc5217e2b499ae7 /src/mem/bus.cc | |
parent | 830391cad9764b923edd8f761e9fe5d11fd9d837 (diff) | |
download | gem5-46d9adb68c96b94ae25bbe92d34e375daf532ece.tar.xz |
Port: Make getAddrRanges const
This patch makes getAddrRanges const throughout the code base. There
is no reason why it should not be, and making it const prevents adding
any unintentional side-effects.
Diffstat (limited to 'src/mem/bus.cc')
-rw-r--r-- | src/mem/bus.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc index 5be53dbcd..2e735e03b 100644 --- a/src/mem/bus.cc +++ b/src/mem/bus.cc @@ -269,7 +269,7 @@ BaseBus::findPort(Addr addr) return dest_id; // Check normal port ranges - PortIter i = portMap.find(RangeSize(addr,1)); + PortMapConstIter i = portMap.find(RangeSize(addr,1)); if (i != portMap.end()) { dest_id = i->second; updatePortCache(dest_id, i->first.start, i->first.end); @@ -278,8 +278,8 @@ BaseBus::findPort(Addr addr) // Check if this matches the default range if (useDefaultRange) { - AddrRangeIter a_end = defaultRange.end(); - for (AddrRangeIter i = defaultRange.begin(); i != a_end; i++) { + AddrRangeConstIter a_end = defaultRange.end(); + for (AddrRangeConstIter i = defaultRange.begin(); i != a_end; i++) { if (*i == addr) { DPRINTF(BusAddrRanges, " found addr %#llx on default\n", addr); @@ -332,7 +332,7 @@ BaseBus::recvRangeChange(PortID master_port_id) MasterPort *port = masterPorts[master_port_id]; // Clean out any previously existent ids - for (PortIter portIter = portMap.begin(); + for (PortMapIter portIter = portMap.begin(); portIter != portMap.end(); ) { if (portIter->second == master_port_id) portMap.erase(portIter++); @@ -367,22 +367,22 @@ BaseBus::recvRangeChange(PortID master_port_id) } AddrRangeList -BaseBus::getAddrRanges() +BaseBus::getAddrRanges() const { AddrRangeList ranges; DPRINTF(BusAddrRanges, "received address range request, returning:\n"); - for (AddrRangeIter dflt_iter = defaultRange.begin(); + for (AddrRangeConstIter dflt_iter = defaultRange.begin(); dflt_iter != defaultRange.end(); dflt_iter++) { ranges.push_back(*dflt_iter); DPRINTF(BusAddrRanges, " -- Dflt: %#llx : %#llx\n",dflt_iter->start, dflt_iter->end); } - for (PortIter portIter = portMap.begin(); + for (PortMapConstIter portIter = portMap.begin(); portIter != portMap.end(); portIter++) { bool subset = false; - for (AddrRangeIter dflt_iter = defaultRange.begin(); + for (AddrRangeConstIter dflt_iter = defaultRange.begin(); dflt_iter != defaultRange.end(); dflt_iter++) { if ((portIter->first.start < dflt_iter->start && portIter->first.end >= dflt_iter->start) || |