Changeset 28455 in vbox
- Timestamp:
- Apr 19, 2010 12:23:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r28079 r28455 297 297 irq1_level = 0; 298 298 irq12_level = 0; 299 s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF); 300 if (q->count != 0) 301 { 302 s->status |= KBD_STAT_OBF; 303 if ((s->mode & KBD_MODE_KBD_INT) && !(s->mode & KBD_MODE_DISABLE_KBD)) 304 irq1_level = 1; 305 } 306 else if (mcq->count != 0 || meq->count != 0) 307 { 308 s->status |= KBD_STAT_OBF | KBD_STAT_MOUSE_OBF; 309 if (s->mode & KBD_MODE_MOUSE_INT) 310 irq12_level = 1; 299 300 /* Determine new OBF state, but only if OBF is clear. If OBF was already 301 * set, we cannot risk changing the event type after an ISR potentially 302 * started executing! Only kbd_read_data() clears the OBF bits. 303 */ 304 if (!(s->status & KBD_STAT_OBF)) { 305 s->status &= ~KBD_STAT_MOUSE_OBF; 306 /* Keyboard data has priority if both kbd and aux data is available. */ 307 if (q->count != 0) 308 { 309 s->status |= KBD_STAT_OBF; 310 } 311 else if (mcq->count != 0 || meq->count != 0) 312 { 313 s->status |= KBD_STAT_OBF | KBD_STAT_MOUSE_OBF; 314 } 315 } 316 /* Determine new IRQ state. */ 317 if (s->status & KBD_STAT_OBF) { 318 if (s->status & KBD_STAT_MOUSE_OBF) 319 { 320 if (s->mode & KBD_MODE_MOUSE_INT) 321 irq12_level = 1; 322 } 323 else 324 { /* KBD_STAT_OBF set but KBD_STAT_MOUSE_OBF isn't. */ 325 if ((s->mode & KBD_MODE_KBD_INT) && !(s->mode & KBD_MODE_DISABLE_KBD)) 326 irq1_level = 1; 327 } 311 328 } 312 329 PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, irq1_level); … … 550 567 else 551 568 PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 0); 569 /* Reading data clears the OBF bits, too. */ 570 s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF); 552 571 } 553 572 /* reassert IRQs if data left */
Note:
See TracChangeset
for help on using the changeset viewer.