VirtualBox

Changeset 74790 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Oct 12, 2018 10:42:58 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125734
Message:

vm.h,VMM: Use VM_FF_IS_SET instead of VM_FF_IS_PENDING when checking a single flag. Added compile time assertion on single flag. bugref:9180

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vm.h

    r74789 r74790  
    692692
    693693/** @def VM_FF_IS_SET
    694  * Checks if a force action flag is set.
     694 * Checks if single a force action flag is set.
    695695 *
    696696 * @param   pVM     The cross context VM structure.
    697697 * @param   fFlag   The flag to check.
    698  */
    699 #define VM_FF_IS_SET(pVM, fFlag)            (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag))
    700 
     698 * @sa      VM_FF_IS_ANY_SET
     699 */
     700#if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
     701# define VM_FF_IS_SET(pVM, fFlag)           (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag))
     702#else
     703# define VM_FF_IS_SET(pVM, fFlag) \
     704    ([](PVM a_pVM) -> bool \
     705    { \
     706        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     707        return (a_pVM->fGlobalForcedActions & (fFlag)) == (fFlag); \
     708    }(pVM))
     709#endif
    701710
    702711/** @def VMCPU_FF_IS_SET
    703  * Checks if a force action flag is set for the given VCPU.
     712 * Checks if a single force action flag is set for the given VCPU.
    704713 *
    705714 * @param   pVCpu   The cross context virtual CPU structure.
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