VirtualBox

Changeset 34207 in vbox


Ignore:
Timestamp:
Nov 19, 2010 3:31:50 PM (14 years ago)
Author:
vboxsync
Message:

pdmdrv: introduced PDMDrvHlpDBGFInfoRegister / PDMDrvHlpDBGFInfoDeregister

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmdrv.h

    r33540 r34207  
    985985
    986986    /**
     987     * Register an info handler with DBGF.
     988     *
     989     * @returns VBox status code.
     990     * @param   pDrvIns         Driver instance.
     991     * @param   pszName         Data unit name.
     992     * @param   pszDesc         The description of the info and any arguments
     993     *                          the handler may take.
     994     * @param   pfnHandler      The handler function to be called to display the
     995     *                          info.
     996     */
     997    DECLR3CALLBACKMEMBER(int, pfnDBGFInfoRegister,(PPDMDRVINS pDrvIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler));
     998
     999    /**
     1000     * Deregister an info handler from DBGF.
     1001     *
     1002     * @returns VBox status code.
     1003     * @param   pDrvIns         Driver instance.
     1004     * @param   pszName         Data unit name.
     1005     */
     1006    DECLR3CALLBACKMEMBER(int, pfnDBGFInfoDeregister,(PPDMDRVINS pDrvIns, const char *pszName));
     1007
     1008    /**
    9871009     * Registers a statistics sample if statistics are enabled.
    9881010     *
     
    14681490
    14691491/**
     1492 * @copydoc PDMDRVHLP::pfnDBGFInfoRegister
     1493 */
     1494DECLINLINE(int) PDMDrvHlpDBGFInfoRegister(PPDMDRVINS pDrvIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler)
     1495{
     1496    return pDrvIns->pHlpR3->pfnDBGFInfoRegister(pDrvIns, pszName, pszDesc, pfnHandler);
     1497}
     1498
     1499/**
     1500 * @copydoc PDMDRVHLP::pfnDBGFInfoDeregister
     1501 */
     1502DECLINLINE(int) PDMDrvHlpDBGFInfoDeregister(PPDMDRVINS pDrvIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler)
     1503{
     1504    return pDrvIns->pHlpR3->pfnDBGFInfoRegister(pDrvIns, pszName, pszDesc, pfnHandler);
     1505}
     1506
     1507/**
    14701508 * @copydoc PDMDRVHLP::pfnSTAMRegister
    14711509 */
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r32156 r34207  
    652652        AssertRC(rc);
    653653
     654        /* Info handlers. */
     655        rc = DBGFR3InfoDeregisterDriver(pVM, pCur, NULL);
     656        AssertRC(rc);
     657
    654658        /* PDM critsects. */
    655659        rc = pdmR3CritSectDeleteDriver(pVM, pCur);
     
    10311035
    10321036    LogFlow(("pdmR3DrvHlp_SSMDeregister: caller='%s'/%d: returns %Rrc\n", pDrvIns->pReg->szName, pDrvIns->iInstance, rc));
     1037    return rc;
     1038}
     1039
     1040
     1041/** @interface_method_impl{PDMDEVHLP,pfnDBGFInfoRegister} */
     1042static DECLCALLBACK(int) pdmR3DrvHlp_DBGFInfoRegister(PPDMDRVINS pDrvIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler)
     1043{
     1044    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1045    LogFlow(("pdmR3DrvHlp_DBGFInfoRegister: caller='%s'/%d: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p\n",
     1046             pDrvIns->pReg->szName, pDrvIns->iInstance, pszName, pszName, pszDesc, pszDesc, pfnHandler));
     1047
     1048    int rc = DBGFR3InfoRegisterDriver(pDrvIns->Internal.s.pVMR3, pszName, pszDesc, pfnHandler, pDrvIns);
     1049
     1050    LogFlow(("pdmR3DrvHlp_DBGFInfoRegister: caller='%s'/%d: returns %Rrc\n", pDrvIns->pReg->szName, pDrvIns->iInstance, rc));
     1051    return rc;
     1052}
     1053
     1054
     1055/** @interface_method_impl{PDMDEVHLP,pfnDBGFInfoDeregister} */
     1056static DECLCALLBACK(int) pdmR3DrvHlp_DBGFInfoDeregister(PPDMDRVINS pDrvIns, const char *pszName)
     1057{
     1058    PDMDRV_ASSERT_DRVINS(pDrvIns);
     1059    LogFlow(("pdmR3DrvHlp_DBGFInfoDeregister: caller='%s'/%d: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p\n",
     1060             pDrvIns->pReg->szName, pDrvIns->iInstance, pszName));
     1061
     1062    int rc = DBGFR3InfoDeregisterDriver(pDrvIns->Internal.s.pVMR3, pDrvIns, pszName);
     1063
     1064    LogFlow(("pdmR3DrvHlp_DBGFInfoDeregister: caller='%s'/%d: returns %Rrc\n", pDrvIns->pReg->szName, pDrvIns->iInstance, rc));
     1065
    10331066    return rc;
    10341067}
     
    13861419    pdmR3DrvHlp_SSMRegister,
    13871420    pdmR3DrvHlp_SSMDeregister,
     1421    pdmR3DrvHlp_DBGFInfoRegister,
     1422    pdmR3DrvHlp_DBGFInfoDeregister,
    13881423    pdmR3DrvHlp_STAMRegister,
    13891424    pdmR3DrvHlp_STAMRegisterF,
Note: See TracChangeset for help on using the changeset viewer.

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