Changeset 9563 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Jun 10, 2008 11:01:33 AM (17 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r8245 r9563 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * … … 36 35 #include <iprt/err.h> 37 36 #include <iprt/assert.h> 37 #include <iprt/mp.h> 38 38 #include "internal/initterm.h" 39 #include "internal-r0drv-nt.h" 40 41 42 /******************************************************************************* 43 * Global Variables * 44 *******************************************************************************/ 45 /** The Nt CPU set. 46 * KeQueryActiveProcssors() cannot be called at all IRQLs and therefore we'll 47 * have to cache it. Fortunately, Nt doesn't really support taking CPUs offline 48 * or online. It's first with W2K8 that support for adding / onlining cpus at 49 * runtime is (officially) supported. Once we start caring about this, we'll 50 * simply use the native MP event callback and update this variable as cpus 51 * comes online. 52 */ 53 RTCPUSET g_rtMpNtCpuSet; 54 39 55 40 56 int rtR0InitNative(void) 41 57 { 58 /* 59 * Init the Nt cpu set. 60 */ 61 KAFFINITY ActiveProcessors = KeQueryActiveProcessors(); 62 RTCpuSetEmpty(&g_rtMpNtCpuSet); 63 RTCpuSetFromU64(&g_rtMpNtCpuSet, ActiveProcessors); 64 65 #if 0 /* W2K8 support */ 66 return RTR0MpNotificationInit(NULL); 67 #else 42 68 return VINF_SUCCESS; 69 #endif 43 70 } 44 71 … … 46 73 void rtR0TermNative(void) 47 74 { 75 #if 0 /* W2K8 support */ 76 RTR0MpNotificationTerm(NULL); 77 #endif 48 78 } 49 79 -
trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
r9436 r9563 40 40 #include <iprt/asm.h> 41 41 #include "r0drv/mp-r0drv.h" 42 #include "internal-r0drv-nt.h" 42 43 43 44 … … 95 96 return false; 96 97 97 /** @todo this must be done at init time as it's not safe under all circumstances (braindead OS design).*/98 #if 0 /* this isn't safe at all IRQLs (great work guys) */ 98 99 KAFFINITY Mask = KeQueryActiveProcessors(); 99 100 return !!(Mask & RT_BIT_64(idCpu)); 101 #else 102 return RTCpuSetIsMember(&g_rtMpNtCpuSet, idCpu); 103 #endif 100 104 } 101 105 … … 125 129 RTDECL(PRTCPUSET) RTMpGetOnlineSet(PRTCPUSET pSet) 126 130 { 131 #if 0 /* this isn't safe at all IRQLs (great work guys) */ 127 132 KAFFINITY Mask = KeQueryActiveProcessors(); 128 133 return RTCpuSetFromU64(pSet, Mask); 134 #else 135 *pSet = g_rtMpNtCpuSet; 136 return pSet; 137 #endif 129 138 } 130 139 … … 255 264 } 256 265 266 257 267 RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 258 268 { … … 260 270 } 261 271 272 262 273 RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 263 274 { 264 275 return rtMpCall(pfnWorker, pvUser1, pvUser2, RT_NT_CPUID_OTHERS, 0); 265 276 } 277 266 278 267 279 RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) -
trunk/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp
r9311 r9563 39 39 #include <iprt/cpuset.h> 40 40 #include "r0drv/mp-r0drv.h" 41 #include "internal-r0drv-nt.h" 41 42 42 43 … … 88 89 case KeProcessorAddCompleteNotify: 89 90 rtMpNotificationDoCallbacks(RTMPEVENT_ONLINE, idCpu); 91 RTCpuSetAdd(&g_rtMpNtCpuSet, idCpu); 90 92 break; 91 93
Note:
See TracChangeset
for help on using the changeset viewer.