Changeset 34321 in vbox
- Timestamp:
- Nov 24, 2010 1:35:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r33540 r34321 460 460 { 461 461 pDevExt->u32Cookie = BIRD; /** @todo make this random? */ 462 pDevExt->cbSession = cbSession;462 pDevExt->cbSession = (uint32_t)cbSession; 463 463 464 464 /* … … 3344 3344 PSUPGLOBALINFOPAGE pGipR0 = pDevExt->pGip; 3345 3345 uint64_t u64NanoTS; 3346 uint32_t u32SystemResolution; 3346 3347 unsigned i; 3347 3348 3348 3349 LogFlow(("SUPR0GipMap: Resumes GIP updating\n")); 3350 3351 /* 3352 * Try bump up the system timer resolution. 3353 * The more interrupts the better... 3354 */ 3355 if ( RT_SUCCESS_NP(RTTimerRequestSystemGranularity( 976563 /* 1024 HZ */, &u32SystemResolution)) 3356 || RT_SUCCESS_NP(RTTimerRequestSystemGranularity( 1000000 /* 1000 HZ */, &u32SystemResolution)) 3357 || RT_SUCCESS_NP(RTTimerRequestSystemGranularity( 1953125 /* 512 HZ */, &u32SystemResolution)) 3358 || RT_SUCCESS_NP(RTTimerRequestSystemGranularity( 2000000 /* 500 HZ */, &u32SystemResolution)) 3359 ) 3360 { 3361 Assert(RTTimerGetSystemGranularity() <= u32SystemResolution); 3362 pDevExt->u32SystemTimerGranularityGrant = u32SystemResolution; 3363 } 3349 3364 3350 3365 if (pGipR0->aCPUs[0].u32TransactionId != 2 /* not the first time */) … … 3450 3465 rc = RTTimerStop(pDevExt->pGipTimer); AssertRC(rc); rc = VINF_SUCCESS; 3451 3466 #endif 3467 3468 if (pDevExt->u32SystemTimerGranularityGrant) 3469 { 3470 int rc2 = RTTimerReleaseSystemGranularity(pDevExt->u32SystemTimerGranularityGrant); AssertRC(rc); 3471 pDevExt->u32SystemTimerGranularityGrant = 0; 3472 } 3452 3473 } 3453 3474 } … … 4867 4888 HCPhysGip = RTR0MemObjGetPagePhysAddr(pDevExt->GipMemObj, 0); Assert(HCPhysGip != NIL_RTHCPHYS); 4868 4889 4869 #if 0 /** @todo Disabled this as we didn't used to do it before and causes unnecessary stress on laptops.4870 * It only applies to Windows and should probably revisited later, if possible made part of the4871 * timer code (return min granularity in RTTimerGetSystemGranularity and set it in RTTimerStart). */4872 /*4873 * Try bump up the system timer resolution.4874 * The more interrupts the better...4875 */4876 if ( RT_SUCCESS(RTTimerRequestSystemGranularity( 488281 /* 2048 HZ */, &u32SystemResolution))4877 || RT_SUCCESS(RTTimerRequestSystemGranularity( 500000 /* 2000 HZ */, &u32SystemResolution))4878 || RT_SUCCESS(RTTimerRequestSystemGranularity( 976563 /* 1024 HZ */, &u32SystemResolution))4879 || RT_SUCCESS(RTTimerRequestSystemGranularity( 1000000 /* 1000 HZ */, &u32SystemResolution))4880 || RT_SUCCESS(RTTimerRequestSystemGranularity( 1953125 /* 512 HZ */, &u32SystemResolution))4881 || RT_SUCCESS(RTTimerRequestSystemGranularity( 2000000 /* 500 HZ */, &u32SystemResolution))4882 || RT_SUCCESS(RTTimerRequestSystemGranularity( 3906250 /* 256 HZ */, &u32SystemResolution))4883 || RT_SUCCESS(RTTimerRequestSystemGranularity( 4000000 /* 250 HZ */, &u32SystemResolution))4884 || RT_SUCCESS(RTTimerRequestSystemGranularity( 7812500 /* 128 HZ */, &u32SystemResolution))4885 || RT_SUCCESS(RTTimerRequestSystemGranularity(10000000 /* 100 HZ */, &u32SystemResolution))4886 || RT_SUCCESS(RTTimerRequestSystemGranularity(15625000 /* 64 HZ */, &u32SystemResolution))4887 || RT_SUCCESS(RTTimerRequestSystemGranularity(31250000 /* 32 HZ */, &u32SystemResolution))4888 )4889 {4890 Assert(RTTimerGetSystemGranularity() <= u32SystemResolution);4891 pDevExt->u32SystemTimerGranularityGrant = u32SystemResolution;4892 }4893 #endif4894 4895 4890 /* 4896 4891 * Find a reasonable update interval and initialize the structure. … … 4983 4978 4984 4979 /* 4985 * Finally, release the system timer resolution request if one succeeded. 4980 * Finally, make sure we've release the system timer resolution request 4981 * if one actually succeeded and is still pending. 4986 4982 */ 4987 4983 if (pDevExt->u32SystemTimerGranularityGrant) … … 5286 5282 = pGip->aCPUs[i].au32TSCHistory[6] 5287 5283 = pGip->aCPUs[i].au32TSCHistory[7] 5288 = /*pGip->aCPUs[i].u64CpuHz*/ _4G / uUpdateHz;5284 = /*pGip->aCPUs[i].u64CpuHz*/ (uint32_t)(_4G / uUpdateHz); 5289 5285 } 5290 5286
Note:
See TracChangeset
for help on using the changeset viewer.