VirtualBox

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


Ignore:
Timestamp:
Jun 5, 2008 3:22:37 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
31680
Message:

RTMpDoesCpuExist -> RTMpIsCpuPossible. Changed the RTMpGetCount and RTMpGetSet specification to include all possible cpus.

File:
1 edited

Legend:

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

    r8840 r9429  
    9595        return false;
    9696
     97    /** @todo this must be done at init time as it's not safe under all circumstances (braindead OS design). */
    9798    KAFFINITY Mask = KeQueryActiveProcessors();
    9899    return !!(Mask & RT_BIT_64(idCpu));
     
    100101
    101102
    102 RTDECL(bool) RTMpDoesCpuExist(RTCPUID idCpu)
     103RTDECL(bool) RTMpIsCpuPresent(RTCPUID idCpu)
    103104{
    104105    /* Cannot easily distinguish between online and offline cpus. */
     106    /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */
    105107    return RTMpIsCpuOnline(idCpu);
    106108}
     
    109111RTDECL(PRTCPUSET) RTMpGetSet(PRTCPUSET pSet)
    110112{
     113    /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */
    111114    return RTMpGetOnlineSet(pSet);
    112115}
     
    115118RTDECL(RTCPUID) RTMpGetCount(void)
    116119{
     120    /** @todo online/present cpu stuff must be corrected for proper W2K8 support. */
    117121    return RTMpGetOnlineCount();
    118122}
     
    167171#if 0
    168172    /* KeFlushQueuedDpcs must be run at IRQL PASSIVE_LEVEL according to MSDN, but the
    169      * driver verifier doesn't complain... 
     173     * driver verifier doesn't complain...
    170174     */
    171175    AssertMsg(KeGetCurrentIrql() == PASSIVE_LEVEL, ("%d != %d (PASSIVE_LEVEL)\n", KeGetCurrentIrql(), PASSIVE_LEVEL));
     
    173177
    174178    KAFFINITY Mask = KeQueryActiveProcessors();
    175 
    176     if (    enmCpuid == RT_NT_CPUID_SPECIFIC
    177         &&  (   idCpu >= 64
    178              || !(Mask & RT_BIT_64(idCpu))))
    179         return VERR_CPU_NOT_FOUND;  /* can't distinguish between cpu not present or offline */
    180179
    181180    /* KeFlushQueuedDpcs is not present in Windows 2000; import it dynamically so we can just fail this call. */
     
    244243        }
    245244        if (enmCpuid != RT_NT_CPUID_OTHERS)
    246         {
    247245            pfnWorker(iSelf, pvUser1, pvUser2);
    248         }
    249246    }
    250247
     
    270267RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
    271268{
     269    if (RTMpIsCpuOnline(idCpu);
     270        return !RTMpIsCpuPossible(idCpu) ? VERR_CPU_NOT_FOUND : VERR_CPU_OFFLINE;
     271
    272272    return rtMpCall(pfnWorker, pvUser1, pvUser2, RT_NT_CPUID_SPECIFIC, idCpu);
    273273}
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