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/dev | |
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/dev')
-rw-r--r-- | src/dev/arm/gic.cc | 2 | ||||
-rw-r--r-- | src/dev/arm/gic.hh | 2 | ||||
-rw-r--r-- | src/dev/arm/pl111.cc | 2 | ||||
-rw-r--r-- | src/dev/arm/pl111.hh | 2 | ||||
-rw-r--r-- | src/dev/io_device.cc | 4 | ||||
-rw-r--r-- | src/dev/io_device.hh | 6 | ||||
-rw-r--r-- | src/dev/pciconfigall.cc | 2 | ||||
-rw-r--r-- | src/dev/pciconfigall.hh | 2 | ||||
-rw-r--r-- | src/dev/pcidev.cc | 4 | ||||
-rw-r--r-- | src/dev/pcidev.hh | 4 | ||||
-rw-r--r-- | src/dev/sparc/iob.cc | 2 | ||||
-rw-r--r-- | src/dev/sparc/iob.hh | 2 | ||||
-rw-r--r-- | src/dev/uart8250.cc | 2 | ||||
-rw-r--r-- | src/dev/uart8250.hh | 2 | ||||
-rw-r--r-- | src/dev/x86/i8042.cc | 3 | ||||
-rw-r--r-- | src/dev/x86/i8042.hh | 2 | ||||
-rw-r--r-- | src/dev/x86/i82094aa.hh | 4 | ||||
-rw-r--r-- | src/dev/x86/intdev.hh | 4 |
18 files changed, 26 insertions, 25 deletions
diff --git a/src/dev/arm/gic.cc b/src/dev/arm/gic.cc index 143cae9f1..725199bc4 100644 --- a/src/dev/arm/gic.cc +++ b/src/dev/arm/gic.cc @@ -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)); diff --git a/src/dev/arm/gic.hh b/src/dev/arm/gic.hh index 67d48cd86..9d93bbedf 100644 --- a/src/dev/arm/gic.hh +++ b/src/dev/arm/gic.hh @@ -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() diff --git a/src/dev/arm/pl111.cc b/src/dev/arm/pl111.cc index c1edc29ea..998644a8c 100644 --- a/src/dev/arm/pl111.cc +++ b/src/dev/arm/pl111.cc @@ -746,7 +746,7 @@ Pl111::generateInterrupt() } AddrRangeList -Pl111::getAddrRanges() +Pl111::getAddrRanges() const { AddrRangeList ranges; ranges.push_back(RangeSize(pioAddr, pioSize)); diff --git a/src/dev/arm/pl111.hh b/src/dev/arm/pl111.hh index 36dfc46c1..c4fb84efa 100644 --- a/src/dev/arm/pl111.hh +++ b/src/dev/arm/pl111.hh @@ -329,7 +329,7 @@ class Pl111: public AmbaDmaDevice * * @return a list of non-overlapping address ranges */ - AddrRangeList getAddrRanges(); + AddrRangeList getAddrRanges() const; }; #endif diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 100c04828..b03afc5c6 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -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; diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh index 3f2802332..260053169 100644 --- a/src/dev/io_device.hh +++ b/src/dev/io_device.hh @@ -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; }; diff --git a/src/dev/pciconfigall.cc b/src/dev/pciconfigall.cc index 320f45543..4fe3b4641 100644 --- a/src/dev/pciconfigall.cc +++ b/src/dev/pciconfigall.cc @@ -85,7 +85,7 @@ PciConfigAll::write(PacketPtr pkt) AddrRangeList -PciConfigAll::getAddrRanges() +PciConfigAll::getAddrRanges() const { AddrRangeList ranges; ranges.push_back(RangeSize(pioAddr, params()->size)); diff --git a/src/dev/pciconfigall.hh b/src/dev/pciconfigall.hh index e594838fa..eb480ad16 100644 --- a/src/dev/pciconfigall.hh +++ b/src/dev/pciconfigall.hh @@ -80,7 +80,7 @@ class PciConfigAll : public PioDevice virtual Tick write(PacketPtr pkt); - AddrRangeList getAddrRanges(); + AddrRangeList getAddrRanges() const; private: Addr pioAddr; diff --git a/src/dev/pcidev.cc b/src/dev/pcidev.cc index 3c15bb002..fb4aaa799 100644 --- a/src/dev/pcidev.cc +++ b/src/dev/pcidev.cc @@ -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; diff --git a/src/dev/pcidev.hh b/src/dev/pcidev.hh index 0cda0b8ea..51d2cc93e 100644 --- a/src/dev/pcidev.hh +++ b/src/dev/pcidev.hh @@ -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 diff --git a/src/dev/sparc/iob.cc b/src/dev/sparc/iob.cc index 757c50a24..c71edd9f0 100644 --- a/src/dev/sparc/iob.cc +++ b/src/dev/sparc/iob.cc @@ -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)); diff --git a/src/dev/sparc/iob.hh b/src/dev/sparc/iob.hh index d6a47ce19..b92d3cb2a 100644 --- a/src/dev/sparc/iob.hh +++ b/src/dev/sparc/iob.hh @@ -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); diff --git a/src/dev/uart8250.cc b/src/dev/uart8250.cc index 671d5505f..a014398b2 100644 --- a/src/dev/uart8250.cc +++ b/src/dev/uart8250.cc @@ -287,7 +287,7 @@ Uart8250::dataAvailable() } AddrRangeList -Uart8250::getAddrRanges() +Uart8250::getAddrRanges() const { AddrRangeList ranges; ranges.push_back(RangeSize(pioAddr, pioSize)); diff --git a/src/dev/uart8250.hh b/src/dev/uart8250.hh index f31def2ea..e2fb043c1 100644 --- a/src/dev/uart8250.hh +++ b/src/dev/uart8250.hh @@ -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. diff --git a/src/dev/x86/i8042.cc b/src/dev/x86/i8042.cc index 746a08778..1e6464815 100644 --- a/src/dev/x86/i8042.cc +++ b/src/dev/x86/i8042.cc @@ -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; diff --git a/src/dev/x86/i8042.hh b/src/dev/x86/i8042.hh index 61220b45d..800fffc40 100644 --- a/src/dev/x86/i8042.hh +++ b/src/dev/x86/i8042.hh @@ -255,7 +255,7 @@ class I8042 : public BasicPioDevice commandByte.keyboardFullInt = 1; } - AddrRangeList getAddrRanges(); + AddrRangeList getAddrRanges() const; Tick read(PacketPtr pkt); diff --git a/src/dev/x86/i82094aa.hh b/src/dev/x86/i82094aa.hh index d3eedea7b..c90a5b812 100644 --- a/src/dev/x86/i82094aa.hh +++ b/src/dev/x86/i82094aa.hh @@ -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), diff --git a/src/dev/x86/intdev.hh b/src/dev/x86/intdev.hh index bbdd98b24..a32182a92 100644 --- a/src/dev/x86/intdev.hh +++ b/src/dev/x86/intdev.hh @@ -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"); } |