VirtualBox

Changeset 53064 in vbox for trunk


Ignore:
Timestamp:
Oct 15, 2014 12:50:19 PM (10 years ago)
Author:
vboxsync
Message:

HostDrivers/Support: Do the async. delta measurement from the ioctl -after- checking for fForce remeasurement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r53063 r53064  
    73827382        return VERR_INVALID_CPU_ID;
    73837383
    7384 #ifdef SUPDRV_USE_TSC_DELTA_THREAD
    7385     if (pReq->u.In.fAsync)
    7386     {
    7387         /** @todo Async. doesn't implement options like retries, waiting. We'll need
    7388          *        to pass those options to the thread somehow and implement it in the
    7389          *        thread. Check if anyone uses/needs fAsync before implementing this. */
    7390         RTCpuSetAdd(&pDevExt->TscDeltaCpuSet, idCpu);
    7391         RTSpinlockAcquire(pDevExt->hTscDeltaSpinlock);
    7392         if (   pDevExt->enmTscDeltaState == kSupDrvTscDeltaState_Listening
    7393             || pDevExt->enmTscDeltaState == kSupDrvTscDeltaState_Measuring)
    7394         {
    7395             pDevExt->enmTscDeltaState = kSupDrvTscDeltaState_WaitAndMeasure;
    7396         }
    7397         RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
    7398         RTThreadUserSignal(pDevExt->hTscDeltaThread);
    7399         return VINF_SUCCESS;
    7400     }
    7401 #endif
    7402 
    74037384    cTries       = RT_MAX(pReq->u.In.cRetries + 1, 10);
    74047385    cMsWaitRetry = RT_MAX(pReq->u.In.cMsWaitRetry, 5);
     
    74127393                && !pReq->u.In.fForce)
    74137394                return VINF_SUCCESS;
     7395
     7396#ifdef SUPDRV_USE_TSC_DELTA_THREAD
     7397            if (pReq->u.In.fAsync)
     7398            {
     7399                /** @todo Async. doesn't implement options like retries, waiting. We'll need
     7400                 *        to pass those options to the thread somehow and implement it in the
     7401                 *        thread. Check if anyone uses/needs fAsync before implementing this. */
     7402                RTCpuSetAdd(&pDevExt->TscDeltaCpuSet, idCpu);
     7403                RTSpinlockAcquire(pDevExt->hTscDeltaSpinlock);
     7404                if (   pDevExt->enmTscDeltaState == kSupDrvTscDeltaState_Listening
     7405                    || pDevExt->enmTscDeltaState == kSupDrvTscDeltaState_Measuring)
     7406                {
     7407                    pDevExt->enmTscDeltaState = kSupDrvTscDeltaState_WaitAndMeasure;
     7408                }
     7409                RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
     7410                RTThreadUserSignal(pDevExt->hTscDeltaThread);
     7411                return VINF_SUCCESS;
     7412            }
     7413#endif
    74147414
    74157415            while (!cTries--)
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