VirtualBox

Changeset 52128 in vbox for trunk/src/VBox/Devices/Input


Ignore:
Timestamp:
Jul 22, 2014 3:01:00 PM (10 years ago)
Author:
vboxsync
Message:

PS2M: Do not delay resets (too much trouble).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/PS2M.cpp

    r50998 r52128  
    219219    /** Set if the throttle delay is active. */
    220220    bool                fThrottleActive;
     221    /** Set if the throttle delay is active. */
     222    bool                fDelayReset;
    221223    /** Operational mode. */
    222224    PS2M_MODE           enmMode;
     
    401403    if (pDrv)
    402404        pDrv->pfnReportModes(pDrv, fEnabled, false, false);
     405}
     406
     407/* Reset the pointing device. */
     408static 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);
    403417}
    404418
     
    525539    }
    526540
     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
    527547    switch (cmd)
    528548    {
     
    576596        case ACMD_ENABLE:
    577597            pThis->u8State |= AUX_STATE_ENABLED;
    578             //@todo: R3 only!
    579598#ifdef IN_RING3
    580599            ps2mSetDriverState(pThis, true);
     600#else
     601            AssertLogRelMsgFailed(("Invalid ACMD_ENABLE outside R3!\n"));
    581602#endif
    582603            ps2kClearQueue((GeneriQ *)&pThis->evtQ);
     
    603624            pThis->enmMode   = AUX_MODE_RESET;
    604625            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
    607635            break;
    608636        /* The following commands need a parameter. */
     
    777805
    778806    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);
    783808
    784809    ///@todo Might want a PS2MCompleteCommand() to push last response, clear command, and kick the KBC...
    785810    /* Give the KBC a kick. */
    786811    KBCUpdateInterrupts(pThis->pParent);
    787 
    788     //@todo: move to its proper home!
    789     ps2mSetDriverState(pThis, true);
    790812}
    791813
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette