Lines Matching defs:pVM
44 static DECLCALLBACK(void) pdmR3QueueTimer(PVM pVM, PTMTIMER pTimer, void *pvUser);
52 * @param pVM Pointer to the VM.
61 static int pdmR3QueueCreate(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval, bool fRZEnabled,
64 PUVM pUVM = pVM->pUVM;
80 rc = MMHyperAlloc(pVM, cb, 0, MM_TAG_PDM_QUEUE, (void **)&pQueue );
82 rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_QUEUE, cb, (void **)&pQueue);
89 pQueue->pVMR3 = pVM;
90 pQueue->pVMR0 = fRZEnabled ? pVM->pVMR0 : NIL_RTR0PTR;
91 pQueue->pVMRC = fRZEnabled ? pVM->pVMRC : NIL_RTRCPTR;
108 pQueue->aFreeItems[i].pItemR0 = MMHyperR3ToR0(pVM, pItem);
109 pQueue->aFreeItems[i].pItemRC = MMHyperR3ToRC(pVM, pItem);
118 rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pdmR3QueueTimer, pQueue, "Queue timer", &pQueue->pTimer);
133 MMHyperFree(pVM, pQueue);
142 pdmLock(pVM);
145 pdmUnlock(pVM);
159 pdmLock(pVM);
169 pdmUnlock(pVM);
175 STAMR3RegisterF(pVM, &pQueue->cbItem, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Item size.", "/PDM/Queue/%s/cbItem", pQueue->pszName);
176 STAMR3RegisterF(pVM, &pQueue->cItems, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Queue size.", "/PDM/Queue/%s/cItems", pQueue->pszName);
177 STAMR3RegisterF(pVM, &pQueue->StatAllocFailures, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "PDMQueueAlloc failures.", "/PDM/Queue/%s/AllocFailures", pQueue->pszName);
178 STAMR3RegisterF(pVM, &pQueue->StatInsert, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to PDMQueueInsert.", "/PDM/Queue/%s/Insert", pQueue->pszName);
179 STAMR3RegisterF(pVM, &pQueue->StatFlush, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to pdmR3QueueFlush.", "/PDM/Queue/%s/Flush", pQueue->pszName);
180 STAMR3RegisterF(pVM, &pQueue->StatFlushLeftovers, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Left over items after flush.", "/PDM/Queue/%s/FlushLeftovers", pQueue->pszName);
182 STAMR3RegisterF(pVM, &pQueue->StatFlushPrf, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Profiling pdmR3QueueFlush.", "/PDM/Queue/%s/FlushPrf", pQueue->pszName);
183 STAMR3RegisterF(pVM, (void *)&pQueue->cStatPending, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Pending items.", "/PDM/Queue/%s/Pending", pQueue->pszName);
195 * @param pVM Pointer to the VM.
207 VMMR3_INT_DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
216 VMCPU_ASSERT_EMT(&pVM->aCpus[0]);
227 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue);
246 * @param pVM Pointer to the VM.
257 VMMR3_INT_DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
266 VMCPU_ASSERT_EMT(&pVM->aCpus[0]);
273 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue);
292 * @param pVM Pointer to the VM.
303 VMMR3_INT_DECL(int) PDMR3QueueCreateInternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
312 VMCPU_ASSERT_EMT(&pVM->aCpus[0]);
319 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue);
337 * @param pVM Pointer to the VM.
348 VMMR3_INT_DECL(int) PDMR3QueueCreateExternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
356 VMCPU_ASSERT_EMT(&pVM->aCpus[0]);
363 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue);
395 PVM pVM = pQueue->pVMR3;
396 PUVM pUVM = pVM->pUVM;
398 pdmLock(pVM);
443 pdmUnlock(pVM);
448 STAMR3DeregisterF(pVM->pUVM, "/PDM/Queue/%s/cbItem", pQueue->pszName);
462 MMHyperFree(pVM, pQueue);
475 * @param pVM Pointer to the VM.
479 VMMR3_INT_DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns)
489 PUVM pUVM = pVM->pUVM;
490 pdmLock(pVM);
518 pdmUnlock(pVM);
527 * @param pVM Pointer to the VM.
531 VMMR3_INT_DECL(int) PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns)
541 PUVM pUVM = pVM->pUVM;
542 pdmLock(pVM);
570 pdmUnlock(pVM);
578 * @param pVM Pointer to the VM.
581 void pdmR3QueueRelocate(PVM pVM, RTGCINTPTR offDelta)
586 PUVM pUVM = pVM->pUVM;
595 pQueue->pVMRC = pVM->pVMRC;
601 PPDMQUEUEITEMCORE pCur = (PPDMQUEUEITEMCORE)MMHyperRCToR3(pVM, pQueue->pPendingRC);
605 pCur = (PPDMQUEUEITEMCORE)MMHyperRCToR3(pVM, pCur->pNextRC);
613 pQueue->aFreeItems[i].pItemRC = MMHyperR3ToRC(pVM, pQueue->aFreeItems[i].pItemR3);
633 * @param pVM Pointer to the VM.
636 VMMR3_INT_DECL(void) PDMR3QueueFlushAll(PVM pVM)
638 VM_ASSERT_EMT(pVM);
650 VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES);
651 while (!ASMAtomicBitTestAndSet(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_ACTIVE_BIT))
653 ASMAtomicBitClear(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_PENDING_BIT);
655 for (PPDMQUEUE pCur = pVM->pUVM->pdm.s.pQueuesForced; pCur; pCur = pCur->pNext)
661 ASMAtomicBitClear(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_ACTIVE_BIT);
664 if ( !ASMBitTest(&pVM->pdm.s.fQueueFlushing, PDM_QUEUE_FLUSH_FLAG_PENDING_BIT)
665 && !VM_FF_IS_PENDING(pVM, VM_FF_PDM_QUEUES))
667 VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES);
864 * @param pVM Pointer to the VM.
868 static DECLCALLBACK(void) pdmR3QueueTimer(PVM pVM, PTMTIMER pTimer, void *pvUser)
871 Assert(pTimer == pQueue->pTimer); NOREF(pTimer); NOREF(pVM);