VirtualBox

Changeset 9579 in vbox


Ignore:
Timestamp:
Jun 10, 2008 4:42:00 PM (16 years ago)
Author:
vboxsync
Message:

Added RTCpuSetIsMemberByIndex().

File:
1 edited

Legend:

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

    r9368 r9579  
    7777
    7878/**
    79  * Adds a CPU given by it's identifier to the set.
     79 * Adds a CPU given by its identifier to the set.
    8080 *
    8181 * @returns 0 on success, -1 if idCpu isn't valid.
     
    9595
    9696/**
    97  * Removes a CPU given by it's identifier from the set.
     97 * Removes a CPU given by its identifier from the set.
    9898 *
    9999 * @returns 0 on success, -1 if idCpu isn't valid.
     
    113113
    114114/**
    115  * Checks if a CPU given by it's identifier is a member of the set.
     115 * Checks if a CPU given by its identifier is a member of the set.
    116116 *
    117117 * @returns true / false accordingly.
     
    124124    int iCpu = RTMpCpuIdToSetIndex(idCpu);
    125125    if (RT_UNLIKELY(iCpu < 0))
     126        return false;
     127    return ASMBitTest((volatile void *)pSet, iCpu);
     128}
     129
     130
     131/**
     132 * Checks if a CPU given by its index is a member of the set.
     133 *
     134 * @returns true / false accordingly.
     135 * @param   pSet    Pointer to the set.
     136 * @param   iCpu    The index of the CPU in the set.
     137 * @remarks The test is atomic.
     138 */
     139DECLINLINE(bool) RTCpuSetIsMemberByIndex(PCRTCPUSET pSet, RTCPUID iCpu)
     140{
     141    if (RT_UNLIKELY(iCpu >= RTCPUSET_MAX_CPUS))
    126142        return false;
    127143    return ASMBitTest((volatile void *)pSet, iCpu);
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