Changeset 9587 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jun 11, 2008 12:51:04 AM (17 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r9470 r9587 130 130 endif 131 131 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE_FOR_MM 132 #USE_NEW_OS_INTERFACE_FOR_GIP 132 133 ifdef VBOX_WITH_IDT_PATCHING 133 134 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r9530 r9587 4009 4009 * can be relied upon to have somewhat uniform TSC between the cpus. 4010 4010 */ 4011 # ifdef RT_OS_WINDOWS /** @todo fix RTMpGetCount() wrt to IRQL. */4012 if (supdrvOSGetCPUCount(pDevExt) > 1)4013 # else4014 4011 if (RTMpGetCount() > 1) 4015 # endif4016 4012 { 4017 4013 uint32_t uEAX, uEBX, uECX, uEDX; … … 4313 4309 for (iCpu = 0; iCpu < cCpus; iCpu++) 4314 4310 { 4315 while (!RTCpuSetIsMember(&OnlineCpus, iCpuSet)) 4311 while (!RTCpuSetIsMemberByIndex(&OnlineCpus, iCpuSet)) 4312 { 4316 4313 iCpuSet++; /* skip offline CPU */ 4314 dprintf2(("skipping %d\n", iCpuSet)); 4315 } 4317 4316 rc = RTMpOnSpecific(RTMpCpuIdFromSetIndex(iCpuSet), supdrvDetermineAsyncTscWorker, &s_aTsc[iSlot][iCpu], NULL); 4318 4317 if (rc == VERR_NOT_SUPPORTED) … … 4325 4324 * Check that the TSC reads are strictly ascending. 4326 4325 */ 4326 /** @todo this doesn't work if a CPU is offline for some reason. */ 4327 4327 fBackwards = false; 4328 4328 u64DiffMin = (uint64_t)~0; … … 4333 4333 u64DiffMax = 0; 4334 4334 if (u64Tsc0 <= u64TscLast) 4335 { 4336 dprintf2(("iSlot=%d u64Tsc0=%#x%#08x u64TscLast=%#x%#08x\n", iSlot, 4337 (long)(u64Tsc0 >> 32), (long)u64Tsc0, (long)(u64TscLast >> 32), (long)u64TscLast)); 4335 4338 fBackwards = true; 4339 } 4336 4340 u64TscLast = u64Tsc0; 4337 4341 for (iCpu = 1; iCpu < cCpus; iCpu++) … … 4339 4343 uint64_t u64TscN = s_aTsc[iSlot][iCpu]; 4340 4344 if (u64TscN <= u64TscLast) 4345 { 4346 dprintf2(("iSlot=%d iCpu=%d u64TscN=%#x%#08x u64TscLast=%#x%#08x\n", iSlot, iCpu, 4347 (long)(u64TscN >> 32), (long)u64TscN, (long)(u64TscLast >> 32), (long)u64TscLast)); 4341 4348 fBackwards = true; 4349 } 4342 4350 u64TscLast = u64TscN; 4343 4351 -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r9578 r9587 79 79 static NTSTATUS _stdcall VBoxDrvNtNotSupportedStub(PDEVICE_OBJECT pDevObj, PIRP pIrp); 80 80 static NTSTATUS VBoxDrvNtErr2NtStatus(int rc); 81 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 81 82 static NTSTATUS VBoxDrvNtGipInit(PSUPDRVDEVEXT pDevExt); 82 83 static void VBoxDrvNtGipTerm(PSUPDRVDEVEXT pDevExt); 83 84 static void _stdcall VBoxDrvNtGipTimer(IN PKDPC pDpc, IN PVOID pvUser, IN PVOID SystemArgument1, IN PVOID SystemArgument2); 84 85 static void _stdcall VBoxDrvNtGipPerCpuDpc(IN PKDPC pDpc, IN PVOID pvUser, IN PVOID SystemArgument1, IN PVOID SystemArgument2); 86 #endif 85 87 86 88 … … 129 131 PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pDevObj->DeviceExtension; 130 132 memset(pDevExt, 0, sizeof(*pDevExt)); 131 133 132 134 vrc = supdrvInitDevExt(pDevExt); 133 135 if (!vrc) 134 136 { 137 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 135 138 /* Make sure the tsc is consistent across cpus/cores. */ 136 139 uint64_t u64DiffCores; 137 140 pDevExt->fForceAsyncTsc = supdrvDetermineAsyncTsc(&u64DiffCores); 138 141 dprintf(("supdrvDetermineAsyncTsc: fAsync=%d u64DiffCores=%u.\n", pDevExt->fForceAsyncTsc, (uint32_t)u64DiffCores)); 139 142 140 143 /* 141 144 * Inititalize the GIP. … … 143 146 rc = VBoxDrvNtGipInit(pDevExt); 144 147 if (NT_SUCCESS(rc)) 148 #endif 145 149 { 146 150 /* … … 157 161 return STATUS_SUCCESS; 158 162 } 163 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 159 164 dprintf(("VBoxDrvNtGipInit failed with rc=%#x!\n", rc)); 160 165 161 166 supdrvDeleteDevExt(pDevExt); 167 #endif 162 168 } 163 169 else … … 166 172 rc = VBoxDrvNtErr2NtStatus(vrc); 167 173 } 168 174 169 175 IoDeleteSymbolicLink(&DosName); 170 176 RTR0Term(); 171 177 } 172 178 else 173 { 179 { 174 180 dprintf(("RTR0Init failed with vrc=%d!\n", vrc)); 175 181 rc = VBoxDrvNtErr2NtStatus(vrc); … … 213 219 * Terminate the GIP page and delete the device extension. 214 220 */ 221 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 215 222 VBoxDrvNtGipTerm(pDevExt); 223 #endif 216 224 supdrvDeleteDevExt(pDevExt); 217 225 RTR0Term(); … … 315 323 int rc; 316 324 317 /* Raise the IRQL to DISPATCH_LEVEl to prevent Windows from rescheduling us to another CPU/core. */ 325 /* Raise the IRQL to DISPATCH_LEVEl to prevent Windows from rescheduling us to another CPU/core. */ 318 326 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 319 KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); 327 KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); 320 328 rc = supdrvIOCtlFast(ulCmd, pDevExt, pSession); 321 329 KeLowerIrql(oldIrql); … … 478 486 } 479 487 488 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 489 480 490 /** 481 491 * Gets the monotone timestamp (nano seconds). … … 761 771 KeCancelTimer(&pDevExt->GipTimer); 762 772 #ifdef RT_ARCH_AMD64 763 ExSetTimerResolution(0, FALSE); 773 ExSetTimerResolution(0, FALSE); /* why did we (I?) do this? */ 764 774 #endif 765 775 } … … 784 794 return cCpus; 785 795 } 796 #endif /* ! USE_NEW_OS_INTERFACE_FOR_GIP */ 786 797 787 798 … … 791 802 bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt) 792 803 { 804 #ifdef USE_NEW_OS_INTERFACE_FOR_GIP 805 return false; 806 #else 793 807 return pDevExt->fForceAsyncTsc != 0; 808 #endif 794 809 } 795 810
Note:
See TracChangeset
for help on using the changeset viewer.