summaryrefslogtreecommitdiff
path: root/src/dev/x86/i8259.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-10-11 01:31:32 -0700
committerGabe Black <gblack@eecs.umich.edu>2008-10-11 01:31:32 -0700
commit8c532d629732e93fa23a38328b653eb4c2314936 (patch)
tree99b731ecb4beba3f6db44f54c24bcb50041baf20 /src/dev/x86/i8259.cc
parentcf9afbba510ceac86e011a4b37ec848cd7f7a6ed (diff)
downloadgem5-8c532d629732e93fa23a38328b653eb4c2314936.tar.xz
X86: Hook the CMOS device to the I8259 PICs.
Diffstat (limited to 'src/dev/x86/i8259.cc')
-rw-r--r--src/dev/x86/i8259.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/dev/x86/i8259.cc b/src/dev/x86/i8259.cc
index ed9b429c8..2dd6caaff 100644
--- a/src/dev/x86/i8259.cc
+++ b/src/dev/x86/i8259.cc
@@ -133,12 +133,13 @@ X86ISA::I8259::write(PacketPtr pkt)
if (cascadeMode) {
initControlWord++;
} else {
+ cascadeBits = 0;
initControlWord = 0;
}
break;
case 0x2:
DPRINTF(I8259, "Received initialization command word 3.\n");
- if (master) {
+ if (master == NULL) {
DPRINTF(I8259, "Slaves attached to IRQs:%s%s%s%s%s%s%s%s\n",
bits(val, 0) ? " 0" : "",
bits(val, 1) ? " 1" : "",
@@ -148,8 +149,10 @@ X86ISA::I8259::write(PacketPtr pkt)
bits(val, 5) ? " 5" : "",
bits(val, 6) ? " 6" : "",
bits(val, 7) ? " 7" : "");
+ cascadeBits = val;
} else {
DPRINTF(I8259, "Slave ID is %d.\n", val & mask(3));
+ cascadeBits = val & mask(3);
}
if (expectICW4)
initControlWord++;
@@ -181,6 +184,20 @@ X86ISA::I8259::write(PacketPtr pkt)
return latency;
}
+void
+X86ISA::I8259::signalInterrupt(int line)
+{
+ DPRINTF(I8259, "Interrupt raised on line %d.\n", line);
+ if (line > 7)
+ fatal("Line number %d doesn't exist. The max is 7.\n");
+ if (bits(IMR, line)) {
+ DPRINTF(I8259, "Interrupt %d was masked.\n", line);
+ } else if (master != NULL) {
+ DPRINTF(I8259, "Propogating interrupt to master.\n");
+ master->signalInterrupt(cascadeBits);
+ }
+}
+
X86ISA::I8259 *
I8259Params::create()
{