VirtualBox

Changeset 11328 in vbox


Ignore:
Timestamp:
Aug 11, 2008 11:26:11 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34448
Message:

iprt/mp-solaris: Added RTMpIsCpuOnline and implemented RTMpIsCpuOnline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/solaris/mp-solaris.cpp

    r11324 r11328  
    3737#include <errno.h>
    3838#include <kstat.h>
     39#include <sys/processor.h>
    3940
    4041#include <iprt/mp.h>
     
    202203
    203204
     205RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu)
     206{
     207    int iStatus = p_online(idCpu, P_STATUS);
     208    return iStatus == P_ONLINE
     209        || iStatus == P_NOINTR;
     210}
     211
     212
    204213RTDECL(RTCPUID) RTMpGetOnlineCount(void)
    205214{
     
    213222RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet)
    214223{
    215     /** @todo fix this! */
    216224    RTCpuSetEmpty(pSet);
    217     RTCPUID cMax = RTMpGetOnlineCount();
    218     while (cMax-- > 0)
    219         RTCpuSetAdd(pSet, cMax);
     225    int cCpus = RTMpGetCount();
     226    for (RTCPUID idCpu = 0; idCpu < cCpus; idCpu++)
     227        if (RTMpIsCpuOnline(idCpu))
     228            RTCpuSetAdd(pSet, cMax);
    220229    return pSet;
    221230}
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