VirtualBox

Ignore:
Timestamp:
Oct 13, 2016 10:35:47 AM (8 years ago)
Author:
vboxsync
Message:

SUPDrvGip: name fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrvGip.cpp

    r64235 r64236  
    134134static void                 supdrvTscDeltaThreadStartMeasurement(PSUPDRVDEVEXT pDevExt, bool fForceAll);
    135135#else
    136 static int                  supdrvMeasureInitialTscDeltas(PSUPDRVDEVEXT pDevExt);
    137 static int                  supdrvMeasureTscDeltaOne(PSUPDRVDEVEXT pDevExt, uint32_t idxWorker);
     136static int                  supdrvTscMeasureInitialDeltas(PSUPDRVDEVEXT pDevExt);
     137static int                  supdrvTscMeasureDeltaOne(PSUPDRVDEVEXT pDevExt, uint32_t idxWorker);
    138138#endif
    139139
     
    898898#else
    899899            RTCpuSetCopy(&pDevExt->TscDeltaCpuSet, &pGip->OnlineCpuSet);
    900             supdrvMeasureInitialTscDeltas(pDevExt);
     900            supdrvTscMeasureInitialDeltas(pDevExt);
    901901#endif
    902902        }
     
    14241424#else
    14251425                    uint32_t iCpu = supdrvGipFindOrAllocCpuIndexForCpuId(pGip, idCpu);
    1426                     supdrvMeasureTscDeltaOne(pDevExt, iCpu);
     1426                    supdrvTscMeasureDeltaOne(pDevExt, iCpu);
    14271427#endif
    14281428                }
     
    19251925                        do
    19261926                        {
    1927                             rc = supdrvMeasureInitialTscDeltas(pDevExt);
     1927                            rc = supdrvTscMeasureInitialDeltas(pDevExt);
    19281928                            if (   rc != VERR_TRY_AGAIN
    19291929                                && rc != VERR_CPU_OFFLINE)
     
    19841984    }
    19851985    else
    1986         OSDBGPRINT(("supdrvGipCreate: supdrvMeasureInitialTscDeltas failed. rc=%Rrc\n", rc));
     1986        OSDBGPRINT(("supdrvGipCreate: supdrvTscMeasureInitialDeltas failed. rc=%Rrc\n", rc));
    19871987
    19881988    /* Releases timer frequency increase too. */
     
    26122612
    26132613/**
    2614  * Argument package/state passed by supdrvMeasureTscDeltaOne() to the RTMpOn
     2614 * Argument package/state passed by supdrvTscMeasureDeltaOne() to the RTMpOn
    26152615 * callback worker.
    26162616 * @todo add
     
    26242624    /** Pointer to the GIP CPU array entry for the master. */
    26252625    PSUPGIPCPU                  pMaster;
    2626     /** The maximum number of ticks to spend in supdrvMeasureTscDeltaCallback.
     2626    /** The maximum number of ticks to spend in supdrvTscMeasureDeltaCallback.
    26272627     * (This is what we need a rough TSC frequency for.)  */
    26282628    uint64_t                    cMaxTscTicks;
     
    35013501/**
    35023502 * Handles the special abort procedure during synchronization setup in
    3503  * supdrvMeasureTscDeltaCallbackUnwrapped().
     3503 * supdrvTscMeasureDeltaCallbackUnwrapped().
    35043504 *
    35053505 * @returns 0 (dummy, ignored)
     
    35103510 */
    35113511DECL_NO_INLINE(static, int)
    3512 supdrvMeasureTscDeltaCallbackAbortSyncSetup(PSUPDRVGIPTSCDELTARGS pArgs, PSUPTSCDELTASYNC2 pMySync, bool fIsMaster, bool fTimeout)
     3512supdrvTscMeasureDeltaCallbackAbortSyncSetup(PSUPDRVGIPTSCDELTARGS pArgs, PSUPTSCDELTASYNC2 pMySync, bool fIsMaster, bool fTimeout)
    35133513{
    35143514    PSUPTSCDELTASYNC2 volatile *ppMySync    = fIsMaster ? &pArgs->pSyncMaster : &pArgs->pSyncWorker;
     
    35433543
    35443544/**
    3545  * This is used by supdrvMeasureInitialTscDeltas() to read the TSC on two CPUs
     3545 * This is used by supdrvTscMeasureInitialDeltas() to read the TSC on two CPUs
    35463546 * and compute the delta between them.
    35473547 *
     
    35603560 *          doing this on x86 CPUs.
    35613561 */
    3562 static int supdrvMeasureTscDeltaCallbackUnwrapped(RTCPUID idCpu, PSUPDRVGIPTSCDELTARGS pArgs)
     3562static int supdrvTscMeasureDeltaCallbackUnwrapped(RTCPUID idCpu, PSUPDRVGIPTSCDELTARGS pArgs)
    35633563{
    35643564    PSUPDRVDEVEXT               pDevExt          = pArgs->pDevExt;
     
    36063606        if (   ASMAtomicReadBool(&pArgs->fAbortSetup)
    36073607            || !RTMpIsCpuOnline(fIsMaster ? pGipCpuWorker->idCpu : pGipCpuMaster->idCpu) )
    3608             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
     3608            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
    36093609        if (   (iTry++ & 0xff) == 0
    36103610            && ASMReadTSC() - MySync.uTscStart > pArgs->cMaxTscTicks)
    3611             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, true /*fTimeout*/);
     3611            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, true /*fTimeout*/);
    36123612        TSCDELTA_DBG_CHECK_LOOP();
    36133613        ASMNopPause();
     
    36173617    if (fIsMaster)
    36183618        if (!ASMAtomicCmpXchgU32(&pOtherSync->uSyncVar, GIP_TSC_DELTA_SYNC2_READY, GIP_TSC_DELTA_SYNC2_PRESTART_WAIT)) /* parnaoia */
    3619             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
     3619            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
    36203620
    36213621    iTry = 0;
     
    36253625        ASMNopPause();
    36263626        if (ASMAtomicReadBool(&pArgs->fAbortSetup))
    3627             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
     3627            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
    36283628        if (   (iTry++ & 0xff) == 0
    36293629            && ASMReadTSC() - MySync.uTscStart > pArgs->cMaxTscTicks)
     
    36323632                && !ASMAtomicCmpXchgU32(&MySync.uSyncVar, GIP_TSC_DELTA_SYNC2_PRESTART_ABORT, GIP_TSC_DELTA_SYNC2_PRESTART_WAIT))
    36333633                break; /* race #1: slave has moved on, handle timeout in loop instead. */
    3634             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, true /*fTimeout*/);
     3634            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, true /*fTimeout*/);
    36353635        }
    36363636        TSCDELTA_DBG_CHECK_LOOP();
     
    36393639    if (!fIsMaster)
    36403640        if (!ASMAtomicCmpXchgU32(&pOtherSync->uSyncVar, GIP_TSC_DELTA_SYNC2_READY, GIP_TSC_DELTA_SYNC2_PRESTART_WAIT)) /* race #1 */
    3641             return supdrvMeasureTscDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
     3641            return supdrvTscMeasureDeltaCallbackAbortSyncSetup(pArgs, &MySync, fIsMaster, false /*fTimeout*/);
    36423642
    36433643/** @todo Add a resumable state to pArgs so we don't waste time if we time
     
    37513751
    37523752/**
    3753  * Callback used by supdrvMeasureInitialTscDeltas() to read the TSC on two CPUs
     3753 * Callback used by supdrvTscMeasureInitialDeltas() to read the TSC on two CPUs
    37543754 * and compute the delta between them.
    37553755 *
     
    37583758 * @param   pvUser2     Unused.
    37593759 */
    3760 static DECLCALLBACK(void) supdrvMeasureTscDeltaCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2)
    3761 {
    3762     supdrvMeasureTscDeltaCallbackUnwrapped(idCpu, (PSUPDRVGIPTSCDELTARGS)pvUser1);
     3760static DECLCALLBACK(void) supdrvTscMeasureDeltaCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2)
     3761{
     3762    supdrvTscMeasureDeltaCallbackUnwrapped(idCpu, (PSUPDRVGIPTSCDELTARGS)pvUser1);
    37633763    RT_NOREF1(pvUser2);
    37643764}
     
    37783778 * @remarks This must be called with preemption enabled!
    37793779 */
    3780 static int supdrvMeasureTscDeltaOne(PSUPDRVDEVEXT pDevExt, uint32_t idxWorker)
     3780static int supdrvTscMeasureDeltaOne(PSUPDRVDEVEXT pDevExt, uint32_t idxWorker)
    37813781{
    37823782    int                 rc;
     
    38773877            /*
    38783878             * Do the RTMpOnPair call.  We reset i64TSCDelta first so we
    3879              * and supdrvMeasureTscDeltaCallback can use it as a success check.
     3879             * and supdrvTscMeasureDeltaCallback can use it as a success check.
    38803880             */
    38813881            /** @todo Store the i64TSCDelta result in pArgs first?   Perhaps deals with
     
    38833883            ASMAtomicWriteS64(&pGipCpuWorker->i64TSCDelta, INT64_MAX);
    38843884            rc = RTMpOnPair(pGipCpuMaster->idCpu, pGipCpuWorker->idCpu, RTMPON_F_CONCURRENT_EXEC,
    3885                             supdrvMeasureTscDeltaCallback, pArgs, NULL);
     3885                            supdrvTscMeasureDeltaCallback, pArgs, NULL);
    38863886            if (RT_SUCCESS(rc))
    38873887            {
     
    40224022 *          supdrvGipInitOnCpu().
    40234023 */
    4024 static int supdrvMeasureInitialTscDeltas(PSUPDRVDEVEXT pDevExt)
     4024static int supdrvTscMeasureInitialDeltas(PSUPDRVDEVEXT pDevExt)
    40254025{
    40264026    PSUPGIPCPU pGipCpuMaster;
     
    40664066                && RTCpuSetIsMemberByIndex(&pDevExt->TscDeltaCpuSet, pGipCpuWorker->iCpuSet))
    40674067            {
    4068                 rc = supdrvMeasureTscDeltaOne(pDevExt, iCpu);
     4068                rc = supdrvTscMeasureDeltaOne(pDevExt, iCpu);
    40694069                if (RT_FAILURE(rc))
    40704070                {
    4071                     SUPR0Printf("supdrvMeasureTscDeltaOne failed. rc=%d CPU[%u].idCpu=%u Master[%u].idCpu=%u\n", rc, iCpu,
     4071                    SUPR0Printf("supdrvTscMeasureDeltaOne failed. rc=%d CPU[%u].idCpu=%u Master[%u].idCpu=%u\n", rc, iCpu,
    40724072                                pGipCpuWorker->idCpu, idxMaster, pDevExt->idGipMaster, pGipCpuMaster->idCpu);
    40734073                    break;
     
    41834183                    {
    41844184                        RTCpuSetCopy(&pDevExt->TscDeltaCpuSet, &pGip->OnlineCpuSet);
    4185                         rc = supdrvMeasureInitialTscDeltas(pDevExt);
     4185                        rc = supdrvTscMeasureInitialDeltas(pDevExt);
    41864186                        if (   RT_SUCCESS(rc)
    41874187                            || (   RT_FAILURE(rc)
     
    42094209                            if (pGipCpuWorker->i64TSCDelta == INT64_MAX)
    42104210                            {
    4211                                 int rc2 = supdrvMeasureTscDeltaOne(pDevExt, iCpu);
     4211                                int rc2 = supdrvTscMeasureDeltaOne(pDevExt, iCpu);
    42124212                                if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
    42134213                                    rc = rc2;
     
    46114611
    46124612        /* Measure it. */
    4613         rc = supdrvMeasureTscDeltaOne(pDevExt, iGipCpu);
     4613        rc = supdrvTscMeasureDeltaOne(pDevExt, iGipCpu);
    46144614        if (rc != VERR_SUPDRV_TSC_DELTA_MEASUREMENT_FAILED)
    46154615        {
     
    47484748
    47494749                /* Need to measure the delta an try again. */
    4750                 rc = supdrvMeasureTscDeltaOne(pDevExt, iGipCpu);
     4750                rc = supdrvTscMeasureDeltaOne(pDevExt, iGipCpu);
    47514751                Assert(pGip->aCPUs[iGipCpu].i64TSCDelta != INT64_MAX || RT_FAILURE_NP(rc));
    47524752                /** @todo should probably delay on failure... dpc watchdogs */
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