VirtualBox

Changeset 81879 in vbox


Ignore:
Timestamp:
Nov 15, 2019 3:38:29 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134674
Message:

DevAHCI: Use the new handle based timer interface for the CCC timer. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r81878 r81879  
    511511#endif
    512512
    513     /** Countdown timer for command completion coalescing - R3 ptr */
    514     PTMTIMERR3                      pHbaCccTimerR3;
    515     /** Countdown timer for command completion coalescing - R0 ptr */
    516     PTMTIMERR0                      pHbaCccTimerR0;
    517     /** Countdown timer for command completion coalescing - RC ptr */
    518     PTMTIMERRC                      pHbaCccTimerRC;
    519 
    520 #if HC_ARCH_BITS == 64
    521     uint32_t                        Alignment4;
    522 #endif
     513    /** Countdown timer for command completion coalescing. */
     514    TMTIMERHANDLE                   hHbaCccTimer;
    523515
    524516    /** Which port number is used to mark an CCC interrupt */
     
    903895            {
    904896                /* Reset command completion coalescing state. */
    905                 TMTimerSetMillies(pAhci->CTX_SUFF(pHbaCccTimer), pAhci->uCccTimeout);
     897                PDMDevHlpTimerSetMillies(pAhci->CTX_SUFF(pDevIns), pAhci->hHbaCccTimer, pAhci->uCccTimeout);
    906898                pAhci->uCccCurrentNr = 0;
    907899
     
    936928#ifdef IN_RING3
    937929
    938 /*
    939  * Assert irq when an CCC timeout occurs
     930/**
     931 * @callback_method_impl{FNTMTIMERDEV, Assert irq when an CCC timeout occurs.}
    940932 */
    941933static DECLCALLBACK(void) ahciCccTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
     
    985977    }
    986978
    987     pAhciPort->regSSTS = (0x01 << 8)  | /* Interface is active. */
    988                          (0x03 << 0);   /* Device detected and communication established. */
     979    pAhciPort->regSSTS = (0x01 << 8)    /* Interface is active. */
     980                       | (0x03 << 0);   /* Device detected and communication established. */
    989981
    990982    /*
     
    17921784
    17931785    if (u32Value & AHCI_HBA_CCC_CTL_EN)
    1794         TMTimerSetMillies(pAhci->CTX_SUFF(pHbaCccTimer), pAhci->uCccTimeout); /* Arm the timer */
     1786        PDMDevHlpTimerSetMillies(pAhci->CTX_SUFF(pDevIns), pAhci->hHbaCccTimer, pAhci->uCccTimeout); /* Arm the timer */
    17951787    else
    1796         TMTimerStop(pAhci->CTX_SUFF(pHbaCccTimer));
     1788        PDMDevHlpTimerStop(pAhci->CTX_SUFF(pDevIns), pAhci->hHbaCccTimer);
    17971789
    17981790    return VINF_SUCCESS;
     
    20322024    if (pThis->regHbaCccCtl & AHCI_HBA_CCC_CTL_EN)
    20332025    {
    2034         rc = TMTimerStop(pThis->CTX_SUFF(pHbaCccTimer));
     2026        rc = PDMDevHlpTimerStop(pThis->CTX_SUFF(pDevIns), pThis->hHbaCccTimer);
    20352027        if (RT_FAILURE(rc))
    20362028            AssertMsgFailed(("%s: Failed to stop timer!\n", __FUNCTION__));
     
    52295221
    52305222    pAhci->pDevInsRC += offDelta;
    5231     pAhci->pHbaCccTimerRC = TMTimerRCPtr(pAhci->pHbaCccTimerR3);
    52325223
    52335224    /* Relocate every port. */
     
    57735764    if (PDMDevHlpCritSectIsInitialized(pDevIns, &pThis->lock))
    57745765    {
    5775         TMR3TimerDestroy(pThis->CTX_SUFF(pHbaCccTimer));
    5776         pThis->CTX_SUFF(pHbaCccTimer) = NULL;
     5766        PDMDevHlpTimerDestroy(pDevIns, pThis->hHbaCccTimer);
     5767        pThis->hHbaCccTimer = NIL_TMTIMERHANDLE;
    57775768
    57785769        Log(("%s: Destruct every port\n", __FUNCTION__));
     
    59945985
    59955986    /* Create the timer for command completion coalescing feature. */
    5996     rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, ahciCccTimer, pThis,
    5997                                 TMTIMER_FLAGS_NO_CRIT_SECT, "AHCI CCC Timer", &pThis->pHbaCccTimerR3);
    5998     if (RT_FAILURE(rc))
    5999     {
    6000         AssertMsgFailed(("pfnTMTimerCreate -> %Rrc\n", rc));
    6001         return rc;
    6002     }
    6003     pThis->pHbaCccTimerR0 = TMTimerR0Ptr(pThis->pHbaCccTimerR3);
    6004     pThis->pHbaCccTimerRC = TMTimerRCPtr(pThis->pHbaCccTimerR3);
     5987    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL, ahciCccTimer, pThis,
     5988                              TMTIMER_FLAGS_NO_CRIT_SECT, "AHCI CCC Timer", &pThis->hHbaCccTimer);
     5989    AssertRCReturn(rc, rc);
    60055990
    60065991    /* Status LUN. */
Note: See TracChangeset for help on using the changeset viewer.

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