summaryrefslogtreecommitdiff
path: root/src/dev/x86/i8259.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-01-31 23:33:54 -0800
committerGabe Black <gblack@eecs.umich.edu>2009-01-31 23:33:54 -0800
commit6a3f255a84d93f3e621319fd81f355416e385c8c (patch)
treee6dd2386d3989fdd3169d66a14c1a057463ca323 /src/dev/x86/i8259.cc
parent64b663c6071ecd58eff6dacd38ee351038259427 (diff)
downloadgem5-6a3f255a84d93f3e621319fd81f355416e385c8c.tar.xz
X86: Rework interrupt pins to allow one to many connections.
Diffstat (limited to 'src/dev/x86/i8259.cc')
-rw-r--r--src/dev/x86/i8259.cc38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/dev/x86/i8259.cc b/src/dev/x86/i8259.cc
index b3d3a5aa2..b7c8bb08a 100644
--- a/src/dev/x86/i8259.cc
+++ b/src/dev/x86/i8259.cc
@@ -36,20 +36,12 @@
X86ISA::I8259::I8259(Params * p) : BasicPioDevice(p), IntDev(this),
latency(p->pio_latency), output(p->output),
- mode(p->mode), slave(NULL),
+ mode(p->mode), slave(p->slave),
IRR(0), ISR(0), IMR(0),
readIRR(true), initControlWord(0), autoEOI(false)
{
- if (output) {
- I8259 * master;
- master = dynamic_cast<I8259 *>(output->getDevice());
- if (master)
- master->setSlave(this);
- I82094AA * ioApic;
- ioApic = dynamic_cast<I82094AA *>(output->getDevice());
- if (ioApic)
- ioApic->setExtIntPic(this);
- }
+ for (int i = 0; i < NumLines; i++)
+ pinStates[i] = false;
pioSize = 2;
}
@@ -237,7 +229,9 @@ X86ISA::I8259::requestInterrupt(int line)
if (bits(ISR, 7, line) == 0) {
if (output) {
DPRINTF(I8259, "Propogating interrupt.\n");
- output->signalInterrupt();
+ output->raise();
+ //XXX This is a hack.
+ output->lower();
} else {
warn("Received interrupt but didn't have "
"anyone to tell about it.\n");
@@ -260,6 +254,26 @@ X86ISA::I8259::signalInterrupt(int line)
}
}
+void
+X86ISA::I8259::raiseInterruptPin(int number)
+{
+ if (number >= NumLines)
+ fatal("Line number %d doesn't exist. The max is %d.\n",
+ number, NumLines - 1);
+ if (!pinStates[number])
+ signalInterrupt(number);
+ pinStates[number] = true;
+}
+
+void
+X86ISA::I8259::lowerInterruptPin(int number)
+{
+ if (number >= NumLines)
+ fatal("Line number %d doesn't exist. The max is %d.\n",
+ number, NumLines - 1);
+ pinStates[number] = false;
+}
+
int
X86ISA::I8259::getVector()
{