diff options
author | Michael Meskes <meskes@debian.org> | 2009-11-19 17:48:11 +0100 |
---|---|---|
committer | Michael Meskes <meskes@debian.org> | 2009-11-19 17:48:11 +0100 |
commit | fd892711c6bdc0ef96b6b3ea13b668cb2a38196e (patch) | |
tree | e6ec126da2bcd6a490d5661118630edf983580ec /src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp | |
parent | 8dc3a7e38d0783262b1aa8c3462e7359d8996d98 (diff) | |
parent | b35715c68a1bec309bc1990353e35c20a21d5c47 (diff) | |
download | virtualbox-debian/3.0.10-dfsg-2bpo50+1.tar.gz |
Merge branch 'master' into lennydebian/3.0.10-dfsg-2bpo50+1
Conflicts:
debian/changelog
Diffstat (limited to 'src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp')
-rw-r--r-- | src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp index b870cb0c7..1615ac7ab 100644 --- a/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp +++ b/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp @@ -56,6 +56,14 @@ RTCPUSET g_rtMpNtCpuSet; PFNMYEXSETTIMERRESOLUTION g_pfnrtNtExSetTimerResolution; /** KeFlushQueuedDpcs, introduced in XP. */ PFNMYKEFLUSHQUEUEDDPCS g_pfnrtNtKeFlushQueuedDpcs; +/** HalRequestIpi, introduced in ??. */ +PFNHALREQUESTIPI g_pfnrtNtHalRequestIpi; +/** HalSendSoftwareInterrupt */ +PFNHALSENDSOFTWAREINTERRUPT g_pfnrtNtHalSendSoftwareInterrupt; +/** SendIpi handler based on Windows version */ +PFNRTSENDIPI g_pfnrtSendIpi; +/** KeIpiGenericCall - Windows Server 2003+ only */ +PFNRTKEIPIGENERICCALL g_pfnrtKeIpiGenericCall; /** Offset of the _KPRCB::QuantumEnd field. 0 if not found. */ uint32_t g_offrtNtPbQuantumEnd; @@ -82,6 +90,9 @@ int rtR0InitNative(void) #ifdef IPRT_TARGET_NT4 g_pfnrtNtExSetTimerResolution = NULL; g_pfnrtNtKeFlushQueuedDpcs = NULL; + g_pfnrtNtHalRequestIpi = NULL; + g_pfnrtNtHalSendSoftwareInterrupt = NULL; + g_pfnrtKeIpiGenericCall = NULL; #else /* * Initialize the function pointers. @@ -92,6 +103,15 @@ int rtR0InitNative(void) RtlInitUnicodeString(&RoutineName, L"KeFlushQueuedDpcs"); g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName); + + RtlInitUnicodeString(&RoutineName, L"HalRequestIpi"); + g_pfnrtNtHalRequestIpi = (PFNHALREQUESTIPI)MmGetSystemRoutineAddress(&RoutineName); + + RtlInitUnicodeString(&RoutineName, L"HalSendSoftwareInterrupt"); + g_pfnrtNtHalSendSoftwareInterrupt = (PFNHALSENDSOFTWAREINTERRUPT)MmGetSystemRoutineAddress(&RoutineName); + + RtlInitUnicodeString(&RoutineName, L"KeIpiGenericCall"); + g_pfnrtKeIpiGenericCall = (PFNRTKEIPIGENERICCALL)MmGetSystemRoutineAddress(&RoutineName); #endif /* @@ -102,6 +122,25 @@ int rtR0InitNative(void) ULONG BuildNumber = 0; BOOLEAN fChecked = PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL); + g_pfnrtSendIpi = rtMpSendIpiDummy; +#ifndef IPRT_TARGET_NT4 + if ( g_pfnrtNtHalRequestIpi + && MajorVersion == 6 + && MinorVersion == 0) + { + /* Vista or Windows Server 2008 */ + g_pfnrtSendIpi = rtMpSendIpiVista; + } + else + if ( g_pfnrtNtHalSendSoftwareInterrupt + && MajorVersion == 6 + && MinorVersion == 1) + { + /* Windows 7 or Windows Server 2008 R2 */ + g_pfnrtSendIpi = rtMpSendIpiWin7; + } + /* Windows XP should send always send an IPI -> VERIFY */ +#endif KIRQL OldIrql; KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); /* make sure we stay on the same cpu */ |