Changeset 3345 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 2, 2007 10:15:13 AM (17 years ago)
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r3319 r3345 209 209 } 210 210 211 staticvoid vmmdevCtlGuestFilterMask_EMT (VMMDevState *pVMMDevState,212 213 211 void vmmdevCtlGuestFilterMask_EMT (VMMDevState *pVMMDevState, 212 uint32_t u32OrMask, 213 uint32_t u32NotMask) 214 214 { 215 215 const bool fHadEvents = … … 1774 1774 1775 1775 #ifdef VBOX_HGCM 1776 pData->pHGCMCmdList = NULL; 1776 1777 rc = RTCritSectInit(&pData->critsectHGCMCmdList); 1777 1778 AssertRCReturn(rc, rc); 1779 pData->u32HGCMRefs = 0; 1778 1780 #endif /* VBOX_HGCM */ 1779 1781 -
trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
r3166 r3345 23 23 24 24 #include <iprt/alloc.h> 25 #include <iprt/asm.h> 25 26 #include <iprt/assert.h> 26 27 #include <iprt/param.h> … … 125 126 pCmd->enmCmdType = enmCmdType; 126 127 pCmd->GCPtr = GCPtr; 128 129 /* Automatically enable HGCM events, if there are HGCM commands. */ 130 if ( enmCmdType == VBOXHGCMCMDTYPE_CONNECT 131 || enmCmdType == VBOXHGCMCMDTYPE_DISCONNECT 132 || enmCmdType == VBOXHGCMCMDTYPE_CALL) 133 { 134 uint32_t u32 = ASMAtomicIncU32 (&pVMMDevState->u32HGCMRefs); 135 Assert(u32 != 0); 136 vmmdevCtlGuestFilterMask_EMT (pVMMDevState, VMMDEV_EVENT_HGCM, 0); 137 } 127 138 128 139 vmmdevHGCMCmdListUnlock (pVMMDevState); … … 158 169 { 159 170 pVMMDevState->pHGCMCmdList = pCmd->pNext; 171 } 172 173 /* Automatically disable HGCM events, if there are no more HGCM commands. */ 174 if ( pCmd->enmCmdType == VBOXHGCMCMDTYPE_CONNECT 175 || pCmd->enmCmdType == VBOXHGCMCMDTYPE_DISCONNECT 176 || pCmd->enmCmdType == VBOXHGCMCMDTYPE_CALL) 177 { 178 uint32_t u32 = ASMAtomicDecU32 (&pVMMDevState->u32HGCMRefs); 179 Assert(u32 != 0xFFFFFFFF); 180 if (u32 == 0) 181 { 182 vmmdevCtlGuestFilterMask_EMT (pVMMDevState, 0, VMMDEV_EVENT_HGCM); 183 } 160 184 } 161 185 -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r3110 r3345 76 76 /** Current host side event flags */ 77 77 uint32_t u32HostEventFlags; 78 /** Mask of events guest is interested in */ 78 /** Mask of events guest is interested in. Note that the HGCM events 79 * are enabled automatically by the VMMDev device when guest issues 80 * HGCM commands. 81 */ 79 82 uint32_t u32GuestFilterMask; 80 83 /** Delayed mask of guest events */ … … 145 148 /** Critical section to protect the list. */ 146 149 RTCRITSECT critsectHGCMCmdList; 150 /** How many HGCM commands are pending. */ 151 volatile uint32_t u32HGCMRefs; 147 152 #endif /* VBOX_HGCM */ 148 153 … … 150 155 151 156 void VMMDevNotifyGuest (VMMDevState *pVMMDevState, uint32_t u32EventMask); 157 void vmmdevCtlGuestFilterMask_EMT (VMMDevState *pVMMDevState, 158 uint32_t u32OrMask, 159 uint32_t u32NotMask); 152 160 153 161 #endif /* __VMMDevState_h__ */
Note:
See TracChangeset
for help on using the changeset viewer.