VirtualBox

Changeset 1049 in vbox for trunk


Ignore:
Timestamp:
Feb 23, 2007 4:54:37 PM (18 years ago)
Author:
vboxsync
Message:

supdrvOSGetCPUCount on win32 and darwin.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r1047 r1049  
    40654065static SUPGIPMODE supdrvGipDeterminTscMode(void)
    40664066{
     4067#ifndef USE_NEW_OS_INTERFACE
    40674068    if (supdrvOSGetCPUCount() > 1)
    40684069    {
     
    40844085        }
    40854086    }
     4087#endif
    40864088    return SUPGIPMODE_SYNC_TSC;
    40874089}
  • trunk/src/VBox/HostDrivers/Support/win32/SUPDrv-win32.cpp

    r1027 r1049  
    10761076
    10771077
     1078/**
     1079 * Get the current CPU count.
     1080 * @returns Number of cpus.
     1081 */
     1082unsigned VBOXCALL supdrvOSGetCPUCount(void)
     1083{
     1084    KAFFINITY Mask = KeQueryActiveProcessors();
     1085    unsigned cCpus = 0;
     1086    unsigned iBit;
     1087    for (iBit = 0; iBit < sizeof(Mask) * 8; iBit++)
     1088        if (Mask & (1 << iBit))
     1089            cCpus++;
     1090    if (cCpus == 0) /* paranoia */
     1091        cCpus = 1;
     1092    return cCpus;
     1093}
     1094
    10781095
    10791096/**
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