Changeset 24021 in vbox
- Timestamp:
- Oct 23, 2009 11:29:18 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53864
- Location:
- trunk/src/VBox/Runtime/r0drv/nt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp ¶
r23546 r24021 54 54 55 55 /** ExSetTimerResolution, introduced in W2K. */ 56 PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution;56 PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution; 57 57 /** KeFlushQueuedDpcs, introduced in XP. */ 58 PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs; 59 /** HalRequestIpi, introduced in ??. */ 60 PFNHALREQUESTIPI g_pfnrtNtHalRequestIpi; 61 /** HalSendSoftwareInterrupt */ 62 PFNHALSENDSOFTWAREINTERRUPT g_pfnrtNtHalSendSoftwareInterrupt; 63 /** SendIpi handler based on Windows version */ 64 PFNRTSENDIPI g_pfnrtSendIpi; 65 /** KeIpiGenericCall - Windows Server 2003+ only */ 66 PFNRTKEIPIGENERICCALL g_pfnrtKeIpiGenericCall; 58 PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs; 59 /** KeSetSystemAffinityThread - Windows 2000+ */ 60 PFNRTKESETSYSTEMAFFINITYTHREAD g_pfnrtKeSetSystemAffinityThread; 61 67 62 68 63 /** Offset of the _KPRCB::QuantumEnd field. 0 if not found. */ … … 91 86 g_pfnrtNtExSetTimerResolution = NULL; 92 87 g_pfnrtNtKeFlushQueuedDpcs = NULL; 93 g_pfnrtNtHalRequestIpi = NULL; 94 g_pfnrtNtHalSendSoftwareInterrupt = NULL; 95 g_pfnrtKeIpiGenericCall = NULL; 88 g_pfnrtKeSetSystemAffinityThread = NULL; 96 89 #else 97 90 /* … … 105 98 g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName); 106 99 107 RtlInitUnicodeString(&RoutineName, L"HalRequestIpi"); 108 g_pfnrtNtHalRequestIpi = (PFNHALREQUESTIPI)MmGetSystemRoutineAddress(&RoutineName); 109 110 RtlInitUnicodeString(&RoutineName, L"HalSendSoftwareInterrupt"); 111 g_pfnrtNtHalSendSoftwareInterrupt = (PFNHALSENDSOFTWAREINTERRUPT)MmGetSystemRoutineAddress(&RoutineName); 112 113 RtlInitUnicodeString(&RoutineName, L"KeIpiGenericCall"); 114 g_pfnrtKeIpiGenericCall = (PFNRTKEIPIGENERICCALL)MmGetSystemRoutineAddress(&RoutineName); 100 RtlInitUnicodeString(&RoutineName, L"KeSetSystemAffinityThread"); 101 g_pfnrtKeSetSystemAffinityThread = (PFNRTKESETSYSTEMAFFINITYTHREAD)MmGetSystemRoutineAddress(&RoutineName); 115 102 #endif 116 103 … … 123 110 BOOLEAN fChecked = PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL); 124 111 125 g_pfnrtSendIpi = rtMpSendIpiDummy;126 #ifndef IPRT_TARGET_NT4127 if ( g_pfnrtNtHalRequestIpi128 && MajorVersion == 6129 && MinorVersion == 0)130 {131 /* Vista or Windows Server 2008 */132 g_pfnrtSendIpi = rtMpSendIpiVista;133 }134 else135 if ( g_pfnrtNtHalSendSoftwareInterrupt136 && MajorVersion == 6137 && MinorVersion == 1)138 {139 /* Windows 7 or Windows Server 2008 R2 */140 g_pfnrtSendIpi = rtMpSendIpiWin7;141 }142 /* Windows XP should send always send an IPI -> VERIFY */143 #endif144 112 KIRQL OldIrql; 145 113 KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); /* make sure we stay on the same cpu */ -
TabularUnified trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h ¶
r23546 r24021 41 41 typedef ULONG (__stdcall *PFNMYEXSETTIMERRESOLUTION)(ULONG, BOOLEAN); 42 42 typedef VOID (__stdcall *PFNMYKEFLUSHQUEUEDDPCS)(VOID); 43 typedef VOID (__stdcall *PFNHALREQUESTIPI)(KAFFINITY TargetSet); 44 typedef VOID (__stdcall *PFNHALSENDSOFTWAREINTERRUPT)(ULONG ProcessorNumber, KIRQL Irql); 45 typedef int (__stdcall *PFNRTSENDIPI)(RTCPUID idCpu); 46 typedef ULONG_PTR (__stdcall *PFNRTKEIPIGENERICCALL)(PKIPI_BROADCAST_WORKER BroadcastFunction, ULONG_PTR Context); 43 typedef VOID (__stdcall *PFNRTKESETSYSTEMAFFINITYTHREAD)(KAFFINITY); 47 44 48 45 /******************************************************************************* … … 52 49 extern PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution; 53 50 extern PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs; 54 extern PFNHALREQUESTIPI g_pfnrtNtHalRequestIpi; 55 extern PFNHALSENDSOFTWAREINTERRUPT g_pfnrtNtHalSendSoftwareInterrupt; 56 extern PFNRTSENDIPI g_pfnrtSendIpi; 57 extern PFNRTKEIPIGENERICCALL g_pfnrtKeIpiGenericCall; 51 extern PFNRTKESETSYSTEMAFFINITYTHREAD g_pfnrtKeSetSystemAffinityThread; 58 52 extern uint32_t g_offrtNtPbQuantumEnd; 59 53 extern uint32_t g_cbrtNtPbQuantumEnd; 60 54 extern uint32_t g_offrtNtPbDpcQueueDepth; 61 62 63 int rtMpSendIpiVista(RTCPUID idCpu);64 int rtMpSendIpiWin7(RTCPUID idCpu);65 int rtMpSendIpiDummy(RTCPUID idCpu);66 55 67 56 RT_C_DECLS_END -
TabularUnified trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp ¶
r24014 r24021 347 347 } 348 348 349 #ifndef IPRT_TARGET_NT4350 351 ULONG_PTR rtMpIpiGenericCall(ULONG_PTR Argument)352 {353 return 0;354 }355 356 int rtMpSendIpiVista(RTCPUID idCpu)357 {358 g_pfnrtKeIpiGenericCall(rtMpIpiGenericCall, 0);359 //// g_pfnrtNtHalRequestIpi(1 << idCpu);360 return VINF_SUCCESS;361 }362 363 int rtMpSendIpiWin7(RTCPUID idCpu)364 {365 g_pfnrtKeIpiGenericCall(rtMpIpiGenericCall, 0);366 //// g_pfnrtNtHalSendSoftwareInterrupt(idCpu, DISPATCH_LEVEL);367 return VINF_SUCCESS;368 }369 #endif /* IPRT_TARGET_NT4 */370 371 int rtMpSendIpiDummy(RTCPUID idCpu)372 {373 return VERR_NOT_IMPLEMENTED;374 }375 376 349 RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) 377 350 { … … 380 353 ? VERR_CPU_NOT_FOUND 381 354 : VERR_CPU_OFFLINE; 382 383 int rc = g_pfnrtSendIpi(idCpu);384 if (rc == VINF_SUCCESS)385 return rc;386 355 387 356 /* Fallback. */ … … 407 376 408 377 /* Assuming here that high importance DPCs will be delivered immediately; or at least an IPI will be sent immediately. 409 * @note: not true on at least Vista & Windows 7378 * @note: seems to be true on Vista 410 379 */ 411 380 BOOLEAN bRet = KeInsertQueueDpc(&aPokeDpcs[idCpu], 0, 0); -
TabularUnified trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp ¶
r24014 r24021 170 170 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 171 171 172 #ifndef IPRT_TARGET_NT4 173 Assert(g_pfnrtKeSetSystemAffinityThread); 174 g_pfnrtKeSetSystemAffinityThread((KAFFINITY)1 << KeGetCurrentProcessorNumber()); 175 #else 172 176 KeRaiseIrql(DISPATCH_LEVEL, &pState->uchOldIrql); 177 #endif 173 178 RT_ASSERT_PREEMPT_CPUID_DISABLE(pState); 174 179 } … … 180 185 181 186 RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); 187 #ifndef IPRT_TARGET_NT4 188 Assert(g_pfnrtKeSetSystemAffinityThread); 189 g_pfnrtKeSetSystemAffinityThread(KeQueryActiveProcessors()); 190 #else 182 191 KeLowerIrql(pState->uchOldIrql); 192 #endif 183 193 pState->uchOldIrql = 255; 184 194 }
Note:
See TracChangeset
for help on using the changeset viewer.