PDMQueue.cpp revision c647bac94d46aebf0bcf05d87cea81d048dc2675
cbaf00194b28ee57e4aeee473f66f91f1be4e022vboxsync * PDM Queue - Transport data and tasks to EMT and R3.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * Copyright (C) 2006-2013 Oracle Corporation
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * available from http://www.virtualbox.org. This file is free software;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * General Public License (GPL) as published by the Free Software
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync/*******************************************************************************
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync* Header Files *
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync*******************************************************************************/
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/*******************************************************************************
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync* Internal Functions *
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync*******************************************************************************/
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsyncDECLINLINE(void) pdmR3QueueFreeItem(PPDMQUEUE pQueue, PPDMQUEUEITEMCORE pItem);
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsyncstatic DECLCALLBACK(void) pdmR3QueueTimer(PVM pVM, PTMTIMER pTimer, void *pvUser);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Internal worker for the queue creation apis.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync * @returns VBox status.
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync * @param pVM Pointer to the VM.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cbItem Item size.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cItems Number of items.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cMilliesInterval Number of milliseconds between polling the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * If 0 then the emulation thread will be notified whenever an item arrives.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param fRZEnabled Set if the queue will be used from RC/R0 and need to be allocated from the hyper heap.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pszName The queue name. Unique. Not copied.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param ppQueue Where to store the queue handle.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsyncstatic int pdmR3QueueCreate(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval, bool fRZEnabled,
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Validate input.
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync AssertMsgReturn(cbItem >= sizeof(PDMQUEUEITEMCORE) && cbItem < _1M, ("cbItem=%zu\n", cbItem), VERR_OUT_OF_RANGE);
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync AssertMsgReturn(cItems >= 1 && cItems <= _64K, ("cItems=%u\n", cItems), VERR_OUT_OF_RANGE);
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * Align the item size and calculate the structure size.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync size_t cb = cbItem * cItems + RT_ALIGN_Z(RT_OFFSETOF(PDMQUEUE, aFreeItems[cItems + PDMQUEUE_FREE_SLACK]), 16);
fe96bc0e43d9c137304462ef8c2d79cbff22446fvboxsync rc = MMHyperAlloc(pVM, cb, 0, MM_TAG_PDM_QUEUE, (void **)&pQueue );
fa033b734cf3b131680f290326ccbbd23c42946bvboxsync rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_QUEUE, cb, (void **)&pQueue);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Initialize the data fields.
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync pQueue->pVMR0 = fRZEnabled ? pVM->pVMR0 : NIL_RTR0PTR;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync pQueue->pVMRC = fRZEnabled ? pVM->pVMRC : NIL_RTRCPTR;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync //pQueue->pTimer = NULL;
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync //pQueue->pPendingR3 = NULL;
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync //pQueue->pPendingR0 = NULL;
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync //pQueue->pPendingRC = NULL;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync //pQueue->iFreeTail = 0;
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync PPDMQUEUEITEMCORE pItem = (PPDMQUEUEITEMCORE)((char *)pQueue + RT_ALIGN_Z(RT_OFFSETOF(PDMQUEUE, aFreeItems[cItems + PDMQUEUE_FREE_SLACK]), 16));
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync for (unsigned i = 0; i < cItems; i++, pItem = (PPDMQUEUEITEMCORE)((char *)pItem + cbItem))
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync pQueue->aFreeItems[i].pItemR0 = MMHyperR3ToR0(pVM, pItem);
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync pQueue->aFreeItems[i].pItemRC = MMHyperR3ToRC(pVM, pItem);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Create timer?
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pdmR3QueueTimer, pQueue, "Queue timer", &pQueue->pTimer);
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync rc = TMTimerSetMillies(pQueue->pTimer, cMilliesInterval);
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync AssertMsgFailed(("TMTimerSetMillies failed rc=%Rrc\n", rc));
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync int rc2 = TMR3TimerDestroy(pQueue->pTimer); AssertRC(rc2);
aa32d4906f2f685992091893d5abdf27a2352a85vboxsync AssertMsgFailed(("TMR3TimerCreateInternal failed rc=%Rrc\n", rc));
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * Insert into the queue list for timer driven queues.
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * Insert into the queue list for forced action driven queues.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * This is a FIFO, so insert at the end.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync /** @todo we should add a priority to the queues so we don't have to rely on
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * the initialization order to deal with problems like @bugref{1605} (pgm/pcnet
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * deadlock caused by the critsect queue to be last in the chain).
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * - Update, the critical sections are no longer using queues, so this isn't a real
914d33aebb63d8c288dfd1b7e74f8e2acf3eaa66vboxsync * problem any longer. The priority might be a nice feature for later though.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync * Register the statistics.
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync STAMR3RegisterF(pVM, &pQueue->cbItem, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Item size.", "/PDM/Queue/%s/cbItem", pQueue->pszName);
06696af9c885503e8dc3b1fe5836033c833e51a9vboxsync STAMR3RegisterF(pVM, &pQueue->cItems, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Queue size.", "/PDM/Queue/%s/cItems", pQueue->pszName);
06696af9c885503e8dc3b1fe5836033c833e51a9vboxsync STAMR3RegisterF(pVM, &pQueue->StatAllocFailures, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "PDMQueueAlloc failures.", "/PDM/Queue/%s/AllocFailures", pQueue->pszName);
06696af9c885503e8dc3b1fe5836033c833e51a9vboxsync STAMR3RegisterF(pVM, &pQueue->StatInsert, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to PDMQueueInsert.", "/PDM/Queue/%s/Insert", pQueue->pszName);
06696af9c885503e8dc3b1fe5836033c833e51a9vboxsync STAMR3RegisterF(pVM, &pQueue->StatFlush, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to pdmR3QueueFlush.", "/PDM/Queue/%s/Flush", pQueue->pszName);
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync STAMR3RegisterF(pVM, &pQueue->StatFlushLeftovers, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Left over items after flush.", "/PDM/Queue/%s/FlushLeftovers", pQueue->pszName);
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync STAMR3RegisterF(pVM, &pQueue->StatFlushPrf, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Profiling pdmR3QueueFlush.", "/PDM/Queue/%s/FlushPrf", pQueue->pszName);
8137be2315957032783c582a2e5c2523ea96f9bcvboxsync STAMR3RegisterF(pVM, (void *)&pQueue->cStatPending, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Pending items.", "/PDM/Queue/%s/Pending", pQueue->pszName);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Create a queue with a device owner.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @returns VBox status code.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pVM Pointer to the VM.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pDevIns Device instance.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cbItem Size a queue item.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cItems Number of items in the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cMilliesInterval Number of milliseconds between polling the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * If 0 then the emulation thread will be notified whenever an item arrives.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pfnCallback The consumer function.
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * @param fRZEnabled Set if the queue must be usable from RC/R0.
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * @param pszName The queue name. Unique. Not copied.
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * @param ppQueue Where to store the queue handle on success.
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync * @thread Emulation thread only.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsyncVMMR3_INT_DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync LogFlow(("PDMR3QueueCreateDevice: pDevIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n",
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled, pszName));
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Validate input.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Create the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue);
f379f813372b948dc6603b556f0ade7f838a5a65vboxsync Log(("PDM: Created device queue %p; cbItem=%d cItems=%d cMillies=%d pfnCallback=%p pDevIns=%p\n",
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync cbItem, cItems, cMilliesInterval, pfnCallback, pDevIns));
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Create a queue with a driver owner.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @returns VBox status code.
b1cc88518a7578ee20491f3d97b9792c24c6428dvboxsync * @param pVM Pointer to the VM.
fe813b3594039ba864493438e78ee0e7132bc445vboxsync * @param pDrvIns Driver instance.
b1cc88518a7578ee20491f3d97b9792c24c6428dvboxsync * @param cbItem Size a queue item.
b1cc88518a7578ee20491f3d97b9792c24c6428dvboxsync * @param cItems Number of items in the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cMilliesInterval Number of milliseconds between polling the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * If 0 then the emulation thread will be notified whenever an item arrives.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pfnCallback The consumer function.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pszName The queue name. Unique. Not copied.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param ppQueue Where to store the queue handle on success.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @thread Emulation thread only.
362838d79d234a41380be42aae9118850cc3c929vboxsyncVMMR3_INT_DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
362838d79d234a41380be42aae9118850cc3c929vboxsync PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
362838d79d234a41380be42aae9118850cc3c929vboxsync LogFlow(("PDMR3QueueCreateDriver: pDrvIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n",
bc36547e8dd3d35e5f756643a267bbe01e2c1d4cvboxsync pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, pszName));
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync * Validate input.
362838d79d234a41380be42aae9118850cc3c929vboxsync AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync * Create the queue.
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue);
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync Log(("PDM: Created driver queue %p; cbItem=%d cItems=%d cMillies=%d pfnCallback=%p pDrvIns=%p\n",
22bdb1ce26b2d5a41d1b071c16f1078e5348bb0dvboxsync cbItem, cItems, cMilliesInterval, pfnCallback, pDrvIns));
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * Create a queue with an internal owner.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @returns VBox status code.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param pVM Pointer to the VM.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param cbItem Size a queue item.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param cItems Number of items in the queue.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param cMilliesInterval Number of milliseconds between polling the queue.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * If 0 then the emulation thread will be notified whenever an item arrives.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param pfnCallback The consumer function.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param fRZEnabled Set if the queue must be usable from RC/R0.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param pszName The queue name. Unique. Not copied.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @param ppQueue Where to store the queue handle on success.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * @thread Emulation thread only.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsyncVMMR3_INT_DECL(int) PDMR3QueueCreateInternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync PFNPDMQUEUEINT pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync LogFlow(("PDMR3QueueCreateInternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n",
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled, pszName));
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * Validate input.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync * Create the queue.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue);
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync Log(("PDM: Created internal queue %p; cbItem=%d cItems=%d cMillies=%d pfnCallback=%p\n",
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * Create a queue with an external owner.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @returns VBox status code.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * @param pVM Pointer to the VM.
cba6719bd64ec749967bbe931230452664109857vboxsync * @param cbItem Size a queue item.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param cItems Number of items in the queue.
c28fa006ba669ad8f26ae31d00a338379c04ea1bvboxsync * @param cMilliesInterval Number of milliseconds between polling the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * If 0 then the emulation thread will be notified whenever an item arrives.
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * @param pfnCallback The consumer function.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param pvUser The user argument to the consumer function.
e74eef731a813e4e06680c587a6759b9974b29c9vboxsync * @param pszName The queue name. Unique. Not copied.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @param ppQueue Where to store the queue handle on success.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * @thread Emulation thread only.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsyncVMMR3_INT_DECL(int) PDMR3QueueCreateExternal(PVM pVM, size_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue)
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsync LogFlow(("PDMR3QueueCreateExternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n", cbItem, cItems, cMilliesInterval, pfnCallback, pszName));
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Validate input.
0f1e77149ab5ab40fa2bd74a5330e087416b3c7bvboxsync AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync * Create the queue.
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue);
5b1d6bab9f4cf5dacf1883e7c4a40c84349f597fvboxsync Log(("PDM: Created external queue %p; cbItem=%d cItems=%d cMillies=%d pfnCallback=%p pvUser=%p\n",
cba6719bd64ec749967bbe931230452664109857vboxsync cbItem, cItems, cMilliesInterval, pfnCallback, pvUser));
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync * Destroy a queue.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @returns VBox status code.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @param pQueue Queue to destroy.
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync * @thread Emulation thread only.
dd97657cc7e8460edff31ebcff4c9d19bf8ad694vboxsyncVMMR3_INT_DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue)
801238b286a80a5dd67ba56a1f26c0bc98a2a1eavboxsync LogFlow(("PDMR3QueueDestroy: pQueue=%p\n", pQueue));
548ca31b6b47c36bacce49bed3339cb8075b9681vboxsync * Validate input.
e3f5c51715cbf77ae2d2e9d05bafd00d69b1bec9vboxsync * Unlink it.
cba6719bd64ec749967bbe931230452664109857vboxsync * Deregister statistics.
ad77e3ec3cde24263bc7537575f5cae442bee3b1vboxsync STAMR3DeregisterF(pVM->pUVM, "/PDM/Queue/%s/cbItem", pQueue->pszName);
cba6719bd64ec749967bbe931230452664109857vboxsync * Destroy the timer and free it.
return VINF_SUCCESS;
if (!pDevIns)
return VERR_INVALID_PARAMETER;
while (pQueue)
} while (pQueue);
return VINF_SUCCESS;
if (!pDrvIns)
return VERR_INVALID_PARAMETER;
while (pQueue)
} while (pQueue);
return VINF_SUCCESS;
while (pQueue)
} while (pQueue);
|| pItemsRC
|| pItems,
while (pCur)
while (pItemsRC)
while (pItemsR0)
case PDMQUEUETYPE_DEV:
while (pItems)
case PDMQUEUETYPE_DRV:
while (pItems)
case PDMQUEUETYPE_INTERNAL:
while (pItems)
case PDMQUEUETYPE_EXTERNAL:
while (pItems)
if (pItems)
while (pCur)
if (pPending)