Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

DECLINLINE ( uint64_t   ) 

Gets the TSC frequency of the calling CPU.

Returns:
TSC frequency.
Parameters:
pGip The GIP pointer.

Definition at line 243 of file sup.h.

References RT_ELEMENTS, RT_UNLIKELY, SUPGIPMODE_ASYNC_TSC, and SUPGLOBALINFOPAGE_MAGIC.

{
    unsigned iCpu;

    if (RT_UNLIKELY(!pGip || pGip->u32Magic != SUPGLOBALINFOPAGE_MAGIC))
        return ~(uint64_t)0;

    if (pGip->u32Mode != SUPGIPMODE_ASYNC_TSC)
        iCpu = 0;
    else
    {
        iCpu = ASMGetApicId();
        if (RT_UNLIKELY(iCpu >= RT_ELEMENTS(pGip->aCPUs)))
            return ~(uint64_t)0;
    }

    return pGip->aCPUs[iCpu].u64CpuHz;
}


Generated by  Doxygen 1.6.0   Back to index