VirtualBox

Changeset 54718 in vbox for trunk/include


Ignore:
Timestamp:
Mar 11, 2015 4:14:41 PM (10 years ago)
Author:
vboxsync
Message:

VMM: VMMR0ThreadCtxHooksDeregister returns void, further simplified HM_[DISABLE|RESTORE]_PREEMPT_IF_NEEDED() a bit.

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

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

    r54712 r54718  
    182182# define HM_DISABLE_PREEMPT_IF_NEEDED() \
    183183    RTTHREADPREEMPTSTATE PreemptStateInternal = RTTHREADPREEMPTSTATE_INITIALIZER; \
    184     bool fPreemptDisabledInternal = false; \
    185     if (RTThreadPreemptIsEnabled(NIL_RTTHREAD)) \
    186     { \
    187         Assert(VMMR0ThreadCtxHooksAreRegistered(pVCpu)); \
    188         RTThreadPreemptDisable(&PreemptStateInternal); \
    189         fPreemptDisabledInternal = true; \
    190     } else do { } while (0)
    191 
    192 # define HM_RESTORE_PREEMPT_IF_NEEDED() \
    193     do \
    194     { \
    195         if (fPreemptDisabledInternal) \
    196             RTThreadPreemptRestore(&PreemptStateInternal); \
    197     } while (0)
     184    Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD) || VMMR0ThreadCtxHooksAreRegistered(pVCpu)); \
     185    RTThreadPreemptDisable(&PreemptStateInternal);
    198186#else
    199187# define HM_DISABLE_PREEMPT_IF_NEEDED() \
    200188    RTTHREADPREEMPTSTATE PreemptStateInternal = RTTHREADPREEMPTSTATE_INITIALIZER; \
    201189    RTThreadPreemptDisable(&PreemptStateInternal);
    202 
     190#endif /* VBOX_STRICT */
    203191# define HM_RESTORE_PREEMPT_IF_NEEDED() do { RTThreadPreemptRestore(&PreemptStateInternal); } while(0)
    204 #endif /* VBOX_STRICT */
     192
    205193
    206194VMMR0_INT_DECL(int)             HMR0SetupVM(PVM pVM);
  • trunk/include/VBox/vmm/vmm.h

    r53615 r54718  
    513513VMMR0DECL(bool)      VMMR0ThreadCtxHooksAreCreated(PVMCPU pVCpu);
    514514VMMR0DECL(int)       VMMR0ThreadCtxHooksRegister(PVMCPU pVCpu, PFNRTTHREADCTXHOOK pfnHook);
    515 VMMR0DECL(int)       VMMR0ThreadCtxHooksDeregister(PVMCPU pVCpu);
     515VMMR0DECL(void)      VMMR0ThreadCtxHooksDeregister(PVMCPU pVCpu);
    516516VMMR0DECL(bool)      VMMR0ThreadCtxHooksAreRegistered(PVMCPU pVCpu);
    517517
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