VirtualBox

Changeset 9622 in vbox


Ignore:
Timestamp:
Jun 11, 2008 5:11:39 PM (17 years ago)
Author:
vboxsync
Message:

Forgot this - added RTCpuLastIndex.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpuset.h

    r9579 r9622  
    189189 * @param   pSet    Pointer to the set.
    190190 */
    191 DECLINLINE(RTCPUID) RTCpuSetCount(PRTCPUSET pSet)
    192 {
    193     RTCPUID cCpus = 0;
     191DECLINLINE(int) RTCpuSetCount(PCRTCPUSET pSet)
     192{
     193    int    cCpus = 0;
    194194    RTCPUID iCpu = 64;
    195195    while (iCpu-- > 0)
     
    200200
    201201
     202/**
     203 * Get the highest set index.
     204 *
     205 * @returns The higest set index, -1 if all bits are clear.
     206 * @param   pSet    Pointer to the set.
     207 */
     208DECLINLINE(int) RTCpuLastIndex(PCRTCPUSET pSet)
     209{
     210    /* There are more efficient ways to do this in asm.h... */
     211    int iCpu = RTCPUSET_MAX_CPUS;
     212    while (iCpu-- > 0)
     213        if (*pSet & RT_BIT_64(iCpu))
     214            return iCpu;
     215    return iCpu;
     216}
     217
     218
    202219/** @} */
    203220
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