From 1f43e244bda0c78844720609455fd77f6f275e51 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 11 Jul 2013 21:57:04 -0500 Subject: [PATCH] dev: make BasicPioDevice take size in constructor Instead of relying on derived classes explicitly assigning to the BasicPioDevice pioSize field, require them to pass a size value in to the constructor. Committed by: Nilay Vaish --- src/arch/x86/interrupts.cc | 3 +-- src/dev/alpha/backdoor.cc | 6 ++---- src/dev/alpha/tsunami_cchip.cc | 4 +--- src/dev/alpha/tsunami_io.cc | 4 +--- src/dev/alpha/tsunami_pchip.cc | 4 +--- src/dev/arm/a9scu.cc | 3 +-- src/dev/arm/amba_device.cc | 9 +++++---- src/dev/arm/amba_device.hh | 4 ++-- src/dev/arm/amba_fake.cc | 3 +-- src/dev/arm/kmi.cc | 8 +++----- src/dev/arm/pl011.cc | 5 ++--- src/dev/arm/rtc_pl031.cc | 7 +++---- src/dev/arm/rv_ctrl.cc | 3 +-- src/dev/arm/timer_cpulocal.cc | 3 +-- src/dev/arm/timer_sp804.cc | 4 ++-- src/dev/baddev.cc | 3 +-- src/dev/io_device.cc | 4 ++-- src/dev/io_device.hh | 2 +- src/dev/isa_fake.cc | 5 +---- src/dev/mips/malta_cchip.cc | 3 +-- src/dev/mips/malta_io.cc | 4 +--- src/dev/mips/malta_pchip.cc | 4 +--- src/dev/pciconfigall.cc | 4 +--- src/dev/sparc/dtod.cc | 4 +--- src/dev/sparc/mm_disk.cc | 4 ++-- src/dev/uart.cc | 4 ++-- src/dev/uart.hh | 2 +- src/dev/uart8250.cc | 3 +-- src/dev/x86/cmos.hh | 3 +-- src/dev/x86/i8042.cc | 18 ++++++++++++++++++ src/dev/x86/i8042.hh | 14 +------------- src/dev/x86/i82094aa.cc | 4 +--- src/dev/x86/i8237.hh | 3 +-- src/dev/x86/i8254.hh | 3 +-- src/dev/x86/i8259.cc | 12 ++++++------ src/dev/x86/speaker.hh | 3 +-- 36 files changed, 73 insertions(+), 103 deletions(-) diff --git a/src/arch/x86/interrupts.cc b/src/arch/x86/interrupts.cc index eba4b0010..afed9c132 100644 --- a/src/arch/x86/interrupts.cc +++ b/src/arch/x86/interrupts.cc @@ -608,7 +608,7 @@ X86ISA::Interrupts::setReg(ApicRegIndex reg, uint32_t val) X86ISA::Interrupts::Interrupts(Params * p) - : BasicPioDevice(p), IntDevice(this, p->int_latency), + : BasicPioDevice(p, PageBytes), IntDevice(this, p->int_latency), apicTimerEvent(this), pendingSmi(false), smiVector(0), pendingNmi(false), nmiVector(0), @@ -619,7 +619,6 @@ X86ISA::Interrupts::Interrupts(Params * p) pendingIPIs(0), cpu(NULL), intSlavePort(name() + ".int_slave", this, this) { - pioSize = PageBytes; memset(regs, 0, sizeof(regs)); //Set the local apic DFR to the flat model. regs[APIC_DESTINATION_FORMAT] = (uint32_t)(-1); diff --git a/src/dev/alpha/backdoor.cc b/src/dev/alpha/backdoor.cc index a3579847b..dc0e8e49f 100644 --- a/src/dev/alpha/backdoor.cc +++ b/src/dev/alpha/backdoor.cc @@ -62,12 +62,10 @@ using namespace std; using namespace AlphaISA; AlphaBackdoor::AlphaBackdoor(const Params *p) - : BasicPioDevice(p), disk(p->disk), terminal(p->terminal), + : BasicPioDevice(p, sizeof(struct AlphaAccess)), + disk(p->disk), terminal(p->terminal), system(p->system), cpu(p->cpu) { - - pioSize = sizeof(struct AlphaAccess); - alphaAccess = new Access(); alphaAccess->last_offset = pioSize - 1; diff --git a/src/dev/alpha/tsunami_cchip.cc b/src/dev/alpha/tsunami_cchip.cc index 0960c71ab..203325e75 100644 --- a/src/dev/alpha/tsunami_cchip.cc +++ b/src/dev/alpha/tsunami_cchip.cc @@ -57,10 +57,8 @@ using namespace TheISA; TsunamiCChip::TsunamiCChip(const Params *p) - : BasicPioDevice(p), tsunami(p->tsunami) + : BasicPioDevice(p, 0x10000000), tsunami(p->tsunami) { - pioSize = 0x10000000; - drir = 0; ipint = 0; itint = 0; diff --git a/src/dev/alpha/tsunami_io.cc b/src/dev/alpha/tsunami_io.cc index bccdddf85..6586cd980 100644 --- a/src/dev/alpha/tsunami_io.cc +++ b/src/dev/alpha/tsunami_io.cc @@ -69,11 +69,9 @@ TsunamiIO::RTC::RTC(const string &n, const TsunamiIOParams *p) } TsunamiIO::TsunamiIO(const Params *p) - : BasicPioDevice(p), tsunami(p->tsunami), + : BasicPioDevice(p, 0x100), tsunami(p->tsunami), pitimer(this, p->name + "pitimer"), rtc(p->name + ".rtc", p) { - pioSize = 0x100; - // set the back pointer from tsunami to myself tsunami->io = this; diff --git a/src/dev/alpha/tsunami_pchip.cc b/src/dev/alpha/tsunami_pchip.cc index fcd06c582..3ddc0f1b3 100644 --- a/src/dev/alpha/tsunami_pchip.cc +++ b/src/dev/alpha/tsunami_pchip.cc @@ -52,10 +52,8 @@ using namespace std; using namespace TheISA; TsunamiPChip::TsunamiPChip(const Params *p) -: BasicPioDevice(p) + : BasicPioDevice(p, 0x1000) { - pioSize = 0x1000; - for (int i = 0; i < 4; i++) { wsba[i] = 0; wsm[i] = 0; diff --git a/src/dev/arm/a9scu.cc b/src/dev/arm/a9scu.cc index 31d38b4ff..efb27daf9 100644 --- a/src/dev/arm/a9scu.cc +++ b/src/dev/arm/a9scu.cc @@ -45,9 +45,8 @@ #include "sim/system.hh" A9SCU::A9SCU(Params *p) - : BasicPioDevice(p) + : BasicPioDevice(p, 0x60) { - pioSize = 0x60; } Tick diff --git a/src/dev/arm/amba_device.cc b/src/dev/arm/amba_device.cc index 617a67d79..d2333417f 100644 --- a/src/dev/arm/amba_device.cc +++ b/src/dev/arm/amba_device.cc @@ -49,13 +49,14 @@ const uint64_t AmbaVendor = ULL(0xb105f00d00000000); -AmbaPioDevice::AmbaPioDevice(const Params *p) - : BasicPioDevice(p), ambaId(AmbaVendor | p->amba_id) +AmbaPioDevice::AmbaPioDevice(const Params *p, Addr pio_size) + : BasicPioDevice(p, pio_size), ambaId(AmbaVendor | p->amba_id) { } -AmbaIntDevice::AmbaIntDevice(const Params *p) - : AmbaPioDevice(p), intNum(p->int_num), gic(p->gic), intDelay(p->int_delay) +AmbaIntDevice::AmbaIntDevice(const Params *p, Addr pio_size) + : AmbaPioDevice(p, pio_size), + intNum(p->int_num), gic(p->gic), intDelay(p->int_delay) { } diff --git a/src/dev/arm/amba_device.hh b/src/dev/arm/amba_device.hh index d908ae616..3915e436c 100644 --- a/src/dev/arm/amba_device.hh +++ b/src/dev/arm/amba_device.hh @@ -82,7 +82,7 @@ class AmbaPioDevice : public BasicPioDevice, public AmbaDevice public: typedef AmbaPioDeviceParams Params; - AmbaPioDevice(const Params *p); + AmbaPioDevice(const Params *p, Addr pio_size); }; class AmbaIntDevice : public AmbaPioDevice @@ -94,7 +94,7 @@ class AmbaIntDevice : public AmbaPioDevice public: typedef AmbaIntDeviceParams Params; - AmbaIntDevice(const Params *p); + AmbaIntDevice(const Params *p, Addr pio_size); }; class AmbaDmaDevice : public DmaDevice, public AmbaDevice diff --git a/src/dev/arm/amba_fake.cc b/src/dev/arm/amba_fake.cc index 654bd3112..3ca705c6c 100644 --- a/src/dev/arm/amba_fake.cc +++ b/src/dev/arm/amba_fake.cc @@ -47,9 +47,8 @@ #include "mem/packet_access.hh" AmbaFake::AmbaFake(const Params *p) - : AmbaPioDevice(p) + : AmbaPioDevice(p, 0xfff) { - pioSize = 0xfff; } Tick diff --git a/src/dev/arm/kmi.cc b/src/dev/arm/kmi.cc index 01b1fa737..99d61c610 100644 --- a/src/dev/arm/kmi.cc +++ b/src/dev/arm/kmi.cc @@ -51,12 +51,10 @@ #include "mem/packet_access.hh" Pl050::Pl050(const Params *p) - : AmbaIntDevice(p), control(0), status(0x43), clkdiv(0), interrupts(0), - rawInterrupts(0), ackNext(false), shiftDown(false), vnc(p->vnc), - driverInitialized(false), intEvent(this) + : AmbaIntDevice(p, 0xfff), control(0), status(0x43), clkdiv(0), + interrupts(0), rawInterrupts(0), ackNext(false), shiftDown(false), + vnc(p->vnc), driverInitialized(false), intEvent(this) { - pioSize = 0xfff; - if (vnc) { if (!p->is_mouse) vnc->setKeyboard(this); diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc index 8af270878..2b4225ad5 100644 --- a/src/dev/arm/pl011.cc +++ b/src/dev/arm/pl011.cc @@ -52,11 +52,10 @@ #include "sim/sim_exit.hh" Pl011::Pl011(const Params *p) - : Uart(p), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12), imsc(0), - rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic), + : Uart(p, 0xfff), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12), + imsc(0), rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic), endOnEOT(p->end_on_eot), intDelay(p->int_delay), intEvent(this) { - pioSize = 0xfff; } Tick diff --git a/src/dev/arm/rtc_pl031.cc b/src/dev/arm/rtc_pl031.cc index ca1486f04..8f421a1da 100644 --- a/src/dev/arm/rtc_pl031.cc +++ b/src/dev/arm/rtc_pl031.cc @@ -49,11 +49,10 @@ #include "mem/packet_access.hh" PL031::PL031(Params *p) - : AmbaIntDevice(p), timeVal(mkutctime(&p->time)), lastWrittenTick(0), - loadVal(0), matchVal(0), rawInt(false), maskInt(false), - pendingInt(false), matchEvent(this) + : AmbaIntDevice(p, 0xfff), timeVal(mkutctime(&p->time)), + lastWrittenTick(0), loadVal(0), matchVal(0), + rawInt(false), maskInt(false), pendingInt(false), matchEvent(this) { - pioSize = 0xfff; } diff --git a/src/dev/arm/rv_ctrl.cc b/src/dev/arm/rv_ctrl.cc index 337ed73ad..61111d22e 100644 --- a/src/dev/arm/rv_ctrl.cc +++ b/src/dev/arm/rv_ctrl.cc @@ -43,9 +43,8 @@ #include "mem/packet_access.hh" RealViewCtrl::RealViewCtrl(Params *p) - : BasicPioDevice(p), flags(0) + : BasicPioDevice(p, 0xD4), flags(0) { - pioSize = 0xD4; } Tick diff --git a/src/dev/arm/timer_cpulocal.cc b/src/dev/arm/timer_cpulocal.cc index 458df0674..ae341e2be 100644 --- a/src/dev/arm/timer_cpulocal.cc +++ b/src/dev/arm/timer_cpulocal.cc @@ -48,7 +48,7 @@ #include "mem/packet_access.hh" CpuLocalTimer::CpuLocalTimer(Params *p) - : BasicPioDevice(p), gic(p->gic) + : BasicPioDevice(p, 0x38), gic(p->gic) { // Initialize the timer registers for each per cpu timer for (int i = 0; i < CPU_MAX; i++) { @@ -60,7 +60,6 @@ CpuLocalTimer::CpuLocalTimer(Params *p) localTimer[i].intNumWatchdog = p->int_num_watchdog; localTimer[i].cpuNum = i; } - pioSize = 0x38; } CpuLocalTimer::Timer::Timer() diff --git a/src/dev/arm/timer_sp804.cc b/src/dev/arm/timer_sp804.cc index d4550845d..25bc08003 100644 --- a/src/dev/arm/timer_sp804.cc +++ b/src/dev/arm/timer_sp804.cc @@ -47,10 +47,10 @@ #include "mem/packet_access.hh" Sp804::Sp804(Params *p) - : AmbaPioDevice(p), gic(p->gic), timer0(name() + ".timer0", this, p->int_num0, p->clock0), + : AmbaPioDevice(p, 0xfff), gic(p->gic), + timer0(name() + ".timer0", this, p->int_num0, p->clock0), timer1(name() + ".timer1", this, p->int_num1, p->clock1) { - pioSize = 0xfff; } Sp804::Timer::Timer(std::string __name, Sp804 *_parent, int int_num, Tick _clock) diff --git a/src/dev/baddev.cc b/src/dev/baddev.cc index 9fb88d876..b3a30b7e5 100644 --- a/src/dev/baddev.cc +++ b/src/dev/baddev.cc @@ -46,9 +46,8 @@ using namespace std; BadDevice::BadDevice(Params *p) - : BasicPioDevice(p), devname(p->devicename) + : BasicPioDevice(p, 0x10), devname(p->devicename) { - pioSize = 0x10; } Tick diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 6f76f4f27..0c927651d 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -103,8 +103,8 @@ PioDevice::drain(DrainManager *dm) return count; } -BasicPioDevice::BasicPioDevice(const Params *p) - : PioDevice(p), pioAddr(p->pio_addr), pioSize(0), +BasicPioDevice::BasicPioDevice(const Params *p, Addr size) + : PioDevice(p), pioAddr(p->pio_addr), pioSize(size), pioDelay(p->pio_latency) {} diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh index 848b8f0ba..a528b250e 100644 --- a/src/dev/io_device.hh +++ b/src/dev/io_device.hh @@ -148,7 +148,7 @@ class BasicPioDevice : public PioDevice public: typedef BasicPioDeviceParams Params; - BasicPioDevice(const Params *p); + BasicPioDevice(const Params *p, Addr size); const Params * params() const diff --git a/src/dev/isa_fake.cc b/src/dev/isa_fake.cc index 98d3f9d45..81c7a4dcd 100644 --- a/src/dev/isa_fake.cc +++ b/src/dev/isa_fake.cc @@ -42,11 +42,8 @@ using namespace std; IsaFake::IsaFake(Params *p) - : BasicPioDevice(p) + : BasicPioDevice(p, p->ret_bad_addr ? 0 : p->pio_size) { - if (!p->ret_bad_addr) - pioSize = p->pio_size; - retData8 = p->ret_data8; retData16 = p->ret_data16; retData32 = p->ret_data32; diff --git a/src/dev/mips/malta_cchip.cc b/src/dev/mips/malta_cchip.cc index 25062e422..fe3336435 100755 --- a/src/dev/mips/malta_cchip.cc +++ b/src/dev/mips/malta_cchip.cc @@ -55,11 +55,10 @@ using namespace std; using namespace TheISA; MaltaCChip::MaltaCChip(Params *p) - : BasicPioDevice(p), malta(p->malta) + : BasicPioDevice(p, 0xfffffff), malta(p->malta) { warn("MaltaCCHIP::MaltaCChip() not implemented."); - pioSize = 0xfffffff; //Put back pointer in malta malta->cchip = this; diff --git a/src/dev/mips/malta_io.cc b/src/dev/mips/malta_io.cc index 1ae5442bf..d769b1112 100755 --- a/src/dev/mips/malta_io.cc +++ b/src/dev/mips/malta_io.cc @@ -65,11 +65,9 @@ MaltaIO::RTC::RTC(const string &name, const MaltaIOParams *p) } MaltaIO::MaltaIO(const Params *p) - : BasicPioDevice(p), malta(p->malta), + : BasicPioDevice(p, 0x100), malta(p->malta), pitimer(this, p->name + "pitimer"), rtc(p->name + ".rtc", p) { - pioSize = 0x100; - // set the back pointer from malta to myself malta->io = this; diff --git a/src/dev/mips/malta_pchip.cc b/src/dev/mips/malta_pchip.cc index 076fdfe84..37aaa1b5a 100755 --- a/src/dev/mips/malta_pchip.cc +++ b/src/dev/mips/malta_pchip.cc @@ -51,10 +51,8 @@ using namespace std; using namespace TheISA; MaltaPChip::MaltaPChip(const Params *p) -: BasicPioDevice(p) + : BasicPioDevice(p, 0x1000) { - pioSize = 0x1000; - for (int i = 0; i < 4; i++) { wsba[i] = 0; wsm[i] = 0; diff --git a/src/dev/pciconfigall.cc b/src/dev/pciconfigall.cc index d5ebb7d57..b0da01f0b 100644 --- a/src/dev/pciconfigall.cc +++ b/src/dev/pciconfigall.cc @@ -44,13 +44,11 @@ #include "sim/system.hh" PciConfigAll::PciConfigAll(const Params *p) - : BasicPioDevice(p) + : BasicPioDevice(p, p->size) { // the pio_addr Python parameter is ignored, and overridden by // this caluclated value pioAddr = p->platform->calcPciConfigAddr(params()->bus,0,0); - - pioSize = params()->size; } diff --git a/src/dev/sparc/dtod.cc b/src/dev/sparc/dtod.cc index c7243cfb8..abbab2dee 100644 --- a/src/dev/sparc/dtod.cc +++ b/src/dev/sparc/dtod.cc @@ -50,13 +50,11 @@ using namespace std; using namespace TheISA; DumbTOD::DumbTOD(const Params *p) - : BasicPioDevice(p) + : BasicPioDevice(p, 0x08) { struct tm tm = p->time; char *tz; - pioSize = 0x08; - tz = getenv("TZ"); setenv("TZ", "", 1); tzset(); diff --git a/src/dev/sparc/mm_disk.cc b/src/dev/sparc/mm_disk.cc index 0095d9f1d..0a6d14445 100644 --- a/src/dev/sparc/mm_disk.cc +++ b/src/dev/sparc/mm_disk.cc @@ -45,10 +45,10 @@ #include "sim/system.hh" MmDisk::MmDisk(const Params *p) - : BasicPioDevice(p), image(p->image), curSector((off_t)-1), dirty(false) + : BasicPioDevice(p, p->image->size() * SectorSize), + image(p->image), curSector((off_t)-1), dirty(false) { std::memset(&diskData, 0, SectorSize); - pioSize = image->size() * SectorSize; } Tick diff --git a/src/dev/uart.cc b/src/dev/uart.cc index ab0ebde2c..084511444 100644 --- a/src/dev/uart.cc +++ b/src/dev/uart.cc @@ -38,8 +38,8 @@ using namespace std; -Uart::Uart(const Params *p) - : BasicPioDevice(p), platform(p->platform), term(p->terminal) +Uart::Uart(const Params *p, Addr pio_size) + : BasicPioDevice(p, pio_size), platform(p->platform), term(p->terminal) { status = 0; diff --git a/src/dev/uart.hh b/src/dev/uart.hh index eac70bf1f..f1a26fda8 100644 --- a/src/dev/uart.hh +++ b/src/dev/uart.hh @@ -54,7 +54,7 @@ class Uart : public BasicPioDevice public: typedef UartParams Params; - Uart(const Params *p); + Uart(const Params *p, Addr pio_size); const Params * params() const diff --git a/src/dev/uart8250.cc b/src/dev/uart8250.cc index a014398b2..dfaf9088d 100644 --- a/src/dev/uart8250.cc +++ b/src/dev/uart8250.cc @@ -102,10 +102,9 @@ Uart8250::IntrEvent::scheduleIntr() Uart8250::Uart8250(const Params *p) - : Uart(p), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0), + : Uart(p, 8), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0), txIntrEvent(this, TX_INT), rxIntrEvent(this, RX_INT) { - pioSize = 8; } Tick diff --git a/src/dev/x86/cmos.hh b/src/dev/x86/cmos.hh index 83d92e721..7957e5304 100644 --- a/src/dev/x86/cmos.hh +++ b/src/dev/x86/cmos.hh @@ -71,10 +71,9 @@ class Cmos : public BasicPioDevice public: typedef CmosParams Params; - Cmos(const Params *p) : BasicPioDevice(p), latency(p->pio_latency), + Cmos(const Params *p) : BasicPioDevice(p, 2), latency(p->pio_latency), rtc(this, "rtc", p->time, true, ULL(5000000000), p->int_pin) { - pioSize = 2; memset(regs, 0, numRegs * sizeof(uint8_t)); address = 0; } diff --git a/src/dev/x86/i8042.cc b/src/dev/x86/i8042.cc index c0bd34ad2..a0a7c35ec 100644 --- a/src/dev/x86/i8042.cc +++ b/src/dev/x86/i8042.cc @@ -43,6 +43,24 @@ const uint8_t CommandAck = 0xfa; const uint8_t CommandNack = 0xfe; const uint8_t BatSuccessful = 0xaa; + +X86ISA::I8042::I8042(Params *p) + : BasicPioDevice(p, 0), // pioSize arg is dummy value... not used + latency(p->pio_latency), + dataPort(p->data_port), commandPort(p->command_port), + statusReg(0), commandByte(0), dataReg(0), lastCommand(NoCommand), + mouseIntPin(p->mouse_int_pin), keyboardIntPin(p->keyboard_int_pin) +{ + statusReg.passedSelfTest = 1; + statusReg.commandLast = 1; + statusReg.keyboardUnlocked = 1; + + commandByte.convertScanCodes = 1; + commandByte.passedSelfTest = 1; + commandByte.keyboardFullInt = 1; +} + + AddrRangeList X86ISA::I8042::getAddrRanges() const { diff --git a/src/dev/x86/i8042.hh b/src/dev/x86/i8042.hh index 800fffc40..791922142 100644 --- a/src/dev/x86/i8042.hh +++ b/src/dev/x86/i8042.hh @@ -241,19 +241,7 @@ class I8042 : public BasicPioDevice return dynamic_cast(_params); } - I8042(Params *p) : BasicPioDevice(p), latency(p->pio_latency), - dataPort(p->data_port), commandPort(p->command_port), - statusReg(0), commandByte(0), dataReg(0), lastCommand(NoCommand), - mouseIntPin(p->mouse_int_pin), keyboardIntPin(p->keyboard_int_pin) - { - statusReg.passedSelfTest = 1; - statusReg.commandLast = 1; - statusReg.keyboardUnlocked = 1; - - commandByte.convertScanCodes = 1; - commandByte.passedSelfTest = 1; - commandByte.keyboardFullInt = 1; - } + I8042(Params *p); AddrRangeList getAddrRanges() const; diff --git a/src/dev/x86/i82094aa.cc b/src/dev/x86/i82094aa.cc index f547d7c1b..12697ce62 100644 --- a/src/dev/x86/i82094aa.cc +++ b/src/dev/x86/i82094aa.cc @@ -39,7 +39,7 @@ #include "sim/system.hh" X86ISA::I82094AA::I82094AA(Params *p) - : BasicPioDevice(p), IntDevice(this, p->int_latency), + : BasicPioDevice(p, 20), IntDevice(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 @@ -56,8 +56,6 @@ X86ISA::I82094AA::I82094AA(Params *p) redirTable[i] = entry; pinStates[i] = false; } - - pioSize = 20; } void diff --git a/src/dev/x86/i8237.hh b/src/dev/x86/i8237.hh index 28d9e85a3..b1b11091b 100644 --- a/src/dev/x86/i8237.hh +++ b/src/dev/x86/i8237.hh @@ -52,9 +52,8 @@ class I8237 : public BasicPioDevice return dynamic_cast(_params); } - I8237(Params *p) : BasicPioDevice(p), latency(p->pio_latency), maskReg(0) + I8237(Params *p) : BasicPioDevice(p, 16), latency(p->pio_latency), maskReg(0) { - pioSize = 16; } Tick read(PacketPtr pkt); diff --git a/src/dev/x86/i8254.hh b/src/dev/x86/i8254.hh index e6d500f42..49ea271e9 100644 --- a/src/dev/x86/i8254.hh +++ b/src/dev/x86/i8254.hh @@ -77,10 +77,9 @@ class I8254 : public BasicPioDevice return dynamic_cast(_params); } - I8254(Params *p) : BasicPioDevice(p), latency(p->pio_latency), + I8254(Params *p) : BasicPioDevice(p, 4), latency(p->pio_latency), pit(p->name, this), intPin(p->int_pin) { - pioSize = 4; } Tick read(PacketPtr pkt); diff --git a/src/dev/x86/i8259.cc b/src/dev/x86/i8259.cc index fa54ad5d7..d599ecef3 100644 --- a/src/dev/x86/i8259.cc +++ b/src/dev/x86/i8259.cc @@ -35,15 +35,15 @@ #include "mem/packet.hh" #include "mem/packet_access.hh" -X86ISA::I8259::I8259(Params * p) : BasicPioDevice(p), IntDevice(this), - latency(p->pio_latency), output(p->output), - mode(p->mode), slave(p->slave), - IRR(0), ISR(0), IMR(0), - readIRR(true), initControlWord(0), autoEOI(false) +X86ISA::I8259::I8259(Params * p) + : BasicPioDevice(p, 2), IntDevice(this), + latency(p->pio_latency), output(p->output), + mode(p->mode), slave(p->slave), + IRR(0), ISR(0), IMR(0), + readIRR(true), initControlWord(0), autoEOI(false) { for (int i = 0; i < NumLines; i++) pinStates[i] = false; - pioSize = 2; } Tick diff --git a/src/dev/x86/speaker.hh b/src/dev/x86/speaker.hh index 2886a76d7..22fc03e1c 100644 --- a/src/dev/x86/speaker.hh +++ b/src/dev/x86/speaker.hh @@ -64,10 +64,9 @@ class Speaker : public BasicPioDevice return dynamic_cast(_params); } - Speaker(Params *p) : BasicPioDevice(p), + Speaker(Params *p) : BasicPioDevice(p, 1), latency(p->pio_latency), controlVal(0), timer(p->i8254) { - pioSize = 1; } Tick read(PacketPtr pkt); -- 2.30.2