Changeset 57071 in vbox
- Timestamp:
- Jul 24, 2015 2:13:40 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r57059 r57071 35 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 36 # include <iprt/asm-amd64-x86.h> 37 # include <iprt/x86.h> 37 38 #endif 38 39 … … 585 586 * frequency of the host. 586 587 * 587 * @param u64CpuHz The TSC frequency to check. 588 * @param uCpuHz The TSC frequency to check. 589 * @param puGipCpuHz Where to store the GIP TSC frequency used 590 * during the compatibility test (can be NULL). 588 591 * @param fRelax Whether to use a more relaxed threshold (like 589 592 * for when running in a virtualized environment). … … 591 594 * @returns true if it's compatible, false otherwise. 592 595 */ 593 DECLINLINE(bool) SUPIsTscFreqCompatible(uint64_t u 64CpuHz, bool fRelax)596 DECLINLINE(bool) SUPIsTscFreqCompatible(uint64_t uCpuHz, uint64_t *puGipCpuHz, bool fRelax) 594 597 { 595 598 PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage; 596 599 if ( pGip 597 && pGip->u32Mode == SUPGIPMODE_INVARIANT_TSC) 598 return SUPIsTscFreqCompatibleEx(pGip->u64CpuHz, u64CpuHz, fRelax); 600 && pGip->u32Mode != SUPGIPMODE_ASYNC_TSC) 601 { 602 uint64_t uGipCpuHz = pGip->u64CpuHz; 603 if (puGipCpuHz) 604 *puGipCpuHz = uGipCpuHz; 605 return SUPIsTscFreqCompatibleEx(uGipCpuHz, uCpuHz, fRelax); 606 } 599 607 return false; 600 608 } … … 605 613 /** @internal */ 606 614 SUPDECL(uint64_t) SUPReadTscWithDelta(PSUPGLOBALINFOPAGE pGip); 615 616 /** 617 * Checks if we are may be running in a virtualized environment. 618 * 619 * @returns true if the host system may be virtualized, false otherwise. 620 */ 621 DECLINLINE(bool) SUPIsHostVirtualized(void) 622 { 623 Assert(ASMHasCpuId()); 624 return RT_BOOL(ASMCpuId_ECX(1) & X86_CPUID_FEATURE_ECX_HVP); 625 } 607 626 608 627 /**
Note:
See TracChangeset
for help on using the changeset viewer.