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.
This commit is contained in:
@@ -708,7 +708,7 @@ Gic::postInt(uint32_t cpu, Tick when)
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
Gic::getAddrRanges()
|
||||
Gic::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeSize(distAddr, DIST_SIZE));
|
||||
|
||||
@@ -261,7 +261,7 @@ class Gic : public PioDevice
|
||||
/** Return the address ranges used by the Gic
|
||||
* This is the distributor address + all cpu addresses
|
||||
*/
|
||||
virtual AddrRangeList getAddrRanges();
|
||||
virtual AddrRangeList getAddrRanges() const;
|
||||
|
||||
/** A PIO read to the device, immediately split up into
|
||||
* readDistributor() or readCpu()
|
||||
|
||||
@@ -746,7 +746,7 @@ Pl111::generateInterrupt()
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
Pl111::getAddrRanges()
|
||||
Pl111::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeSize(pioAddr, pioSize));
|
||||
|
||||
@@ -329,7 +329,7 @@ class Pl111: public AmbaDmaDevice
|
||||
*
|
||||
* @return a list of non-overlapping address ranges
|
||||
*/
|
||||
AddrRangeList getAddrRanges();
|
||||
AddrRangeList getAddrRanges() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,7 @@ PioPort::recvAtomic(PacketPtr pkt)
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
PioPort::getAddrRanges()
|
||||
PioPort::getAddrRanges() const
|
||||
{
|
||||
return device->getAddrRanges();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ BasicPioDevice::BasicPioDevice(const Params *p)
|
||||
{}
|
||||
|
||||
AddrRangeList
|
||||
BasicPioDevice::getAddrRanges()
|
||||
BasicPioDevice::getAddrRanges() const
|
||||
{
|
||||
assert(pioSize != 0);
|
||||
AddrRangeList ranges;
|
||||
|
||||
@@ -67,7 +67,7 @@ class PioPort : public SimpleTimingPort
|
||||
|
||||
virtual Tick recvAtomic(PacketPtr pkt);
|
||||
|
||||
virtual AddrRangeList getAddrRanges();
|
||||
virtual AddrRangeList getAddrRanges() const;
|
||||
|
||||
public:
|
||||
|
||||
@@ -96,7 +96,7 @@ class PioDevice : public MemObject
|
||||
*
|
||||
* @return a list of non-overlapping address ranges
|
||||
*/
|
||||
virtual AddrRangeList getAddrRanges() = 0;
|
||||
virtual AddrRangeList getAddrRanges() const = 0;
|
||||
|
||||
/** Pure virtual function that the device must implement. Called
|
||||
* when a read command is recieved by the port.
|
||||
@@ -160,7 +160,7 @@ class BasicPioDevice : public PioDevice
|
||||
*
|
||||
* @return a list of non-overlapping address ranges
|
||||
*/
|
||||
virtual AddrRangeList getAddrRanges();
|
||||
virtual AddrRangeList getAddrRanges() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ PciConfigAll::write(PacketPtr pkt)
|
||||
|
||||
|
||||
AddrRangeList
|
||||
PciConfigAll::getAddrRanges()
|
||||
PciConfigAll::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeSize(pioAddr, params()->size));
|
||||
|
||||
@@ -80,7 +80,7 @@ class PciConfigAll : public PioDevice
|
||||
|
||||
virtual Tick write(PacketPtr pkt);
|
||||
|
||||
AddrRangeList getAddrRanges();
|
||||
AddrRangeList getAddrRanges() const;
|
||||
|
||||
private:
|
||||
Addr pioAddr;
|
||||
|
||||
@@ -71,7 +71,7 @@ PciDev::PciConfigPort::recvAtomic(PacketPtr pkt)
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
PciDev::PciConfigPort::getAddrRanges()
|
||||
PciDev::PciConfigPort::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
if (configAddr != ULL(-1))
|
||||
@@ -208,7 +208,7 @@ PciDev::readConfig(PacketPtr pkt)
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
PciDev::getAddrRanges()
|
||||
PciDev::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
int x = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ class PciDev : public DmaDevice
|
||||
|
||||
virtual Tick recvAtomic(PacketPtr pkt);
|
||||
|
||||
virtual AddrRangeList getAddrRanges();
|
||||
virtual AddrRangeList getAddrRanges() const;
|
||||
|
||||
Platform *platform;
|
||||
|
||||
@@ -191,7 +191,7 @@ class PciDev : public DmaDevice
|
||||
*
|
||||
* @return a list of non-overlapping address ranges
|
||||
*/
|
||||
AddrRangeList getAddrRanges();
|
||||
AddrRangeList getAddrRanges() const;
|
||||
|
||||
/**
|
||||
* Constructor for PCI Dev. This function copies data from the
|
||||
|
||||
@@ -324,7 +324,7 @@ Iob::receiveJBusInterrupt(int cpu_id, int source, uint64_t d0, uint64_t d1)
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
Iob::getAddrRanges()
|
||||
Iob::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeSize(iobManAddr, iobManSize));
|
||||
|
||||
@@ -141,7 +141,7 @@ class Iob : public PioDevice
|
||||
bool receiveJBusInterrupt(int cpu_id, int source, uint64_t d0,
|
||||
uint64_t d1);
|
||||
|
||||
AddrRangeList getAddrRanges();
|
||||
AddrRangeList getAddrRanges() const;
|
||||
|
||||
virtual void serialize(std::ostream &os);
|
||||
virtual void unserialize(Checkpoint *cp, const std::string §ion);
|
||||
|
||||
@@ -287,7 +287,7 @@ Uart8250::dataAvailable()
|
||||
}
|
||||
|
||||
AddrRangeList
|
||||
Uart8250::getAddrRanges()
|
||||
Uart8250::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeSize(pioAddr, pioSize));
|
||||
|
||||
@@ -100,7 +100,7 @@ class Uart8250 : public Uart
|
||||
|
||||
virtual Tick read(PacketPtr pkt);
|
||||
virtual Tick write(PacketPtr pkt);
|
||||
virtual AddrRangeList getAddrRanges();
|
||||
virtual AddrRangeList getAddrRanges() const;
|
||||
|
||||
/**
|
||||
* Inform the uart that there is data available.
|
||||
|
||||
@@ -44,9 +44,10 @@ const uint8_t CommandNack = 0xfe;
|
||||
const uint8_t BatSuccessful = 0xaa;
|
||||
|
||||
AddrRangeList
|
||||
X86ISA::I8042::getAddrRanges()
|
||||
X86ISA::I8042::getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
// TODO: Are these really supposed to be a single byte and not 4?
|
||||
ranges.push_back(RangeSize(dataPort, 1));
|
||||
ranges.push_back(RangeSize(commandPort, 1));
|
||||
return ranges;
|
||||
|
||||
@@ -255,7 +255,7 @@ class I8042 : public BasicPioDevice
|
||||
commandByte.keyboardFullInt = 1;
|
||||
}
|
||||
|
||||
AddrRangeList getAddrRanges();
|
||||
AddrRangeList getAddrRanges() const;
|
||||
|
||||
Tick read(PacketPtr pkt);
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class I82094AA : public PioDevice, public IntDev
|
||||
Tick read(PacketPtr pkt);
|
||||
Tick write(PacketPtr pkt);
|
||||
|
||||
AddrRangeList getAddrRanges()
|
||||
AddrRangeList getAddrRanges() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeEx(pioAddr, pioAddr + 4));
|
||||
@@ -109,7 +109,7 @@ class I82094AA : public PioDevice, public IntDev
|
||||
return ranges;
|
||||
}
|
||||
|
||||
AddrRangeList getIntAddrRange()
|
||||
AddrRangeList getIntAddrRange() const
|
||||
{
|
||||
AddrRangeList ranges;
|
||||
ranges.push_back(RangeEx(x86InterruptAddress(initialApicId, 0),
|
||||
|
||||
@@ -74,7 +74,7 @@ class IntDev
|
||||
{
|
||||
}
|
||||
|
||||
AddrRangeList getAddrRanges()
|
||||
AddrRangeList getAddrRanges() const
|
||||
{
|
||||
return device->getIntAddrRange();
|
||||
}
|
||||
@@ -152,7 +152,7 @@ class IntDev
|
||||
}
|
||||
|
||||
virtual AddrRangeList
|
||||
getIntAddrRange()
|
||||
getIntAddrRange() const
|
||||
{
|
||||
panic("intAddrRange not implemented.\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user