Changeset 44785 in vbox
- Timestamp:
- Feb 21, 2013 3:24:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r44782 r44785 2187 2187 2188 2188 2189 static int vmmdevReqDispatcher(PVMMDEV pThis, VMMDevRequestHeader *pReqHdr, RTGCPHYS GCPhysReqHdr) 2189 /** 2190 * Dispatch the request to the appropriate handler function. 2191 * 2192 * @returns Port I/O handler exit code. 2193 * @param pThis The VMM device instance data. 2194 * @param pReqHdr The request header (cached in host memory). 2195 * @param GCPhysReqHdr The guest physical address of the request (for 2196 * HGCM). 2197 * @param pfDelayedUnlock Where to indicate whether the critical section exit 2198 * needs to be delayed till after the request has been 2199 * written back. This is a HGCM kludge, see critsect 2200 * work in hgcmCompletedWorker for more details. 2201 */ 2202 static int vmmdevReqDispatcher(PVMMDEV pThis, VMMDevRequestHeader *pReqHdr, RTGCPHYS GCPhysReqHdr, bool *pfDelayedUnlock) 2190 2203 { 2191 2204 int rcRet = VINF_SUCCESS; 2205 *pfDelayedUnlock = false; 2192 2206 2193 2207 switch (pReqHdr->requestType) … … 2292 2306 case VMMDevReq_HGCMConnect: 2293 2307 pReqHdr->rc = vmmdevReqHandler_HGCMConnect(pThis, pReqHdr, GCPhysReqHdr); 2308 *pfDelayedUnlock = true; 2294 2309 break; 2295 2310 2296 2311 case VMMDevReq_HGCMDisconnect: 2297 2312 pReqHdr->rc = vmmdevReqHandler_HGCMDisconnect(pThis, pReqHdr, GCPhysReqHdr); 2313 *pfDelayedUnlock = true; 2298 2314 break; 2299 2315 … … 2305 2321 # endif /* VBOX_WITH_64_BITS_GUESTS */ 2306 2322 pReqHdr->rc = vmmdevReqHandler_HGCMCall(pThis, pReqHdr, GCPhysReqHdr); 2323 *pfDelayedUnlock = true; 2307 2324 break; 2308 2325 #endif /* VBOX_WITH_HGCM */ … … 2310 2327 case VMMDevReq_HGCMCancel: 2311 2328 pReqHdr->rc = vmmdevReqHandler_HGCMCancel(pThis, pReqHdr, GCPhysReqHdr); 2329 *pfDelayedUnlock = true; 2312 2330 break; 2313 2331 … … 2460 2478 Log2(("VMMDev request issued: %d\n", requestHeader.requestType)); 2461 2479 2480 bool fDelayedUnlock = false; 2462 2481 int rcRet = VINF_SUCCESS; 2463 2482 VMMDevRequestHeader *pRequestHeader = NULL; … … 2483 2502 PDMDevHlpPhysRead(pDevIns, (RTGCPHYS)u32, pRequestHeader, requestHeader.size); 2484 2503 2485 rcRet = vmmdevReqDispatcher(pThis, pRequestHeader, u32 );2504 rcRet = vmmdevReqDispatcher(pThis, pRequestHeader, u32, &fDelayedUnlock); 2486 2505 } 2487 2506 else … … 2503 2522 } 2504 2523 2505 PDMCritSectLeave(&pThis->CritSect); 2524 if (!fDelayedUnlock) 2525 PDMCritSectLeave(&pThis->CritSect); 2506 2526 } 2507 2527 else … … 2522 2542 { 2523 2543 PDMDevHlpPhysWrite(pDevIns, u32, pRequestHeader, pRequestHeader->size); 2544 if (fDelayedUnlock) 2545 PDMCritSectLeave(&pThis->CritSect); 2524 2546 RTMemFree(pRequestHeader); 2525 2547 } … … 2528 2550 /* early error case; write back header only */ 2529 2551 PDMDevHlpPhysWrite(pDevIns, u32, &requestHeader, sizeof(requestHeader)); 2552 Assert(!fDelayedUnlock); 2530 2553 } 2531 2554
Note:
See TracChangeset
for help on using the changeset viewer.