diff options
author | Steve Reinhardt <stever@gmail.com> | 2013-07-11 21:56:24 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2013-07-11 21:56:24 -0500 |
commit | b0b1c0205c438d382aaec54ee4b79b92e1a5e285 (patch) | |
tree | f490b704b90dfaba13254565a8d59770b9cddbed /src/dev/x86/i82094aa.cc | |
parent | 8e54c93222cd69dd4c388adc37cded7b7eebef76 (diff) | |
download | gem5-b0b1c0205c438d382aaec54ee4b79b92e1a5e285.tar.xz |
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 <nilay@cs.wisc.edu>
Diffstat (limited to 'src/dev/x86/i82094aa.cc')
-rw-r--r-- | src/dev/x86/i82094aa.cc | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/dev/x86/i82094aa.cc b/src/dev/x86/i82094aa.cc index 0692718bf..1d3defa12 100644 --- a/src/dev/x86/i82094aa.cc +++ b/src/dev/x86/i82094aa.cc @@ -38,10 +38,9 @@ #include "mem/packet_access.hh" #include "sim/system.hh" -X86ISA::I82094AA::I82094AA(Params *p) : PioDevice(p), - IntDev(this, p->int_latency), - latency(p->pio_latency), pioAddr(p->pio_addr), - extIntPic(p->external_int_pic), lowestPriorityOffset(0) +X86ISA::I82094AA::I82094AA(Params *p) + : BasicPioDevice(p), IntDev(this, p->int_latency), + extIntPic(p->external_int_pic), lowestPriorityOffset(0) { // This assumes there's only one I/O APIC in the system and since the apic // id is stored in a 8-bit field with 0xff meaning broadcast, the id must @@ -57,6 +56,8 @@ X86ISA::I82094AA::I82094AA(Params *p) : PioDevice(p), redirTable[i] = entry; pinStates[i] = false; } + + pioSize = 20; } void @@ -66,10 +67,28 @@ X86ISA::I82094AA::init() // via the piodevice init() function and its int port that it inherited // from IntDev. Note IntDev is not a SimObject itself. - PioDevice::init(); + BasicPioDevice::init(); IntDev::init(); } +BaseMasterPort & +X86ISA::I82094AA::getMasterPort(const std::string &if_name, PortID idx) +{ + if (if_name == "int_master") + return intMasterPort; + return BasicPioDevice::getMasterPort(if_name, idx); +} + +AddrRangeList +X86ISA::I82094AA::getIntAddrRange() const +{ + AddrRangeList ranges; + ranges.push_back(RangeEx(x86InterruptAddress(initialApicId, 0), + x86InterruptAddress(initialApicId, 0) + + PhysAddrAPICRangeSize)); + return ranges; +} + Tick X86ISA::I82094AA::read(PacketPtr pkt) { @@ -86,7 +105,7 @@ X86ISA::I82094AA::read(PacketPtr pkt) panic("Illegal read from I/O APIC.\n"); } pkt->makeAtomicResponse(); - return latency; + return pioDelay; } Tick @@ -105,7 +124,7 @@ X86ISA::I82094AA::write(PacketPtr pkt) panic("Illegal write to I/O APIC.\n"); } pkt->makeAtomicResponse(); - return latency; + return pioDelay; } void |