Changeset 37294 in vbox
- Timestamp:
- Jun 1, 2011 2:11:14 PM (14 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
r36951 r37294 36 36 #include <iprt/err.h> 37 37 #include <iprt/asm.h> 38 #include <iprt/thread.h> 38 39 #include "r0drv/mp-r0drv.h" 39 40 … … 288 289 RTMPARGS Args; 289 290 291 RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER; 290 292 Args.pfnWorker = pfnWorker; 291 293 Args.pvUser1 = pvUser1; … … 297 299 return VERR_CPU_NOT_FOUND; 298 300 299 # ifdef preempt_disable 300 preempt_disable(); 301 # endif 301 RTThreadPreemptDisable(&PreemptState); 302 302 if (idCpu != RTMpCpuId()) 303 303 { … … 322 322 rc = VINF_SUCCESS; 323 323 } 324 # ifdef preempt_enable 325 preempt_enable(); 326 # endif 324 RTThreadPreemptRestore(&PreemptState);; 327 325 328 326 NOREF(rc); -
trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
r36555 r37294 35 35 #include <iprt/err.h> 36 36 #include <iprt/cpuset.h> 37 #include <iprt/thread.h> 37 38 #include "r0drv/mp-r0drv.h" 38 39 … … 68 69 69 70 /** 70 * The native callback. 71 * 72 * @returns 0. 73 * @param pNotifierBlock Pointer to g_NotifierBlock. 74 * @param ulNativeEvent The native event. 75 * @param pvCpu The cpu id cast into a pointer value. 76 */ 77 static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu) 78 { 79 RTCPUID idCpu = (uintptr_t)pvCpu; 80 NOREF(pNotifierBlock); 71 * Notification wrapper that updates CPU states and invokes our notification 72 * callbacks. 73 * 74 * @param idCpu The CPU Id. 75 * @param pvUser1 Pointer to the notifier_block (unused). 76 * @param pvUser2 The notification event. 77 * @remarks This can be invoked in interrupt context. 78 */ 79 static void rtMpNotificationLinuxOnCurrentCpu(RTCPUID idCpu, void *pvUser1, void *pvUser2) 80 { 81 unsigned long ulNativeEvent = *(unsigned long *)pvUser2; 82 NOREF(pvUser1); 83 84 AssertRelease(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 85 AssertRelease(idCpu == RTMpCpuId()); /* ASSUMES iCpu == RTCPUID */ 81 86 82 87 /* … … 100 105 # endif 101 106 if (!RTCpuSetIsMember(&g_MpPendingOfflineSet, idCpu)) 102 return 0;107 return; 103 108 /* fall thru */ 104 109 # endif … … 135 140 break; 136 141 } 137 142 } 143 144 145 /** 146 * The native callback. 147 * 148 * @returns NOTIFY_DONE. 149 * @param pNotifierBlock Pointer to g_NotifierBlock. 150 * @param ulNativeEvent The native event. 151 * @param pvCpu The cpu id cast into a pointer value. 152 * @remarks This can fire with preemption enabled and on any CPU. 153 */ 154 static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu) 155 { 156 int rc; 157 RTCPUID idCpu = (uintptr_t)pvCpu; 158 NOREF(pNotifierBlock); 159 160 /* 161 * Reschedule the callbacks to fire on the specific CPU with preemption disabled. 162 */ 163 rc = RTMpOnSpecific(idCpu, rtMpNotificationLinuxOnCurrentCpu, pNotifierBlock, &ulNativeEvent); 164 Assert(RT_SUCCESS(rc)); 138 165 return NOTIFY_DONE; 139 166 }
Note:
See TracChangeset
for help on using the changeset viewer.