- Timestamp:
- Aug 19, 2009 2:02:05 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/solaris/vbi
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/mp-r0drv-solaris.c
r22073 r22347 38 38 39 39 #include <iprt/asm.h> 40 #include <iprt/cpuset.h>41 40 #include <iprt/err.h> 41 #include "internal-r0drv-solaris.h" 42 42 #include "r0drv/mp-r0drv.h" 43 43 … … 76 76 RTDECL(bool) RTMpIsCpuOnline(RTCPUID idCpu) 77 77 { 78 /* 79 * We cannot query CPU status recursively, check cpu member from cached set. 80 */ 81 if (idCpu >= vbi_cpu_count()) 82 return false; 83 84 return RTCpuSetIsMember(&g_rtMpSolarisCpuSet, idCpu); 85 86 #if 0 78 87 return idCpu < vbi_cpu_count() && vbi_cpu_online(idCpu); 88 #endif 79 89 } 80 90 … … 110 120 RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet) 111 121 { 122 /* 123 * We cannot query CPU status recursively, return the cached set. 124 */ 125 *pSet = g_rtMpSolarisCpuSet; 126 return pSet; 127 128 #if 0 112 129 RTCPUID idCpu; 113 130 … … 121 138 122 139 return pSet; 140 #endif 123 141 } 124 142 … … 126 144 RTDECL(RTCPUID) RTMpGetOnlineCount(void) 127 145 { 146 RTCPUSET Set; 147 RTMpGetOnlineSet(&Set); 148 return RTCpuSetCount(&Set); 149 150 #if 0 128 151 int c; 129 152 int cnt = 0; … … 135 158 } 136 159 return cnt; 160 #endif 137 161 } 138 162 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/mpnotification-r0drv-solaris.c
r22073 r22347 38 38 #include <iprt/mp.h> 39 39 #include "r0drv/mp-r0drv.h" 40 #include "internal-r0drv-solaris.h" 40 41 41 42 … … 45 46 static vbi_cpu_watch_t *g_hVbiCpuWatch = NULL; 46 47 48 RTCPUSET g_rtMpSolarisCpuSet; 47 49 48 50 static void rtMpNotificationSolarisCallback(void *pvUser, int iCpu, int online) … … 52 54 /* ASSUMES iCpu == RTCPUID */ 53 55 if (online) 56 { 57 RTCpuSetAdd(&g_rtMpSolarisCpuSet, iCpu); 54 58 rtMpNotificationDoCallbacks(RTMPEVENT_ONLINE, iCpu); 59 } 55 60 else 61 { 62 RTCpuSetDel(&g_rtMpSolarisCpuSet, iCpu); 56 63 rtMpNotificationDoCallbacks(RTMPEVENT_OFFLINE, iCpu); 64 } 57 65 } 58 66 … … 64 72 if (g_hVbiCpuWatch != NULL) 65 73 return VERR_WRONG_ORDER; 74 75 /* 76 * Cache the list of online CPUs. 77 */ 78 RTCpuSetEmpty(&g_rtMpSolarisCpuSet); 79 66 80 g_hVbiCpuWatch = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 0); 81 82 RTCPUID idCpu = RTMpGetMaxCpuId(); 83 do 84 { 85 /** @todo vbi_cpu_online() should do boundary check "idCpu" rather than hang the system. */ 86 if ( RTMpIsCpuPossible(idCpu) 87 && vbi_cpu_online(idCpu)) 88 { 89 RTCpuSetAdd(&g_rtMpSolarisCpuSet, idCpu); 90 } 91 } while (idCpu-- > 0); 92 67 93 return VINF_SUCCESS; 68 94 }
Note:
See TracChangeset
for help on using the changeset viewer.