summaryrefslogtreecommitdiff
path: root/src/dev/x86
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@gmail.com>2013-07-11 21:57:04 -0500
committerSteve Reinhardt <stever@gmail.com>2013-07-11 21:57:04 -0500
commit1f43e244bda0c78844720609455fd77f6f275e51 (patch)
tree65eb7262e58a61992368dfe10f2152dd85eb6129 /src/dev/x86
parent502ad1e6757116867e0e0529c0c080320a2b440b (diff)
downloadgem5-1f43e244bda0c78844720609455fd77f6f275e51.tar.xz
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 <nilay@cs.wisc.edu>
Diffstat (limited to 'src/dev/x86')
-rw-r--r--src/dev/x86/cmos.hh3
-rw-r--r--src/dev/x86/i8042.cc18
-rw-r--r--src/dev/x86/i8042.hh14
-rw-r--r--src/dev/x86/i82094aa.cc4
-rw-r--r--src/dev/x86/i8237.hh3
-rw-r--r--src/dev/x86/i8254.hh3
-rw-r--r--src/dev/x86/i8259.cc12
-rw-r--r--src/dev/x86/speaker.hh3
8 files changed, 30 insertions, 30 deletions
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<const Params *>(_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<const Params *>(_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<const Params *>(_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<const Params *>(_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);