- Timestamp:
- Jul 7, 2009 5:10:52 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49715
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r21217 r21363 2299 2299 * If 0 then the emulation thread will be notified whenever an item arrives. 2300 2300 * @param pfnCallback The consumer function. 2301 * @param fGCEnabled Set if the queue should work in GC too. 2301 * @param fRZEnabled Set if the queue should work in RC and R0. 2302 * @param pszName The queue base name. The instance number will be 2303 * appended automatically. 2302 2304 * @param ppQueue Where to store the queue handle on success. 2303 2305 * @thread The emulation thread. 2304 2306 */ 2305 2307 DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 2306 PFNPDMQUEUEDEV pfnCallback, bool f GCEnabled, PPDMQUEUE *ppQueue));2308 PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue)); 2307 2309 2308 2310 /** … … 2881 2883 2882 2884 /** Current PDMDEVHLP version number. */ 2883 #define PDM_DEVHLP_VERSION 0xf20 a00002885 #define PDM_DEVHLP_VERSION 0xf20b0000 2884 2886 2885 2887 … … 3582 3584 */ 3583 3585 DECLINLINE(int) PDMDevHlpPDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 3584 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue)3585 { 3586 return pDevIns->pDevHlpR3->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, p pQueue);3586 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue) 3587 { 3588 return pDevIns->pDevHlpR3->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, ppQueue); 3587 3589 } 3588 3590 -
trunk/include/VBox/pdmdrv.h
r21217 r21363 482 482 * If 0 then the emulation thread will be notified whenever an item arrives. 483 483 * @param pfnCallback The consumer function. 484 * @param pszName The queue base name. The instance number will be 485 * appended automatically. 484 486 * @param ppQueue Where to store the queue handle on success. 485 487 * @thread The emulation thread. 486 488 */ 487 DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue)); 488 489 /** 490 * Register a poller function. 491 * TEMPORARY HACK FOR NETWORKING! DON'T USE! 492 * 493 * @returns VBox status code. 494 * @param pDrvIns Driver instance. 495 * @param pfnPoller The callback function. 496 */ 497 DECLR3CALLBACKMEMBER(int, pfnPDMPollerRegister,(PPDMDRVINS pDrvIns, PFNPDMDRVPOLLER pfnPoller)); 489 DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 490 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)); 498 491 499 492 /** … … 710 703 711 704 /** Current DRVHLP version number. */ 712 #define PDM_DRVHLP_VERSION 0x900 40000705 #define PDM_DRVHLP_VERSION 0x90050000 713 706 714 707 … … 826 819 */ 827 820 DECLINLINE(int) PDMDrvHlpPDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 828 PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue)829 { 830 return pDrvIns->pDrvHlp->pfnPDMQueueCreate(pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, p pQueue);821 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue) 822 { 823 return pDrvIns->pDrvHlp->pfnPDMQueueCreate(pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, pszName, ppQueue); 831 824 } 832 825 -
trunk/include/VBox/pdmqueue.h
r21217 r21363 112 112 113 113 VMMR3DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 114 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue);114 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue); 115 115 VMMR3DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 116 PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue);116 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue); 117 117 VMMR3DECL(int) PDMR3QueueCreateInternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 118 PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue);118 PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue); 119 119 VMMR3DECL(int) PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 120 PFNPDMQUEUEEXT pfnCallback, void *pvUser, PPDMQUEUE *ppQueue);120 PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue); 121 121 VMMR3DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue); 122 122 VMMR3DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns); -
trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
r15941 r21363 319 319 } 320 320 321 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVKBDQUEUEITEM), cItems, cMilliesInterval, drvKbdQueueConsumer, &pDrv->pQueue);321 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVKBDQUEUEITEM), cItems, cMilliesInterval, drvKbdQueueConsumer, "Keyboard", &pDrv->pQueue); 322 322 if (RT_FAILURE(rc)) 323 323 { -
trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp
r15941 r21363 305 305 } 306 306 307 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVMOUSEQUEUEITEM), cItems, cMilliesInterval, drvMouseQueueConsumer, &pDrv->pQueue);307 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVMOUSEQUEUEITEM), cItems, cMilliesInterval, drvMouseQueueConsumer, "Mouse", &pDrv->pQueue); 308 308 if (RT_FAILURE(rc)) 309 309 { -
trunk/src/VBox/Devices/Network/DevE1000.cpp
r21188 r21363 4809 4809 /* Create transmit queue */ 4810 4810 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 4811 e1kTxQueueConsumer, true, &pState->pTxQueueR3);4811 e1kTxQueueConsumer, true, "E1000-Xmit", &pState->pTxQueueR3); 4812 4812 if (RT_FAILURE(rc)) 4813 4813 return rc; … … 4817 4817 /* Create the RX notifier signaller. */ 4818 4818 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 4819 e1kCanRxQueueConsumer, true, &pState->pCanRxQueueR3);4819 e1kCanRxQueueConsumer, true, "E1000-Rcv", &pState->pCanRxQueueR3); 4820 4820 if (RT_FAILURE(rc)) 4821 4821 return rc; -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r21188 r21363 5084 5084 */ 5085 5085 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 5086 pcnetXmitQueueConsumer, true, &pThis->pXmitQueueR3);5086 pcnetXmitQueueConsumer, true, "PCNet-Xmit", &pThis->pXmitQueueR3); 5087 5087 if (RT_FAILURE(rc)) 5088 5088 return rc; … … 5094 5094 */ 5095 5095 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 5096 pcnetCanRxQueueConsumer, true, &pThis->pCanRxQueueR3);5096 pcnetCanRxQueueConsumer, true, "PCNet-Rcv", &pThis->pCanRxQueueR3); 5097 5097 if (RT_FAILURE(rc)) 5098 5098 return rc; -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r21112 r21363 716 716 fUDP = true; 717 717 else 718 return PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 719 N_("NAT#%d: Invalid configuration value for \"Protocol\": \"%s\""), 718 return PDMDrvHlpVMSetError(pThis->pDrvIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 719 N_("NAT#%d: Invalid configuration value for \"Protocol\": \"%s\""), 720 720 iInstance, szProtocol); 721 721 } … … 742 742 N_("NAT#%d: configuration error: failed to set up " 743 743 "redirection of %d to %d. Probably a conflict with " 744 "existing services or other rules"), iInstance, iHostPort, 744 "existing services or other rules"), iInstance, iHostPort, 745 745 iGuestPort); 746 746 } /* for each redir rule */ … … 822 822 bool fPassDomain = true; 823 823 GET_BOOL(rc, pThis, pCfgHandle, "PassDomain", fPassDomain); 824 824 825 825 GET_STRING_ALLOC(rc, pThis, pCfgHandle, "TFTPPrefix", pThis->pszTFTPPrefix); 826 826 GET_STRING_ALLOC(rc, pThis, pCfgHandle, "BootFile", pThis->pszBootFile); … … 833 833 * Query the network port interface. 834 834 */ 835 pThis->pPort = 836 (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, 835 pThis->pPort = 836 (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, 837 837 PDMINTERFACE_NETWORK_PORT); 838 838 if (!pThis->pPort) … … 840 840 N_("Configuration error: the above device/driver didn't " 841 841 "export the network port interface")); 842 pThis->pConfig = 843 (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, 842 pThis->pConfig = 843 (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, 844 844 PDMINTERFACE_NETWORK_CONFIG); 845 845 if (!pThis->pConfig) … … 858 858 if (RT_FAILURE(rc)) 859 859 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: Configuration error: " 860 "network '%s' describes not a valid IPv4 network"), 860 "network '%s' describes not a valid IPv4 network"), 861 861 pDrvIns->iInstance, szNetwork); 862 862 863 863 RTStrPrintf(szNetAddr, sizeof(szNetAddr), "%d.%d.%d.%d", 864 (Network & 0xFF000000) >> 24, (Network & 0xFF0000) >> 16, 864 (Network & 0xFF000000) >> 24, (Network & 0xFF0000) >> 16, 865 865 (Network & 0xFF00) >> 8, Network & 0xFF); 866 866 … … 899 899 slirp_register_statistics(pThis->pNATState, pDrvIns); 900 900 #ifdef VBOX_WITH_STATISTICS 901 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktSent, STAMTYPE_COUNTER, 901 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktSent, STAMTYPE_COUNTER, 902 902 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent viai " 903 903 "PDM queue", "/Drivers/NAT%u/QueuePacketSent", pDrvIns->iInstance); 904 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktDropped, STAMTYPE_COUNTER, 905 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM" 904 PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatQueuePktDropped, STAMTYPE_COUNTER, 905 STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "counting packet sent via PDM" 906 906 " queue", "/Drivers/NAT%u/QueuePacketDropped", pDrvIns->iInstance); 907 907 #endif … … 925 925 } 926 926 927 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVNATQUEUITEM), 50, 0, 928 drvNATQueueConsumer, &pThis->pSendQueue);927 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVNATQUEUITEM), 50, 0, 928 drvNATQueueConsumer, "NAT", &pThis->pSendQueue); 929 929 if (RT_FAILURE(rc)) 930 930 { … … 948 948 #else 949 949 pThis->hWakeupEvent = CreateEvent(NULL, FALSE, FALSE, NULL); /* auto-reset event */ 950 slirp_register_external_event(pThis->pNATState, pThis->hWakeupEvent, 950 slirp_register_external_event(pThis->pNATState, pThis->hWakeupEvent, 951 951 VBOX_WAKEUP_EVENT_INDEX); 952 952 #endif 953 953 954 rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pThis->pThread, pThis, drvNATAsyncIoThread, 954 rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pThis->pThread, pThis, drvNATAsyncIoThread, 955 955 drvNATAsyncIoWakeup, 128 * _1K, RTTHREADTYPE_IO, "NAT"); 956 956 AssertReleaseRC(rc); 957 957 958 958 #ifdef VBOX_WITH_SLIRP_MT 959 rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pThis->pGuestThread, pThis, drvNATAsyncIoGuest, 959 rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pThis->pGuestThread, pThis, drvNATAsyncIoGuest, 960 960 drvNATAsyncIoGuestWakeup, 128 * _1K, RTTHREADTYPE_IO, "NATGUEST"); 961 961 AssertReleaseRC(rc); -
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r21321 r21363 6245 6245 */ 6246 6246 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(DEVPORTNOTIFIERQUEUEITEM), 30*32 /*Maximum of 30 ports multiplied with 32 tasks each port*/, 0, 6247 ahciNotifyQueueConsumer, true, &pThis->pNotifierQueueR3);6247 ahciNotifyQueueConsumer, true, "AHCI-Xmit", &pThis->pNotifierQueueR3); 6248 6248 if (RT_FAILURE(rc)) 6249 6249 return rc; -
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r21321 r21363 2755 2755 /* Intialize task queue. */ 2756 2756 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 5, 0, 2757 buslogicNotifyQueueConsumer, true, &pThis->pNotifierQueueR3);2757 buslogicNotifyQueueConsumer, true, "BugLogicTask", &pThis->pNotifierQueueR3); 2758 2758 if (RT_FAILURE(rc)) 2759 2759 return rc; -
trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
r21321 r21363 5300 5300 /* Intialize task queue. */ 5301 5301 rc = PDMDevHlpPDMQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 2, 0, 5302 lsilogicNotifyQueueConsumer, true, &pThis->pNotificationQueueR3);5302 lsilogicNotifyQueueConsumer, true, "LsiLogic-Task", &pThis->pNotificationQueueR3); 5303 5303 if (RT_FAILURE(rc)) 5304 5304 return rc; -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r20927 r21363 1217 1217 /** @copydoc PDMDEVHLPR3::pfnPDMQueueCreate */ 1218 1218 static DECLCALLBACK(int) pdmR3DevHlp_PDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 1219 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue)1220 { 1221 PDMDEV_ASSERT_DEVINS(pDevIns); 1222 LogFlow(("pdmR3DevHlp_PDMQueueCreate: caller='%s'/%d: cbItem=%#x cItems=%#x cMilliesInterval=%u pfnCallback=%p fGCEnabled=%RTbool p pQueue=%p\n",1223 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, p pQueue));1219 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, const char *pszName, PPDMQUEUE *ppQueue) 1220 { 1221 PDMDEV_ASSERT_DEVINS(pDevIns); 1222 LogFlow(("pdmR3DevHlp_PDMQueueCreate: caller='%s'/%d: cbItem=%#x cItems=%#x cMilliesInterval=%u pfnCallback=%p fGCEnabled=%RTbool pszName=%p:{%s} ppQueue=%p\n", 1223 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, pszName, ppQueue)); 1224 1224 1225 1225 PVM pVM = pDevIns->Internal.s.pVMR3; 1226 1226 VM_ASSERT_EMT(pVM); 1227 int rc = PDMR3QueueCreateDevice(pVM, pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue); 1227 1228 if (pDevIns->iInstance > 0) 1229 { 1230 pszName = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DEVICE_DESC, "%s-%u", pszName, pDevIns->iInstance); 1231 AssertLogRelReturn(pszName, VERR_NO_MEMORY); 1232 } 1233 1234 int rc = PDMR3QueueCreateDevice(pVM, pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, pszName, ppQueue); 1228 1235 1229 1236 LogFlow(("pdmR3DevHlp_PDMQueueCreate: caller='%s'/%d: returns %Rrc *ppQueue=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *ppQueue)); -
trunk/src/VBox/VMM/PDMDevice.cpp
r21188 r21363 137 137 AssertReleaseRCReturn(rc, rc); 138 138 139 rc = PDMR3QueueCreateInternal(pVM, sizeof(PDMDEVHLPTASK), 8, 0, pdmR3DevHlpQueueConsumer, true, &pVM->pdm.s.pDevHlpQueueR3); 139 rc = PDMR3QueueCreateInternal(pVM, sizeof(PDMDEVHLPTASK), 8, 0, pdmR3DevHlpQueueConsumer, true, "DevHlp", 140 &pVM->pdm.s.pDevHlpQueueR3); 140 141 AssertRCReturn(rc, rc); 141 142 pVM->pdm.s.pDevHlpQueueR0 = PDMQueueR0Ptr(pVM->pdm.s.pDevHlpQueueR3); -
trunk/src/VBox/VMM/PDMDriver.cpp
r21188 r21363 815 815 816 816 /** @copydoc PDMDRVHLP::pfnPDMQueueCreate */ 817 static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue) 818 { 819 PDMDRV_ASSERT_DRVINS(pDrvIns); 820 LogFlow(("pdmR3DrvHlp_PDMQueueCreate: caller='%s'/%d: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p ppQueue=%p\n", 821 pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, ppQueue, ppQueue)); 822 VM_ASSERT_EMT(pDrvIns->Internal.s.pVM); 823 824 int rc = PDMR3QueueCreateDriver(pDrvIns->Internal.s.pVM, pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, ppQueue); 817 static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 818 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue) 819 { 820 PDMDRV_ASSERT_DRVINS(pDrvIns); 821 LogFlow(("pdmR3DrvHlp_PDMQueueCreate: caller='%s'/%d: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%p:{%s} ppQueue=%p\n", 822 pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, pszName, pszName, ppQueue, ppQueue)); 823 PVM pVM = pDrvIns->Internal.s.pVM; 824 VM_ASSERT_EMT(pVM); 825 826 if (pDrvIns->iInstance > 0) 827 { 828 pszName = MMR3HeapAPrintf(pVM, MM_TAG_PDM_DRIVER_DESC, "%s-%u", pszName, pDrvIns->iInstance); 829 AssertLogRelReturn(pszName, VERR_NO_MEMORY); 830 } 831 832 int rc = PDMR3QueueCreateDriver(pVM, pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, pszName, ppQueue); 825 833 826 834 LogFlow(("pdmR3DrvHlp_PDMQueueCreate: caller='%s'/%d: returns %Rrc *ppQueue=%p\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, rc, *ppQueue)); 827 835 return rc; 828 }829 830 831 /** @copydoc PDMDRVHLP::pfnPDMPollerRegister */832 static DECLCALLBACK(int) pdmR3DrvHlp_PDMPollerRegister(PPDMDRVINS pDrvIns, PFNPDMDRVPOLLER pfnPoller)833 {834 PDMDRV_ASSERT_DRVINS(pDrvIns);835 AssertLogRelMsgFailedReturn(("pdmR3DrvHlp_PDMPollerRegister: caller='%s'/%d: pfnPoller=%p -> VERR_NOT_SUPPORTED\n", pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pfnPoller),836 VERR_NOT_SUPPORTED);837 836 } 838 837 … … 1063 1062 pdmR3DrvHlp_VMSetRuntimeErrorV, 1064 1063 pdmR3DrvHlp_PDMQueueCreate, 1065 pdmR3DrvHlp_PDMPollerRegister,1066 1064 pdmR3DrvHlp_TMGetVirtualFreq, 1067 1065 pdmR3DrvHlp_TMGetVirtualTime, -
trunk/src/VBox/VMM/PDMInternal.h
r21188 r21363 700 700 /** LIFO of pending items - GC. */ 701 701 RCPTRTYPE(PPDMQUEUEITEMCORE) volatile pPendingRC; 702 702 703 /** Item size (bytes). */ 703 RTUINTcbItem;704 uint32_t cbItem; 704 705 /** Number of items in the queue. */ 705 RTUINTcItems;706 uint32_t cItems; 706 707 /** Index to the free head (where we insert). */ 707 708 uint32_t volatile iFreeHead; 708 709 /** Index to the free tail (where we remove). */ 709 710 uint32_t volatile iFreeTail; 711 712 /** Unqiue queue name. */ 713 R3PTRTYPE(const char *) pszName; 714 #if HC_ARCH_BITS == 32 715 RTR3PTR Alignment1; 716 #endif 717 /** Stat: Times PDMQueueAlloc fails. */ 718 STAMCOUNTER StatAllocFailures; 719 /** Stat: PDMQueueInsert calls. */ 720 STAMCOUNTER StatInsert; 721 /** Stat: Queue flushes. */ 722 STAMCOUNTER StatFlush; 723 /** Stat: Queue flushes with pending items left over. */ 724 STAMCOUNTER StatFlushLeftovers; 725 #ifdef VBOX_WITH_STATISTICS 726 /** State: Profiling the flushing. */ 727 STAMPROFILE StatFlushPrf; 728 #endif 710 729 711 730 /** Array of pointers to free items. Variable size. */ -
trunk/src/VBox/VMM/PDMQueue.cpp
r21153 r21363 57 57 * If 0 then the emulation thread will be notified whenever an item arrives. 58 58 * @param fRZEnabled Set if the queue will be used from RC/R0 and need to be allocated from the hyper heap. 59 * @param pszName The queue name. Unique. Not copied. 59 60 * @param ppQueue Where to store the queue handle. 60 61 */ 61 static int pdmR3QueueCreate(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, bool fRZEnabled, PPDMQUEUE *ppQueue) 62 static int pdmR3QueueCreate(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, bool fRZEnabled, 63 const char *pszName, PPDMQUEUE *ppQueue) 62 64 { 63 65 /* … … 95 97 pQueue->pVMR0 = fRZEnabled ? pVM->pVMR0 : NIL_RTR0PTR; 96 98 pQueue->pVMRC = fRZEnabled ? pVM->pVMRC : NIL_RTRCPTR; 99 pQueue->pszName = pszName; 97 100 pQueue->cMilliesInterval = cMilliesInterval; 98 101 //pQueue->pTimer = NULL; … … 174 177 } 175 178 179 /* 180 * Register the statistics. 181 */ 182 STAMR3RegisterF(pVM, &pQueue->cbItem, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, "Item size.", "/PDM/Queue/%s/cbItem", pQueue->pszName); 183 STAMR3RegisterF(pVM, &pQueue->cItems, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Queue size.", "/PDM/Queue/%s/cItems", pQueue->pszName); 184 STAMR3RegisterF(pVM, &pQueue->StatAllocFailures, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "PDMQueueAlloc failures.", "/PDM/Queue/%s/AllocFailures", pQueue->pszName); 185 STAMR3RegisterF(pVM, &pQueue->StatInsert, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to PDMQueueInsert.", "/PDM/Queue/%s/Insert", pQueue->pszName); 186 STAMR3RegisterF(pVM, &pQueue->StatFlush, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Calls to pdmR3QueueFlush.", "/PDM/Queue/%s/Flush", pQueue->pszName); 187 STAMR3RegisterF(pVM, &pQueue->StatFlushLeftovers, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Left over items after flush.", "/PDM/Queue/%s/FlushLeftovers", pQueue->pszName); 188 #ifdef VBOX_WITH_STATISTICS 189 STAMR3RegisterF(pVM, &pQueue->StatFlushPrf, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_CALLS, "Profiling pdmR3QueueFlush.", "/PDM/Queue/%s/FlushPrf", pQueue->pszName); 190 #endif 191 176 192 *ppQueue = pQueue; 177 193 return VINF_SUCCESS; … … 191 207 * @param pfnCallback The consumer function. 192 208 * @param fRZEnabled Set if the queue must be usable from RC/R0. 209 * @param pszName The queue name. Unique. Not copied. 193 210 * @param ppQueue Where to store the queue handle on success. 194 211 * @thread Emulation thread only. 195 212 */ 196 213 VMMR3DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 197 PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, PPDMQUEUE *ppQueue)198 { 199 LogFlow(("PDMR3QueueCreateDevice: pDevIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool \n",214 PFNPDMQUEUEDEV pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue) 215 { 216 LogFlow(("PDMR3QueueCreateDevice: pDevIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n", 200 217 pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled)); 201 218 … … 214 231 */ 215 232 PPDMQUEUE pQueue; 216 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, &pQueue);233 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue); 217 234 if (RT_SUCCESS(rc)) 218 235 { … … 240 257 * If 0 then the emulation thread will be notified whenever an item arrives. 241 258 * @param pfnCallback The consumer function. 259 * @param pszName The queue name. Unique. Not copied. 242 260 * @param ppQueue Where to store the queue handle on success. 243 261 * @thread Emulation thread only. 244 262 */ 245 263 VMMR3DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 246 PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue)247 { 248 LogFlow(("PDMR3QueueCreateDriver: pDrvIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p \n",249 pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback ));264 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue) 265 { 266 LogFlow(("PDMR3QueueCreateDriver: pDrvIns=%p cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n", 267 pDrvIns, cbItem, cItems, cMilliesInterval, pfnCallback, pszName)); 250 268 251 269 /* … … 263 281 */ 264 282 PPDMQUEUE pQueue; 265 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, &pQueue);283 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue); 266 284 if (RT_SUCCESS(rc)) 267 285 { … … 289 307 * @param pfnCallback The consumer function. 290 308 * @param fRZEnabled Set if the queue must be usable from RC/R0. 309 * @param pszName The queue name. Unique. Not copied. 291 310 * @param ppQueue Where to store the queue handle on success. 292 311 * @thread Emulation thread only. 293 312 */ 294 313 VMMR3DECL(int) PDMR3QueueCreateInternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 295 PFNPDMQUEUEINT pfnCallback, bool fRZEnabled, PPDMQUEUE *ppQueue)296 { 297 LogFlow(("PDMR3QueueCreateInternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool \n",298 cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled ));314 PFNPDMQUEUEINT pfnCallback, bool fRZEnabled, const char *pszName, PPDMQUEUE *ppQueue) 315 { 316 LogFlow(("PDMR3QueueCreateInternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p fRZEnabled=%RTbool pszName=%s\n", 317 cbItem, cItems, cMilliesInterval, pfnCallback, fRZEnabled, pszName)); 299 318 300 319 /* … … 312 331 */ 313 332 PPDMQUEUE pQueue; 314 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, &pQueue);333 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, fRZEnabled, pszName, &pQueue); 315 334 if (RT_SUCCESS(rc)) 316 335 { … … 337 356 * @param pfnCallback The consumer function. 338 357 * @param pvUser The user argument to the consumer function. 358 * @param pszName The queue name. Unique. Not copied. 339 359 * @param ppQueue Where to store the queue handle on success. 340 360 * @thread Emulation thread only. 341 361 */ 342 VMMR3DECL(int) PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, PFNPDMQUEUEEXT pfnCallback, void *pvUser, PPDMQUEUE *ppQueue)343 { 344 LogFlow(("PDMR3QueueCreateExternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p \n", cbItem, cItems, cMilliesInterval, pfnCallback));362 VMMR3DECL(int) PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, PFNPDMQUEUEEXT pfnCallback, void *pvUser, const char *pszName, PPDMQUEUE *ppQueue) 363 { 364 LogFlow(("PDMR3QueueCreateExternal: cbItem=%d cItems=%d cMilliesInterval=%d pfnCallback=%p pszName=%s\n", cbItem, cItems, cMilliesInterval, pfnCallback, pszName)); 345 365 346 366 /* … … 358 378 */ 359 379 PPDMQUEUE pQueue; 360 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, &pQueue);380 int rc = pdmR3QueueCreate(pVM, cbItem, cItems, cMilliesInterval, false, pszName, &pQueue); 361 381 if (RT_SUCCESS(rc)) 362 382 { … … 438 458 pQueue->pVMR3 = NULL; 439 459 pdmUnlock(pVM); 460 461 /* 462 * Deregister statistics. 463 */ 464 STAMR3Deregister(pVM, &pQueue->cbItem); 465 STAMR3Deregister(pVM, &pQueue->cbItem); 466 STAMR3Deregister(pVM, &pQueue->StatInsert); 467 STAMR3Deregister(pVM, &pQueue->StatFlush); 468 STAMR3Deregister(pVM, &pQueue->StatFlushLeftovers); 469 #ifdef VBOX_WITH_STATISTICS 470 STAMR3Deregister(pVM, &pQueue->StatFlushPrf); 471 #endif 440 472 441 473 /* … … 664 696 static bool pdmR3QueueFlush(PPDMQUEUE pQueue) 665 697 { 698 STAM_PROFILE_START(&pQueue->StatFlushPrf,p); 699 666 700 /* 667 701 * Get the lists. … … 804 838 } 805 839 } 840 841 STAM_REL_COUNTER_INC(&pQueue->StatFlushLeftovers); 842 STAM_PROFILE_STOP(&pQueue->StatFlushPrf,p); 806 843 return false; 807 844 } 808 845 846 STAM_PROFILE_STOP(&pQueue->StatFlushPrf,p); 809 847 return true; 810 848 } -
trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
r21128 r21363 58 58 i = pQueue->iFreeTail; 59 59 if (i == pQueue->iFreeHead) 60 { 61 STAM_REL_COUNTER_INC(&pQueue->StatAllocFailures); 60 62 return NULL; 63 } 61 64 pNew = pQueue->aFreeItems[i].CTX_SUFF(pItem); 62 65 iNext = (i + 1) % (pQueue->cItems + PDMQUEUE_FREE_SLACK); … … 98 101 #endif 99 102 } 103 STAM_REL_COUNTER_INC(&pQueue->StatInsert); 100 104 } 101 105 -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r20875 r21363 396 396 GEN_CHECK_OFF(PDMQUEUE, iFreeHead); 397 397 GEN_CHECK_OFF(PDMQUEUE, iFreeTail); 398 GEN_CHECK_OFF(PDMQUEUE, pszName); 399 GEN_CHECK_OFF(PDMQUEUE, StatAllocFailures); 400 GEN_CHECK_OFF(PDMQUEUE, StatInsert); 401 GEN_CHECK_OFF(PDMQUEUE, StatFlush); 402 GEN_CHECK_OFF(PDMQUEUE, StatFlushLeftovers); 398 403 GEN_CHECK_OFF(PDMQUEUE, aFreeItems); 399 404 GEN_CHECK_OFF(PDMQUEUE, aFreeItems[1]);
Note:
See TracChangeset
for help on using the changeset viewer.