VirtualBox

Changeset 23506 in vbox for trunk/src/VBox/Runtime/r0drv/nt


Ignore:
Timestamp:
Oct 2, 2009 11:12:21 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53145
Message:

Use HalSendSoftwareInterrupt in Windows 7 (not exported in Vista)

Location:
trunk/src/VBox/Runtime/r0drv/nt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

    r23413 r23506  
    5959/** HalRequestIpi, introduced in ??. */
    6060PFNHALREQUESTIPI            g_pfnrtNtHalRequestIpi;
     61/** HalSendSoftwareInterrupt */
     62PFNHALSENDSOFTWAREINTERRUPT g_pfnrtNtHalSendSoftwareInterrupt;
    6163/** SendIpi handler based on Windows version */
    6264PFNRTSENDIPI                g_pfnrtSendIpi;
     
    8890    g_pfnrtNtKeFlushQueuedDpcs = NULL;
    8991    g_pfnrtNtHalRequestIpi = NULL;
     92    g_pfnrtNtHalSendSoftwareInterrupt = NULL;
    9093#else
    9194    /*
     
    101104    RtlInitUnicodeString(&RoutineName, L"HalRequestIpi");
    102105    g_pfnrtNtHalRequestIpi = (PFNHALREQUESTIPI)MmGetSystemRoutineAddress(&RoutineName);
     106
     107    RtlInitUnicodeString(&RoutineName, L"HalSendSoftwareInterrupt");
     108    g_pfnrtNtHalSendSoftwareInterrupt = (PFNHALSENDSOFTWAREINTERRUPT)MmGetSystemRoutineAddress(&RoutineName);
    103109#endif
    104110
     
    113119    g_pfnrtSendIpi = rtMpSendIpiDummy;
    114120#ifndef IPRT_TARGET_NT4
    115     if (g_pfnrtNtHalRequestIpi)
    116     {
    117         if (    MajorVersion == 6
    118             &&  MinorVersion == 0)
    119         {
    120             /* Vista or Windows Server 2008 */
    121             g_pfnrtSendIpi = rtMpSendIpiVista;
    122         }
    123         else
    124         if (    MajorVersion == 6
    125             &&  MinorVersion == 1)
    126         {
    127             /* Windows 7 or Windows Server 2008 R2 */
    128             g_pfnrtSendIpi = rtMpSendIpiWin7;
    129         }
    130         /* Windows XP should send always send an IPI -> VERIFY */
    131     }
     121    if (    g_pfnrtNtHalRequestIpi
     122        &&  MajorVersion == 6
     123        &&  MinorVersion == 0)
     124    {
     125        /* Vista or Windows Server 2008 */
     126        g_pfnrtSendIpi = rtMpSendIpiVista;
     127    }
     128    else
     129    if (    g_pfnrtNtHalSendSoftwareInterrupt
     130        &&  MajorVersion == 6
     131        &&  MinorVersion == 1)
     132    {
     133        /* Windows 7 or Windows Server 2008 R2 */
     134        g_pfnrtSendIpi = rtMpSendIpiWin7;
     135    }
     136    /* Windows XP should send always send an IPI -> VERIFY */
    132137#endif
    133138    KIRQL OldIrql;
  • trunk/src/VBox/Runtime/r0drv/nt/internal-r0drv-nt.h

    r23412 r23506  
    4242typedef VOID (__stdcall *PFNMYKEFLUSHQUEUEDDPCS)(VOID);
    4343typedef VOID (__stdcall *PFNHALREQUESTIPI)(KAFFINITY TargetSet);
     44typedef VOID (__stdcall *PFNHALSENDSOFTWAREINTERRUPT)(ULONG ProcessorNumber, KIRQL Irql);
    4445typedef int (__stdcall *PFNRTSENDIPI)(RTCPUID idCpu);
    4546
     
    5253extern PFNMYKEFLUSHQUEUEDDPCS       g_pfnrtNtKeFlushQueuedDpcs;
    5354extern PFNHALREQUESTIPI             g_pfnrtNtHalRequestIpi;
     55extern PFNHALSENDSOFTWAREINTERRUPT  g_pfnrtNtHalSendSoftwareInterrupt;
    5456extern PFNRTSENDIPI                 g_pfnrtSendIpi;
    5557extern uint32_t                     g_offrtNtPbQuantumEnd;
  • trunk/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp

    r23416 r23506  
    357357int rtMpSendIpiWin7(RTCPUID idCpu)
    358358{
    359     return VERR_NOT_IMPLEMENTED;
    360     /* bsod */
    361     VOID (__stdcall *pfRequestIpi)(KAFFINITY Zero, KAFFINITY TargetSet) = (VOID (__stdcall *)(KAFFINITY, KAFFINITY))g_pfnrtNtHalRequestIpi;
    362 
    363     pfRequestIpi(0, 1 << idCpu);
     359    g_pfnrtNtHalSendSoftwareInterrupt(idCpu, DISPATCH_LEVEL);
    364360    return VINF_SUCCESS;
    365361}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette