Changeset 54219 in vbox for trunk/include/VBox
- Timestamp:
- Feb 16, 2015 3:27:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r54215 r54219 1616 1616 # ifdef IN_RING3 1617 1617 Assert(GIP_ARE_TSC_DELTAS_APPLICABLE(g_pSUPGlobalInfoPage)); 1618 return SUPR3ReadTsc(puTsc, pidApic); 1618 1619 /** @todo Use rdtscp after figuring out what the host OS has stuffed into the 1620 * TSC_AUX msr, otherwise use the fallback below. */ 1621 int cTries = 10; 1622 do 1623 { 1624 uint16_t idApicBefore; 1625 uint16_t idApicAfter; 1626 1627 /* The chance of getting preempted twice here is rather low, hence we 1628 take this approach. Performance matters, see @bugref{6710} comment #24. */ 1629 idApicBefore = ASMGetApicId(); 1630 *puTsc = ASMReadTSC(); 1631 idApicAfter = ASMGetApicId(); 1632 if (RT_LIKELY(idApicBefore == idApicAfter)) 1633 { 1634 SUPTscDeltaApply(g_pSUPGlobalInfoPage, puTsc, idApicBefore, NULL); 1635 if (pidApic) 1636 *pidApic = idApicBefore; 1637 return VINF_SUCCESS; 1638 } 1639 } while (cTries-- > 0); 1640 *puTsc = 0; 1641 return VERR_SUPDRV_TSC_READ_FAILED; 1642 1643 /** @todo get rid of SUPR3ReadTsc(). */ 1644 //return SUPR3ReadTsc(puTsc, pidApic); 1619 1645 # else 1620 1646 RTCCUINTREG uFlags; … … 1622 1648 bool fDeltaApplied; 1623 1649 int rc; 1650 1651 /** @todo Use rdtscp after figuring out what the host OS has stuffed into the 1652 * TSC_AUX msr, otherwise use the fallback below. */ 1624 1653 1625 1654 /* Validate. */
Note:
See TracChangeset
for help on using the changeset viewer.