1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 93 unchanged lines hidden (view full) --- 102 break; 103 case 0x1: 104 DPRINTF(I8259, "Subcommand: Nonspecific EOI.\n"); 105 break; 106 case 0x2: 107 DPRINTF(I8259, "Subcommand: No operation.\n"); 108 break; 109 case 0x3: |
110 { 111 int line = bits(val, 2, 0); 112 DPRINTF(I8259, "Subcommand: Specific EIO on line %d.\n", 113 line); 114 handleEOI(line); 115 } |
116 break; 117 case 0x4: 118 DPRINTF(I8259, "Subcommand: Rotate in auto-EOI mode (set).\n"); 119 break; 120 case 0x5: 121 DPRINTF(I8259, "Subcommand: Rotate on nonspecific EOI.\n"); 122 break; 123 case 0x6: --- 81 unchanged lines hidden (view full) --- 205 break; 206 } 207 break; 208 } 209 return latency; 210} 211 212void |
213X86ISA::I8259::handleEOI(int line) 214{ 215 ISR &= ~(1 << line); 216 // There may be an interrupt that was waiting which can 217 // now be sent. 218 if (IRR) 219 requestInterrupt(findMsbSet(IRR)); 220} 221 222void 223X86ISA::I8259::requestInterrupt(int line) 224{ 225 if (bits(ISR, 7, line) == 0) { 226 if (output) { 227 DPRINTF(I8259, "Propogating interrupt.\n"); 228 output->signalInterrupt(); 229 } else { 230 warn("Received interrupt but didn't have " 231 "anyone to tell about it.\n"); 232 } 233 } 234} 235 236void |
237X86ISA::I8259::signalInterrupt(int line) 238{ 239 DPRINTF(I8259, "Interrupt raised on line %d.\n", line); 240 if (line >= NumLines) 241 fatal("Line number %d doesn't exist. The max is %d.\n", 242 line, NumLines - 1); 243 if (bits(IMR, line)) { 244 DPRINTF(I8259, "Interrupt %d was masked.\n", line); 245 } else { 246 IRR |= 1 << line; |
247 requestInterrupt(line); |
248 } 249} 250 251int 252X86ISA::I8259::getVector() 253{ 254 /* 255 * This code only handles one slave. Since that's how the PC platform --- 21 unchanged lines hidden --- |