Lines Matching defs:pVM

43 static int pdmR3CritSectDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTINT pCritSect, PPDMCRITSECTINT pPrev, bool fFinal);
44 static int pdmR3CritSectRwDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTRWINT pCritSect, PPDMCRITSECTRWINT pPrev, bool fFinal);
52 * @param pVM Pointer to the VM.
54 int pdmR3CritSectBothInitStats(PVM pVM)
56 STAM_REG(pVM, &pVM->pdm.s.StatQueuedCritSectLeaves, STAMTYPE_COUNTER, "/PDM/QueuedCritSectLeaves", STAMUNIT_OCCURENCES,
65 * @param pVM Pointer to the VM.
67 void pdmR3CritSectBothRelocate(PVM pVM)
69 PUVM pUVM = pVM->pUVM;
75 pCur->pVMRC = pVM->pVMRC;
80 pCur->pVMRC = pVM->pVMRC;
100 VMMR3_INT_DECL(int) PDMR3CritSectBothTerm(PVM pVM)
102 PUVM pUVM = pVM->pUVM;
108 int rc2 = pdmR3CritSectDeleteOne(pVM, pUVM, pUVM->pdm.s.pCritSects, NULL, true /* final */);
116 int rc2 = pdmR3CritSectRwDeleteOne(pVM, pUVM, pUVM->pdm.s.pRwCritSects, NULL, true /* final */);
131 * @param pVM Pointer to the VM.
140 static int pdmR3CritSectInitOne(PVM pVM, PPDMCRITSECTINT pCritSect, void *pvKey, RT_SRC_POS_DECL,
143 VM_ASSERT_EMT(pVM);
150 int rc = SUPSemEventCreate(pVM->pSession, (PSUPSEMEVENT)&pCritSect->Core.EventSem);
179 pCritSect->pVMR3 = pVM;
180 pCritSect->pVMR0 = pVM->pVMR0;
181 pCritSect->pVMRC = pVM->pVMRC;
188 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZLock, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSects/%s/ContentionRZLock", pCritSect->pszName);
189 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZUnlock,STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSects/%s/ContentionRZUnlock", pCritSect->pszName);
190 STAMR3RegisterF(pVM, &pCritSect->StatContentionR3, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSects/%s/ContentionR3", pCritSect->pszName);
192 STAMR3RegisterF(pVM, &pCritSect->StatLocked, STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_OCCURENCE, NULL, "/PDM/CritSects/%s/Locked", pCritSect->pszName);
195 PUVM pUVM = pVM->pUVM;
208 SUPSemEventClose(pVM->pSession, (SUPSEMEVENT)pCritSect->Core.EventSem);
218 * @param pVM Pointer to the VM.
227 static int pdmR3CritSectRwInitOne(PVM pVM, PPDMCRITSECTRWINT pCritSect, void *pvKey, RT_SRC_POS_DECL,
230 VM_ASSERT_EMT(pVM);
237 int rc = SUPSemEventCreate(pVM->pSession, (PSUPSEMEVENT)&pCritSect->Core.hEvtWrite);
241 rc = SUPSemEventMultiCreate(pVM->pSession, (PSUPSEMEVENT)&pCritSect->Core.hEvtRead);
276 pCritSect->pVMR3 = pVM;
277 pCritSect->pVMR0 = pVM->pVMR0;
278 pCritSect->pVMRC = pVM->pVMRC;
282 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZEnterExcl, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionRZEnterExcl", pCritSect->pszName);
283 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZLeaveExcl, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionRZLeaveExcl", pCritSect->pszName);
284 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZEnterShared, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionRZEnterShared", pCritSect->pszName);
285 STAMR3RegisterF(pVM, &pCritSect->StatContentionRZLeaveShared, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionRZLeaveShared", pCritSect->pszName);
286 STAMR3RegisterF(pVM, &pCritSect->StatContentionR3EnterExcl, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionR3EnterExcl", pCritSect->pszName);
287 STAMR3RegisterF(pVM, &pCritSect->StatContentionR3EnterShared, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/ContentionR3EnterShared", pCritSect->pszName);
288 STAMR3RegisterF(pVM, &pCritSect->StatRZEnterExcl, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/RZEnterExcl", pCritSect->pszName);
289 STAMR3RegisterF(pVM, &pCritSect->StatRZEnterShared, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/RZEnterShared", pCritSect->pszName);
290 STAMR3RegisterF(pVM, &pCritSect->StatR3EnterExcl, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/R3EnterExcl", pCritSect->pszName);
291 STAMR3RegisterF(pVM, &pCritSect->StatR3EnterShared, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PDM/CritSectsRw/%s/R3EnterShared", pCritSect->pszName);
293 STAMR3RegisterF(pVM, &pCritSect->StatWriteLocked, STAMTYPE_PROFILE_ADV, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_OCCURENCE, NULL, "/PDM/CritSectsRw/%s/WriteLocked", pCritSect->pszName);
296 PUVM pUVM = pVM->pUVM;
309 SUPSemEventMultiClose(pVM->pSession, (SUPSEMEVENT)pCritSect->Core.hEvtRead);
311 SUPSemEventClose(pVM->pSession, (SUPSEMEVENT)pCritSect->Core.hEvtWrite);
324 * @param pVM Pointer to the VM.
333 VMMR3DECL(int) PDMR3CritSectInit(PVM pVM, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL, const char *pszNameFmt, ...)
341 int rc = pdmR3CritSectInitOne(pVM, &pCritSect->s, pCritSect, RT_SRC_POS_ARGS, pszNameFmt, va);
354 * @param pVM Pointer to the VM.
363 VMMR3DECL(int) PDMR3CritSectRwInit(PVM pVM, PPDMCRITSECTRW pCritSect, RT_SRC_POS_DECL, const char *pszNameFmt, ...)
371 int rc = pdmR3CritSectRwInitOne(pVM, &pCritSect->s, pCritSect, RT_SRC_POS_ARGS, pszNameFmt, va);
381 * @param pVM Pointer to the VM.
388 int pdmR3CritSectInitDevice(PVM pVM, PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
391 return pdmR3CritSectInitOne(pVM, &pCritSect->s, pDevIns, RT_SRC_POS_ARGS, pszNameFmt, va);
399 * @param pVM Pointer to the VM.
406 int pdmR3CritSectRwInitDevice(PVM pVM, PPDMDEVINS pDevIns, PPDMCRITSECTRW pCritSect, RT_SRC_POS_DECL,
409 return pdmR3CritSectRwInitOne(pVM, &pCritSect->s, pDevIns, RT_SRC_POS_ARGS, pszNameFmt, va);
417 * @param pVM Pointer to the VM.
421 int pdmR3CritSectInitDeviceAuto(PVM pVM, PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
426 int rc = pdmR3CritSectInitOne(pVM, &pCritSect->s, pDevIns, RT_SRC_POS_ARGS, pszNameFmt, va);
438 * @param pVM Pointer to the VM.
445 int pdmR3CritSectInitDriver(PVM pVM, PPDMDRVINS pDrvIns, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL,
450 int rc = pdmR3CritSectInitOne(pVM, &pCritSect->s, pDrvIns, RT_SRC_POS_ARGS, pszNameFmt, va);
460 * @param pVM Pointer to the VM.
467 int pdmR3CritSectRwInitDriver(PVM pVM, PPDMDRVINS pDrvIns, PPDMCRITSECTRW pCritSect, RT_SRC_POS_DECL,
472 int rc = pdmR3CritSectRwInitOne(pVM, &pCritSect->s, pDrvIns, RT_SRC_POS_ARGS, pszNameFmt, va);
483 * @param pVM Pointer to the VM.
490 static int pdmR3CritSectDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTINT pCritSect, PPDMCRITSECTINT pPrev, bool fFinal)
517 SUPSemEventSignal(pVM->pSession, hEvent);
519 int rc = SUPSemEventClose(pVM->pSession, hEvent);
528 STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSects/%s/*", pCritSect->pszName);
540 * @param pVM Pointer to the VM.
547 static int pdmR3CritSectRwDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTRWINT pCritSect, PPDMCRITSECTRWINT pPrev, bool fFinal)
586 int rc1 = SUPSemEventClose(pVM->pSession, hEvtWrite); AssertRC(rc1);
587 int rc2 = SUPSemEventMultiClose(pVM->pSession, hEvtRead); AssertRC(rc2);
598 STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSectsRw/%s/*", pCritSect->pszName);
613 * @param pVM Pointer to the VM.
616 static int pdmR3CritSectDeleteByKey(PVM pVM, void *pvKey)
621 PUVM pUVM = pVM->pUVM;
630 int rc2 = pdmR3CritSectDeleteOne(pVM, pUVM, pCur, pPrev, false /* not final */);
652 * @param pVM Pointer to the VM.
655 static int pdmR3CritSectRwDeleteByKey(PVM pVM, void *pvKey)
660 PUVM pUVM = pVM->pUVM;
669 int rc2 = pdmR3CritSectRwDeleteOne(pVM, pUVM, pCur, pPrev, false /* not final */);
689 * @param pVM Pointer to the VM.
692 int pdmR3CritSectBothDeleteDevice(PVM pVM, PPDMDEVINS pDevIns)
694 int rc1 = pdmR3CritSectDeleteByKey(pVM, pDevIns);
695 int rc2 = pdmR3CritSectRwDeleteByKey(pVM, pDevIns);
705 * @param pVM Pointer to the VM.
708 int pdmR3CritSectBothDeleteDriver(PVM pVM, PPDMDRVINS pDrvIns)
710 int rc1 = pdmR3CritSectDeleteByKey(pVM, pDrvIns);
711 int rc2 = pdmR3CritSectRwDeleteByKey(pVM, pDrvIns);
730 PVM pVM = pCritSect->s.pVMR3;
731 PUVM pUVM = pVM->pUVM;
732 AssertReleaseReturn(pVM, VERR_PDM_CRITSECT_IPE);
740 int rc = pdmR3CritSectDeleteOne(pVM, pUVM, pCur, pPrev, false /* not final */);
769 PVM pVM = pCritSect->s.pVMR3;
770 PUVM pUVM = pVM->pUVM;
771 AssertReleaseReturn(pVM, VERR_PDM_CRITSECT_IPE);
779 int rc = pdmR3CritSectRwDeleteOne(pVM, pUVM, pCur, pPrev, false /* not final */);
980 * @param pVM Pointer to the VM.
984 VMMR3DECL(uint32_t) PDMR3CritSectCountOwned(PVM pVM, char *pszNames, size_t cbNames)
1002 for (PPDMCRITSECTINT pCur = pVM->pUVM->pdm.s.pCritSects;
1015 for (PPDMCRITSECTRWINT pCur = pVM->pUVM->pdm.s.pRwCritSects;
1037 * @param pVM Pointer to the VM.
1039 VMMR3_INT_DECL(void) PDMR3CritSectLeaveAll(PVM pVM)
1042 PUVM pUVM = pVM->pUVM;
1064 * @param pVM Pointer to the VM.
1066 VMMR3DECL(PPDMCRITSECT) PDMR3CritSectGetNop(PVM pVM)
1068 VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
1069 return &pVM->pdm.s.NopCritSect;
1077 * @param pVM Pointer to the VM.
1079 VMMR3DECL(R0PTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopR0(PVM pVM)
1081 VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTR0PTR);
1082 return MMHyperR3ToR0(pVM, &pVM->pdm.s.NopCritSect);
1090 * @param pVM Pointer to the VM.
1092 VMMR3DECL(RCPTRTYPE(PPDMCRITSECT)) PDMR3CritSectGetNopRC(PVM pVM)
1094 VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTRCPTR);
1095 return MMHyperR3ToRC(pVM, &pVM->pdm.s.NopCritSect);