VirtualBox

Changeset 74786 in vbox


Ignore:
Timestamp:
Oct 12, 2018 10:20:59 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125730
Message:

vm.h,VMM: Made VMCPU_FF_CLEAR work on a single flag, introducing VMCPU_FF_CLEAR_MASK for the two cases we clear more than one. bugref:9180

Location:
trunk
Files:
3 edited

Legend:

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

    r74785 r74786  
    658658
    659659/** @def VMCPU_FF_CLEAR
    660  * Clears a force action flag for the given VCPU.
     660 * Clears a single force action flag for the given VCPU.
    661661 *
    662662 * @param   pVCpu   The cross context virtual CPU structure.
    663663 * @param   fFlag   The flag to clear.
    664664 */
    665 #define VMCPU_FF_CLEAR(pVCpu, fFlag)        ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag))
     665#if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA)
     666# define VMCPU_FF_CLEAR(pVCpu, fFlag)       ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag))
     667#else
     668# 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))
     674#endif
     675
     676/** @def VMCPU_FF_CLEAR_MASK
     677 * Clears two or more force action flags for the given VCPU.
     678 *
     679 * @param   pVCpu   The cross context virtual CPU structure.
     680 * @param   fFlags  The flags to clear.
     681 */
     682#define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags)  ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlags))
    666683
    667684/** @def VM_FF_IS_SET
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r72917 r74786  
    310310    {
    311311        Log(("NEM: TODO: Make VMCPU_FF_PGM_SYNC_CR3 / VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL quiet! (%#x)\n", pVCpu->fLocalForcedActions));
    312         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL);
     312        VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL);
    313313    }
    314314
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r73351 r74786  
    28732873
    28742874    /* Clear all pending forced actions. */
    2875     VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_ALL_MASK & ~VMCPU_FF_REQUEST);
     2875    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_ALL_MASK & ~VMCPU_FF_REQUEST);
    28762876
    28772877    /*
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