~ubuntu-branches/ubuntu/trusty/virtualbox-ose/trusty

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
PFNMYEXSETTIMERRESOLUTION   g_pfnrtNtExSetTimerResolution;
57
57
/** KeFlushQueuedDpcs, introduced in XP. */
58
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;
59
67
 
60
68
/** Offset of the _KPRCB::QuantumEnd field. 0 if not found. */
61
69
uint32_t                    g_offrtNtPbQuantumEnd;
82
90
#ifdef IPRT_TARGET_NT4
83
91
    g_pfnrtNtExSetTimerResolution = NULL;
84
92
    g_pfnrtNtKeFlushQueuedDpcs = NULL;
 
93
    g_pfnrtNtHalRequestIpi = NULL;
 
94
    g_pfnrtNtHalSendSoftwareInterrupt = NULL;
 
95
    g_pfnrtKeIpiGenericCall = NULL;
85
96
#else
86
97
    /*
87
98
     * Initialize the function pointers.
92
103
 
93
104
    RtlInitUnicodeString(&RoutineName, L"KeFlushQueuedDpcs");
94
105
    g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName);
 
106
 
 
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);
95
115
#endif
96
116
 
97
117
    /*
102
122
    ULONG BuildNumber  = 0;
103
123
    BOOLEAN fChecked = PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
104
124
 
 
125
    g_pfnrtSendIpi = rtMpSendIpiDummy;
 
126
#ifndef IPRT_TARGET_NT4
 
127
    if (    g_pfnrtNtHalRequestIpi
 
128
        &&  MajorVersion == 6
 
129
        &&  MinorVersion == 0)
 
130
    {
 
131
        /* Vista or Windows Server 2008 */
 
132
        g_pfnrtSendIpi = rtMpSendIpiVista;
 
133
    }
 
134
    else
 
135
    if (    g_pfnrtNtHalSendSoftwareInterrupt
 
136
        &&  MajorVersion == 6
 
137
        &&  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
#endif
105
144
    KIRQL OldIrql;
106
145
    KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); /* make sure we stay on the same cpu */
107
146