From b0b1c0205c438d382aaec54ee4b79b92e1a5e285 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 11 Jul 2013 21:56:24 -0500 Subject: devices: make more classes derive from BasicPioDevice A couple of devices that have single fixed memory mapped regions were not derived from BasicPioDevice, when that's exactly the functionality that BasicPioDevice provides. This patch gets rid of a little bit of redundant code by making those devices actually do so. Also fixed the weird case of X86ISA::Interrupts, where the class already did derive from BasicPioDevice but didn't actually use all the features it could have. Committed by: Nilay Vaish --- src/arch/x86/interrupts.cc | 20 ++++---------------- src/arch/x86/interrupts.hh | 3 --- 2 files changed, 4 insertions(+), 19 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index ad9d483c7..ae01f921f 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -222,7 +222,7 @@ X86ISA::Interrupts::read(PacketPtr pkt) reg, offset, val); pkt->setData(((uint8_t *)&val) + (offset & mask(3))); pkt->makeAtomicResponse(); - return latency; + return pioDelay; } Tick @@ -240,7 +240,7 @@ X86ISA::Interrupts::write(PacketPtr pkt) reg, offset, gtoh(val)); setReg(reg, gtoh(val)); pkt->makeAtomicResponse(); - return latency; + return pioDelay; } void X86ISA::Interrupts::requestInterrupt(uint8_t vector, @@ -347,7 +347,7 @@ X86ISA::Interrupts::recvMessage(PacketPtr pkt) break; } pkt->makeAtomicResponse(); - return latency; + return pioDelay; } @@ -367,18 +367,6 @@ X86ISA::Interrupts::recvResponse(PacketPtr pkt) } -AddrRangeList -X86ISA::Interrupts::getAddrRanges() const -{ - AddrRangeList ranges; - AddrRange range = RangeEx(x86LocalAPICAddress(initialApicId, 0), - x86LocalAPICAddress(initialApicId, 0) + - PageBytes); - ranges.push_back(range); - return ranges; -} - - AddrRangeList X86ISA::Interrupts::getIntAddrRange() const { @@ -619,7 +607,7 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val) X86ISA::Interrupts::Interrupts(Params * p) : - BasicPioDevice(p), IntDev(this, p->int_latency), latency(p->pio_latency), + BasicPioDevice(p), IntDev(this, p->int_latency), apicTimerEvent(this), pendingSmi(false), smiVector(0), pendingNmi(false), nmiVector(0), diff --git a/src/arch/x86/interrupts.hh b/src/arch/x86/interrupts.hh index de3eea1a6..959a61513 100644 --- a/src/arch/x86/interrupts.hh +++ b/src/arch/x86/interrupts.hh @@ -92,8 +92,6 @@ class Interrupts : public BasicPioDevice, IntDev /* * Timing related stuff. */ - Tick latency; - class ApicTimerEvent : public Event { private: @@ -233,7 +231,6 @@ class Interrupts : public BasicPioDevice, IntDev return entry.periodic; } - AddrRangeList getAddrRanges() const; AddrRangeList getIntAddrRange() const; BaseMasterPort &getMasterPort(const std::string &if_name, -- cgit v1.2.3