Changeset 108867 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Apr 7, 2025 10:32:44 AM (5 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168317
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GITSAll.cpp
r108865 r108867 51 51 #define GITS_IS_REG_IN_RANGE(a_offReg, a_offFirst, a_cbRegion) ((uint32_t)(a_offReg) - (a_offFirst) < (a_cbRegion)) 52 52 53 /** Acquire the device critical section. */ 54 #define GITS_CRIT_SECT_ENTER(a_pDevIns) \ 55 do \ 56 { \ 57 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS); \ 58 PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->pCritSectRoR3, rcLock); \ 59 } while(0) 60 61 /** Release the device critical section. */ 62 #define GITS_CRIT_SECT_LEAVE(a_pDevIns) PDMDevHlpCritSectLeave((a_pDevIns), (a_pDevIns)->CTX_SUFF(pCritSectRo)) 63 64 /** Returns whether the critical section is held. */ 65 #define GITS_CRIT_SECT_IS_OWNER(a_pDevIns) PDMDevHlpCritSectIsOwner((a_pDevIns), (a_pDevIns)->CTX_SUFF(pCritSectRo)) 66 53 67 54 68 /********************************************************************************************************************************* … … 162 176 static void gitsCmdQueueThreadWakeUpIfNeeded(PPDMDEVINS pDevIns, PGITSDEV pGitsDev) 163 177 { 164 Assert( PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));178 Assert(GITS_CRIT_SECT_IS_OWNER(pDevIns)); 165 179 if ( gitsCmdQueueCanProcessRequests(pGitsDev) 166 180 && !gitsCmdQueueIsEmpty(pGitsDev)) … … 454 468 { 455 469 /* Hold the critical section as we could be accessing the device state simultaneously with MMIO accesses. */ 456 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS); 457 PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->pCritSectRoR3, rcLock); 470 GITS_CRIT_SECT_ENTER(pDevIns); 458 471 459 472 if (gitsCmdQueueCanProcessRequests(pGitsDev)) … … 474 487 475 488 /* Temporarily leave the critical section while reading (a potentially large number of) commands from guest memory. */ 476 PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3);489 GITS_CRIT_SECT_LEAVE(pDevIns); 477 490 478 491 int rc; … … 500 513 501 514 /* Re-acquire the critical section as we now need to modify device state. */ 502 int const rcLock2 = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS); 503 PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->pCritSectRoR3, rcLock2); 515 GITS_CRIT_SECT_ENTER(pDevIns); 504 516 505 517 /* … … 515 527 } 516 528 517 PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3);529 GITS_CRIT_SECT_LEAVE(pDevIns); 518 530 return VINF_SUCCESS; 519 531 } … … 525 537 } 526 538 527 PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3);539 GITS_CRIT_SECT_LEAVE(pDevIns); 528 540 return VINF_SUCCESS; 529 541 }
Note:
See TracChangeset
for help on using the changeset viewer.