i8259.cc (5657:7539092b28ac) | i8259.cc (5686:f33045b4dbee) |
---|---|
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: | 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 DPRINTF(I8259, "Subcommand: Specific EIO."); 111 DPRINTF(I8259, "Reset In-Service bit %d.\n", bits(val, 2, 0)); | 110 { 111 int line = bits(val, 2, 0); 112 DPRINTF(I8259, "Subcommand: Specific EIO on line %d.\n", 113 line); 114 handleEOI(line); 115 } |
112 break; 113 case 0x4: 114 DPRINTF(I8259, "Subcommand: Rotate in auto-EOI mode (set).\n"); 115 break; 116 case 0x5: 117 DPRINTF(I8259, "Subcommand: Rotate on nonspecific EOI.\n"); 118 break; 119 case 0x6: --- 81 unchanged lines hidden (view full) --- 201 break; 202 } 203 break; 204 } 205 return latency; 206} 207 208void | 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 |
|
209X86ISA::I8259::signalInterrupt(int line) 210{ 211 DPRINTF(I8259, "Interrupt raised on line %d.\n", line); 212 if (line >= NumLines) 213 fatal("Line number %d doesn't exist. The max is %d.\n", 214 line, NumLines - 1); 215 if (bits(IMR, line)) { 216 DPRINTF(I8259, "Interrupt %d was masked.\n", line); 217 } else { 218 IRR |= 1 << line; | 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; |
219 if (bits(ISR, 7, line) == 0) { 220 if (output) { 221 DPRINTF(I8259, "Propogating interrupt.\n"); 222 output->signalInterrupt(); 223 } else { 224 warn("Received interrupt but didn't have " 225 "anyone to tell about it.\n"); 226 } 227 } | 247 requestInterrupt(line); |
228 } 229} 230 231int 232X86ISA::I8259::getVector() 233{ 234 /* 235 * This code only handles one slave. Since that's how the PC platform --- 21 unchanged lines hidden --- | 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 --- |