VirtualBox

Changeset 74795 in vbox


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

Location:
trunk
Files:
5 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
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r74791 r74795  
    118118         * normal FF processing the caller or the next call can deal with them.
    119119         */
    120         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     120        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    121121        if (   VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK)
    122122            || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK))
     
    464464         * Deal with high priority post execution FFs before doing anything else.
    465465         */
    466         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     466        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    467467        if (    VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK)
    468468            ||  VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK))
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r74791 r74795  
    118118         * normal FF processing the caller or the next call can deal with them.
    119119         */
    120         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     120        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    121121        if (   VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK)
    122122            || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK))
     
    447447         * Deal with high priority post execution FFs before doing anything else.
    448448         */
    449         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     449        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    450450        if (   VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK)
    451451            || VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK))
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r74791 r74795  
    137137    Log(("emR3RawResumeHyper: cs:eip=%RTsel:%RGr efl=%RGr - returned from GC with rc=%Rrc\n", pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.eip, pVCpu->cpum.GstCtx.eflags, rc));
    138138    rc = CPUMRawLeave(pVCpu, rc);
    139     VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     139    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    140140
    141141    /*
     
    207207             || rc == VINF_EM_RAW_INTERRUPT);
    208208    rc = CPUMRawLeave(pVCpu, rc);
    209     VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     209    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    210210
    211211    /*
     
    14161416         */
    14171417        rc = CPUMRawLeave(pVCpu, rc);
    1418         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     1418        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    14191419        if (    VM_FF_IS_ANY_SET(pVM, VM_FF_HIGH_PRIORITY_POST_MASK)
    14201420            ||  VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_HIGH_PRIORITY_POST_MASK))
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r74791 r74795  
    17091709                                                           & ~VMCPU_FF_RESUME_GUEST_MASK))
    17101710                        {
    1711                             VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
     1711                            VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_RESUME_GUEST_MASK);
    17121712                            continue;
    17131713                        }
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