VirtualBox

Changeset 88306 in vbox


Ignore:
Timestamp:
Mar 26, 2021 9:17:46 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143523
Message:

VMM/PDMDevHlp: Added pfnSTAMDeregisterByPrefix. bugref:9890

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r88290 r88306  
    23492349
    23502350/** Current PDMDEVHLPR3 version number. */
    2351 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 47, 0)
     2351#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 47, 1)
    23522352
    23532353/**
     
    42624262    /** Space reserved for future members.
    42634263     * @{ */
    4264     DECLR3CALLBACKMEMBER(void, pfnReserved1,(void));
     4264    /**
     4265     * Deregister zero or more samples given their name prefix.
     4266     *
     4267     * @returns VBox status code.
     4268     * @param   pDevIns     The device instance.
     4269     * @param   pszPrefix   The name prefix of the samples to remove.  If this does
     4270     *                      not start with a '/', the default prefix will be
     4271     *                      prepended, otherwise it will be used as-is.
     4272     */
     4273    DECLR3CALLBACKMEMBER(int, pfnSTAMDeregisterByPrefix,(PPDMDEVINS pDevIns, const char *pszPrefix));
    42654274    DECLR3CALLBACKMEMBER(void, pfnReserved2,(void));
    42664275    DECLR3CALLBACKMEMBER(void, pfnReserved3,(void));
     
    68556864
    68566865/**
     6866 * @copydoc PDMDEVHLPR3::pfnSTAMDeregisterByPrefix
     6867 */
     6868DECLINLINE(int) PDMDevHlpSTAMDeregisterByPrefix(PPDMDEVINS pDevIns, const char *pszPrefix)
     6869{
     6870    return pDevIns->pHlpR3->pfnSTAMDeregisterByPrefix(pDevIns, pszPrefix);
     6871}
     6872
     6873/**
    68576874 * Registers the device with the default PCI bus.
    68586875 *
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r88290 r88306  
    12981298    }
    12991299    AssertRC(rc);
     1300}
     1301
     1302
     1303/**
     1304 * @interface_method_impl{PDMDEVHLPR3,pfnSTAMDeregisterByPrefix}
     1305 */
     1306static DECLCALLBACK(int) pdmR3DevHlp_STAMDeregisterByPrefix(PPDMDEVINS pDevIns, const char *pszPrefix)
     1307{
     1308    PDMDEV_ASSERT_DEVINS(pDevIns);
     1309    PVM pVM = pDevIns->Internal.s.pVMR3;
     1310    VM_ASSERT_EMT(pVM);
     1311
     1312    int rc;
     1313    if (*pszPrefix == '/')
     1314        rc = STAMR3DeregisterByPrefix(pVM->pUVM, pszPrefix);
     1315    else
     1316    {
     1317        char    szQualifiedPrefix[1024];
     1318        ssize_t cch;
     1319        if (pDevIns->pReg->cMaxInstances == 1)
     1320            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s/%s", pDevIns->pReg->szName, pszPrefix);
     1321        else
     1322            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s#%u/%s",
     1323                               pDevIns->pReg->szName, pDevIns->iInstance, pszPrefix);
     1324        AssertReturn(cch > 0, VERR_OUT_OF_RANGE);
     1325        rc = STAMR3DeregisterByPrefix(pVM->pUVM, szQualifiedPrefix);
     1326    }
     1327    AssertRC(rc);
     1328    return rc;
    13001329}
    13011330
     
    44114440    pdmR3DevHlp_CpuGetGuestMicroarch,
    44124441    pdmR3DevHlp_CpuGetGuestAddrWidths,
    4413     0,
     4442    pdmR3DevHlp_STAMDeregisterByPrefix,
    44144443    0,
    44154444    0,
     
    47594788    pdmR3DevHlp_CpuGetGuestMicroarch,
    47604789    pdmR3DevHlp_CpuGetGuestAddrWidths,
    4761     0,
     4790    pdmR3DevHlp_STAMDeregisterByPrefix,
    47624791    0,
    47634792    0,
     
    52645293    pdmR3DevHlp_CpuGetGuestMicroarch,
    52655294    pdmR3DevHlp_CpuGetGuestAddrWidths,
    5266     0,
     5295    pdmR3DevHlp_STAMDeregisterByPrefix,
    52675296    0,
    52685297    0,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette