Changeset 52128 in vbox for trunk/src/VBox/Devices/Input
- Timestamp:
- Jul 22, 2014 3:01:00 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/PS2M.cpp
r50998 r52128 219 219 /** Set if the throttle delay is active. */ 220 220 bool fThrottleActive; 221 /** Set if the throttle delay is active. */ 222 bool fDelayReset; 221 223 /** Operational mode. */ 222 224 PS2M_MODE enmMode; … … 401 403 if (pDrv) 402 404 pDrv->pfnReportModes(pDrv, fEnabled, false, false); 405 } 406 407 /* Reset the pointing device. */ 408 static void ps2mReset(PPS2M pThis) 409 { 410 ps2kInsertQueue((GeneriQ *)&pThis->cmdQ, ARSP_BAT_OK); 411 ps2kInsertQueue((GeneriQ *)&pThis->cmdQ, 0); 412 pThis->enmMode = AUX_MODE_STD; 413 pThis->u8CurrCmd = 0; 414 415 //@todo: move to its proper home! 416 ps2mSetDriverState(pThis, true); 403 417 } 404 418 … … 525 539 } 526 540 541 #ifndef IN_RING3 542 /* Reset and Set Default commands must be run in R3. */ 543 if (cmd == ACMD_RESET || cmd == ACMD_SET_DEFAULT) 544 return VINF_IOM_R3_IOPORT_WRITE; 545 #endif 546 527 547 switch (cmd) 528 548 { … … 576 596 case ACMD_ENABLE: 577 597 pThis->u8State |= AUX_STATE_ENABLED; 578 //@todo: R3 only!579 598 #ifdef IN_RING3 580 599 ps2mSetDriverState(pThis, true); 600 #else 601 AssertLogRelMsgFailed(("Invalid ACMD_ENABLE outside R3!\n")); 581 602 #endif 582 603 ps2kClearQueue((GeneriQ *)&pThis->evtQ); … … 603 624 pThis->enmMode = AUX_MODE_RESET; 604 625 ps2kInsertQueue((GeneriQ *)&pThis->cmdQ, ARSP_ACK); 605 /* Slightly delay reset completion; it might take hundreds of ms. */ 606 TMTimerSetMillies(pThis->CTX_SUFF(pDelayTimer), 1); 626 if (pThis->fDelayReset) 627 /* Slightly delay reset completion; it might take hundreds of ms. */ 628 TMTimerSetMillies(pThis->CTX_SUFF(pDelayTimer), 1); 629 else 630 #ifdef IN_RING3 631 ps2mReset(pThis); 632 #else 633 AssertLogRelMsgFailed(("Invalid ACMD_RESET outside R3!\n")); 634 #endif 607 635 break; 608 636 /* The following commands need a parameter. */ … … 777 805 778 806 Assert(pThis->u8CurrCmd == ACMD_RESET); 779 ps2kInsertQueue((GeneriQ *)&pThis->cmdQ, ARSP_BAT_OK); 780 ps2kInsertQueue((GeneriQ *)&pThis->cmdQ, 0); 781 pThis->enmMode = AUX_MODE_STD; 782 pThis->u8CurrCmd = 0; 807 ps2mReset(pThis); 783 808 784 809 ///@todo Might want a PS2MCompleteCommand() to push last response, clear command, and kick the KBC... 785 810 /* Give the KBC a kick. */ 786 811 KBCUpdateInterrupts(pThis->pParent); 787 788 //@todo: move to its proper home!789 ps2mSetDriverState(pThis, true);790 812 } 791 813
Note:
See TracChangeset
for help on using the changeset viewer.