VirtualBox

Changeset 74787 in vbox for trunk


Ignore:
Timestamp:
Oct 12, 2018 10:24:40 AM (6 years ago)
Author:
vboxsync
Message:

vm.h,VMM: Made VM_FF_CLEAR work on a single flag too. bugref:9180

File:
1 edited

Legend:

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

    r74786 r74787  
    643643
    644644/** @def VM_FF_CLEAR
    645  * Clears a force action flag.
     645 * Clears a single force action flag.
    646646 *
    647647 * @param   pVM     The cross context VM structure.
     
    649649 */
    650650#if 1
    651 # define VM_FF_CLEAR(pVM, fFlag)            ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag))
     651# if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
     652#  define VM_FF_CLEAR(pVM, fFlag)            ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag))
     653# else
     654#  define VM_FF_CLEAR(pVM, fFlag) \
     655    ([](PVM a_pVM) -> void \
     656    { \
     657        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     658        ASMAtomicAndU32(&a_pVM->fGlobalForcedActions, ~(fFlag)); \
     659    }(pVM))
     660# endif
    652661#else
    653662# define VM_FF_CLEAR(pVM, fFlag) \
     
    667676#else
    668677# define VMCPU_FF_CLEAR(pVCpu, fFlag) \
    669                    ([](PVMCPU a_pVCpu) -> void \
    670                    { \
    671                        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    672                        ASMAtomicAndU32(&a_pVCpu->fLocalForcedActions, ~(fFlag)); \
    673                    }(pVCpu))
     678    ([](PVMCPU a_pVCpu) -> void \
     679    { \
     680        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     681        ASMAtomicAndU32(&a_pVCpu->fLocalForcedActions, ~(fFlag)); \
     682    }(pVCpu))
    674683#endif
    675684
     
    701710#else
    702711# define VMCPU_FF_IS_SET(pVCpu, fFlag) \
    703                    ([](PVMCPU a_pVCpu) -> bool \
    704                    { \
    705                        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
    706                        return (a_pVCpu->fLocalForcedActions & (fFlag)) == (fFlag); \
    707                    }(pVCpu))
     712    ([](PVMCPU a_pVCpu) -> bool \
     713    { \
     714        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     715        return (a_pVCpu->fLocalForcedActions & (fFlag)) == (fFlag); \
     716    }(pVCpu))
    708717#endif
    709718
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