From 46d9adb68c96b94ae25bbe92d34e375daf532ece Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 9 Jul 2012 12:35:34 -0400 Subject: 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. --- src/dev/x86/i8042.cc | 3 ++- src/dev/x86/i8042.hh | 2 +- src/dev/x86/i82094aa.hh | 4 ++-- src/dev/x86/intdev.hh | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/dev/x86') 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"); } -- cgit v1.2.3