VirtualBox

Changeset 15839 in vbox


Ignore:
Timestamp:
Jan 7, 2009 4:07:54 PM (16 years ago)
Author:
vboxsync
Message:

Experimental implementation of RTMpIsCpuWorkPending for windows hosts.

File:
1 edited

Legend:

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

    r15837 r15839  
    116116RTDECL(bool) RTMpIsCpuWorkPending()
    117117{
    118     /** @todo (not used on non-Windows platforms yet */
     118    RTCPUID idCpuEntry = RTMpCpuId();
     119
     120    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
     121
     122    /** @todo the best solution is to check for pending DPCs, but there doesn't seem to be any documented way to do this.
     123     *   The KPRCB or KPCR contains an undocumented entry, but it's too risky to make any assumptions about it.
     124
     125    /* Flush all pending DPCs. Not sure if we can get rescheduling as a direct result. */
     126    KeFlushQueuedDpcs();
     127
     128    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
     129
     130    if (idCpuEntry != RTMpCpuId())
     131        return true;
     132
     133    /* We've stayed on the same CPU, so we can continue. */
    119134    return false;
    120135}
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