VirtualBox

Changeset 74795 in vbox for trunk/include


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

vm.h,EM: Made the FF_SET and FF_CLEAR macros only take constants with _BIT variants. bugref:9180

File:
1 edited

Legend:

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

    r74794 r74795  
    654654 * @param   fFlag   The flag to set.
    655655 */
    656 #define VM_FF_SET(pVM, fFlag) \
    657     do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag)); } while (0)
     656#define VM_FF_SET(pVM, fFlag) do { \
     657        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     658        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
     659        ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag)); \
     660    } while (0)
    658661
    659662/** @def VMCPU_FF_SET
     
    664667 * @sa      VMCPU_FF_SET_MASK
    665668 */
    666 #define VMCPU_FF_SET(pVCpu, fFlag) \
    667     do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag)); } while (0)
     669#define VMCPU_FF_SET(pVCpu, fFlag) do { \
     670        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     671        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
     672        ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag)); \
     673    } while (0)
    668674
    669675/** @def VMCPU_FF_SET_MASK
     
    683689 * @param   fFlag   The flag to clear.
    684690 */
    685 #define VM_FF_CLEAR(pVM, fFlag) \
    686     do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag)); } while (0)
     691#define VM_FF_CLEAR(pVM, fFlag) do { \
     692        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     693        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
     694        ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag)); \
     695    } while (0)
    687696
    688697/** @def VMCPU_FF_CLEAR
     
    692701 * @param   fFlag   The flag to clear.
    693702 */
    694 #define VMCPU_FF_CLEAR(pVCpu, fFlag) \
    695     do { AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag)); } while (0)
     703#define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \
     704        AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \
     705        AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \
     706        ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag)); \
     707    } while (0)
    696708
    697709/** @def VMCPU_FF_CLEAR_MASK
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