From 8c532d629732e93fa23a38328b653eb4c2314936 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 11 Oct 2008 01:31:32 -0700 Subject: X86: Hook the CMOS device to the I8259 PICs. --- src/dev/x86/i8259.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/dev/x86/i8259.cc') 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() { -- cgit v1.2.3