VirtualBox

Ignore:
Timestamp:
Jun 11, 2008 12:51:04 AM (17 years ago)
Author:
vboxsync
Message:

USE_NEW_OS_INTERFACE_FOR_GIP for NT (disabled).

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r9470 r9587  
    130130endif
    131131VBoxDrv_DEFS          = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE_FOR_MM
     132#USE_NEW_OS_INTERFACE_FOR_GIP
    132133ifdef VBOX_WITH_IDT_PATCHING
    133134VBoxDrv_DEFS         += VBOX_WITH_IDT_PATCHING
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r9530 r9587  
    40094009     * can be relied upon to have somewhat uniform TSC between the cpus.
    40104010     */
    4011 # ifdef RT_OS_WINDOWS /** @todo fix RTMpGetCount() wrt to IRQL. */
    4012     if (supdrvOSGetCPUCount(pDevExt) > 1)
    4013 # else
    40144011    if (RTMpGetCount() > 1)
    4015 # endif
    40164012    {
    40174013        uint32_t uEAX, uEBX, uECX, uEDX;
     
    43134309        for (iCpu = 0; iCpu < cCpus; iCpu++)
    43144310        {
    4315             while (!RTCpuSetIsMember(&OnlineCpus, iCpuSet))
     4311            while (!RTCpuSetIsMemberByIndex(&OnlineCpus, iCpuSet))
     4312            {
    43164313                iCpuSet++; /* skip offline CPU */
     4314                dprintf2(("skipping %d\n", iCpuSet));
     4315            }
    43174316            rc = RTMpOnSpecific(RTMpCpuIdFromSetIndex(iCpuSet), supdrvDetermineAsyncTscWorker, &s_aTsc[iSlot][iCpu], NULL);
    43184317            if (rc == VERR_NOT_SUPPORTED)
     
    43254324     * Check that the TSC reads are strictly ascending.
    43264325     */
     4326    /** @todo this doesn't work if a CPU is offline for some reason. */
    43274327    fBackwards = false;
    43284328    u64DiffMin = (uint64_t)~0;
     
    43334333        u64DiffMax = 0;
    43344334        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));
    43354338            fBackwards = true;
     4339        }
    43364340        u64TscLast = u64Tsc0;
    43374341        for (iCpu = 1; iCpu < cCpus; iCpu++)
     
    43394343            uint64_t u64TscN = s_aTsc[iSlot][iCpu];
    43404344            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));
    43414348                fBackwards = true;
     4349            }
    43424350            u64TscLast = u64TscN;
    43434351
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r9578 r9587  
    7979static NTSTATUS _stdcall   VBoxDrvNtNotSupportedStub(PDEVICE_OBJECT pDevObj, PIRP pIrp);
    8080static NTSTATUS            VBoxDrvNtErr2NtStatus(int rc);
     81#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
    8182static NTSTATUS            VBoxDrvNtGipInit(PSUPDRVDEVEXT pDevExt);
    8283static void                VBoxDrvNtGipTerm(PSUPDRVDEVEXT pDevExt);
    8384static void     _stdcall   VBoxDrvNtGipTimer(IN PKDPC pDpc, IN PVOID pvUser, IN PVOID SystemArgument1, IN PVOID SystemArgument2);
    8485static void     _stdcall   VBoxDrvNtGipPerCpuDpc(IN PKDPC pDpc, IN PVOID pvUser, IN PVOID SystemArgument1, IN PVOID SystemArgument2);
     86#endif
    8587
    8688
     
    129131                PSUPDRVDEVEXT pDevExt = (PSUPDRVDEVEXT)pDevObj->DeviceExtension;
    130132                memset(pDevExt, 0, sizeof(*pDevExt));
    131    
     133
    132134                vrc = supdrvInitDevExt(pDevExt);
    133135                if (!vrc)
    134136                {
     137#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
    135138                    /* Make sure the tsc is consistent across cpus/cores. */
    136139                    uint64_t    u64DiffCores;
    137140                    pDevExt->fForceAsyncTsc = supdrvDetermineAsyncTsc(&u64DiffCores);
    138141                    dprintf(("supdrvDetermineAsyncTsc: fAsync=%d u64DiffCores=%u.\n", pDevExt->fForceAsyncTsc, (uint32_t)u64DiffCores));
    139    
     142
    140143                    /*
    141144                     * Inititalize the GIP.
     
    143146                    rc = VBoxDrvNtGipInit(pDevExt);
    144147                    if (NT_SUCCESS(rc))
     148#endif
    145149                    {
    146150                        /*
     
    157161                        return STATUS_SUCCESS;
    158162                    }
     163#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
    159164                    dprintf(("VBoxDrvNtGipInit failed with rc=%#x!\n", rc));
    160    
     165
    161166                    supdrvDeleteDevExt(pDevExt);
     167#endif
    162168                }
    163169                else
     
    166172                    rc = VBoxDrvNtErr2NtStatus(vrc);
    167173                }
    168    
     174
    169175                IoDeleteSymbolicLink(&DosName);
    170176                RTR0Term();
    171177            }
    172178            else
    173             {   
     179            {
    174180                dprintf(("RTR0Init failed with vrc=%d!\n", vrc));
    175181                rc = VBoxDrvNtErr2NtStatus(vrc);
     
    213219     * Terminate the GIP page and delete the device extension.
    214220     */
     221#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
    215222    VBoxDrvNtGipTerm(pDevExt);
     223#endif
    216224    supdrvDeleteDevExt(pDevExt);
    217225    RTR0Term();
     
    315323        int   rc;
    316324
    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. */
    318326        Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL);
    319         KeRaiseIrql(DISPATCH_LEVEL, &oldIrql);       
     327        KeRaiseIrql(DISPATCH_LEVEL, &oldIrql);
    320328        rc = supdrvIOCtlFast(ulCmd, pDevExt, pSession);
    321329        KeLowerIrql(oldIrql);
     
    478486}
    479487
     488#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
     489
    480490/**
    481491 * Gets the monotone timestamp (nano seconds).
     
    761771    KeCancelTimer(&pDevExt->GipTimer);
    762772#ifdef RT_ARCH_AMD64
    763     ExSetTimerResolution(0, FALSE);
     773    ExSetTimerResolution(0, FALSE); /* why did we (I?) do this? */
    764774#endif
    765775}
     
    784794    return cCpus;
    785795}
     796#endif /* ! USE_NEW_OS_INTERFACE_FOR_GIP */
    786797
    787798
     
    791802bool VBOXCALL  supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt)
    792803{
     804#ifdef USE_NEW_OS_INTERFACE_FOR_GIP
     805    return false;
     806#else
    793807    return pDevExt->fForceAsyncTsc != 0;
     808#endif
    794809}
    795810
Note: See TracChangeset for help on using the changeset viewer.

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