VirtualBox

Changeset 91944 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Oct 21, 2021 1:02:36 PM (3 years ago)
Author:
vboxsync
Message:

VMM,Devices: Eliminate direct calls to DBGFR3* and use the device helper callbacks, bugref:10074

File:
1 edited

Legend:

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

    r91935 r91944  
    24242424
    24252425/** Current PDMDEVHLPR3 version number. */
    2426 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 57, 0)
     2426#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 58, 0)
    24272427
    24282428/**
     
    34513451
    34523452    /**
     3453     * Report a bug check.
     3454     *
     3455     * @returns
     3456     * @param   pDevIns             The device instance.
     3457     * @param   enmEvent            The kind of BSOD event this is.
     3458     * @param   uBugCheck           The bug check number.
     3459     * @param   uP1                 The bug check parameter \#1.
     3460     * @param   uP2                 The bug check parameter \#2.
     3461     * @param   uP3                 The bug check parameter \#3.
     3462     * @param   uP4                 The bug check parameter \#4.
     3463     *
     3464     * @thread EMT
     3465     */
     3466    DECLR3CALLBACKMEMBER(VBOXSTRICTRC, pfnDBGFReportBugCheck,(PPDMDEVINS pDevIns, DBGFEVENTTYPE enmEvent, uint64_t uBugCheck,
     3467                                                              uint64_t uP1, uint64_t uP2, uint64_t uP3, uint64_t uP4));
     3468
     3469    /**
     3470     * Write core dump of the guest.
     3471     *
     3472     * @returns VBox status code.
     3473     * @param   pDevIns             The device instance.
     3474     * @param   pszFilename         The name of the file to which the guest core
     3475     *                              dump should be written.
     3476     * @param   fReplaceFile        Whether to replace the file or not.
     3477     *
     3478     * @remarks The VM may need to be suspended before calling this function in
     3479     *          order to truly stop all device threads and drivers. This function
     3480     *          only synchronizes EMTs.
     3481     */
     3482    DECLR3CALLBACKMEMBER(int, pfnDBGFCoreWrite,(PPDMDEVINS pDevIns, const char *pszFilename, bool fReplaceFile));
     3483
     3484    /**
     3485     * Gets the logger info helper.
     3486     * The returned info helper will unconditionally write all output to the log.
     3487     *
     3488     * @returns Pointer to the logger info helper.
     3489     * @param   pDevIns             The device instance.
     3490     */
     3491    DECLR3CALLBACKMEMBER(PCDBGFINFOHLP, pfnDBGFInfoLogHlp,(PPDMDEVINS pDevIns));
     3492
     3493    /**
     3494     * Queries a 64-bit register value.
     3495     *
     3496     * @retval  VINF_SUCCESS
     3497     * @retval  VERR_INVALID_VM_HANDLE
     3498     * @retval  VERR_INVALID_CPU_ID
     3499     * @retval  VERR_DBGF_REGISTER_NOT_FOUND
     3500     * @retval  VERR_DBGF_UNSUPPORTED_CAST
     3501     * @retval  VINF_DBGF_TRUNCATED_REGISTER
     3502     * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
     3503     *
     3504     * @param   pDevIns             The device instance.
     3505     * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
     3506     *                              applicable.  Can be OR'ed with
     3507     *                              DBGFREG_HYPER_VMCPUID.
     3508     * @param   pszReg              The register that's being queried.  Except for
     3509     *                              CPU registers, this must be on the form
     3510     *                              "set.reg[.sub]".
     3511     * @param   pu64                Where to store the register value.
     3512     */
     3513    DECLR3CALLBACKMEMBER(int, pfnDBGFRegNmQueryU64,(PPDMDEVINS pDevIns, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64));
     3514
     3515    /**
     3516     * Format a set of registers.
     3517     *
     3518     * This is restricted to registers from one CPU, that specified by @a idCpu.
     3519     *
     3520     * @returns VBox status code.
     3521     * @param   pDevIns             The device instance.
     3522     * @param   idCpu               The CPU ID of any CPU registers that may be
     3523     *                              printed, pass VMCPUID_ANY if not applicable.
     3524     * @param   pszBuf              The output buffer.
     3525     * @param   cbBuf               The size of the output buffer.
     3526     * @param   pszFormat           The format string.  Register names are given by
     3527     *                              %VR{name}, they take no arguments.
     3528     * @param   va                  Other format arguments.
     3529     */
     3530    DECLR3CALLBACKMEMBER(int, pfnDBGFRegPrintfV,(PPDMDEVINS pDevIns, VMCPUID idCpu, char *pszBuf, size_t cbBuf,
     3531                                                 const char *pszFormat, va_list va));
     3532
     3533    /**
    34533534     * Registers a statistics sample.
    34543535     *
     
    73447425
    73457426/**
     7427 * @copydoc PDMDEVHLPR3::pfnDBGFReportBugCheck
     7428 */
     7429DECLINLINE(VBOXSTRICTRC) PDMDevHlpDBGFReportBugCheck(PPDMDEVINS pDevIns, DBGFEVENTTYPE enmEvent, uint64_t uBugCheck,
     7430                                                     uint64_t uP1, uint64_t uP2, uint64_t uP3, uint64_t uP4)
     7431{
     7432    return pDevIns->pHlpR3->pfnDBGFReportBugCheck(pDevIns, enmEvent, uBugCheck, uP1, uP2, uP3, uP4);
     7433}
     7434
     7435/**
     7436 * @copydoc PDMDEVHLPR3::pfnDBGFCoreWrite
     7437 */
     7438DECLINLINE(int) PDMDevHlpDBGFCoreWrite(PPDMDEVINS pDevIns, const char *pszFilename, bool fReplaceFile)
     7439{
     7440    return pDevIns->pHlpR3->pfnDBGFCoreWrite(pDevIns, pszFilename, fReplaceFile);
     7441}
     7442
     7443/**
     7444 * @copydoc PDMDEVHLPR3::pfnDBGFInfoLogHlp
     7445 */
     7446DECLINLINE(PCDBGFINFOHLP) PDMDevHlpDBGFInfoLogHlp(PPDMDEVINS pDevIns)
     7447{
     7448    return pDevIns->pHlpR3->pfnDBGFInfoLogHlp(pDevIns);
     7449}
     7450
     7451/**
     7452 * @copydoc PDMDEVHLPR3::pfnDBGFRegNmQueryU64
     7453 */
     7454DECLINLINE(int) PDMDevHlpDBGFRegNmQueryU64(PPDMDEVINS pDevIns, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
     7455{
     7456    return pDevIns->pHlpR3->pfnDBGFRegNmQueryU64(pDevIns, idDefCpu, pszReg, pu64);
     7457}
     7458
     7459    /**
     7460     * Format a set of registers.
     7461     *
     7462     * This is restricted to registers from one CPU, that specified by @a idCpu.
     7463     *
     7464     * @returns VBox status code.
     7465     * @param   pDevIns             The device instance.
     7466     * @param   idCpu               The CPU ID of any CPU registers that may be
     7467     *                              printed, pass VMCPUID_ANY if not applicable.
     7468     * @param   pszBuf              The output buffer.
     7469     * @param   cbBuf               The size of the output buffer.
     7470     * @param   pszFormat           The format string.  Register names are given by
     7471     *                              %VR{name}, they take no arguments.
     7472     * @param   ...                 Argument list.
     7473     */
     7474DECLINLINE(int) RT_IPRT_FORMAT_ATTR(4, 5) PDMDevHlpDBGFRegPrintf(PPDMDEVINS pDevIns, VMCPUID idCpu, char *pszBuf, size_t cbBuf,
     7475                                                                 const char *pszFormat, ...)
     7476{
     7477    va_list Args;
     7478    va_start(Args, pszFormat);
     7479    int rc = pDevIns->pHlpR3->pfnDBGFRegPrintfV(pDevIns, idCpu, pszBuf, cbBuf, pszFormat, Args);
     7480    va_end(Args);
     7481    return rc;
     7482}
     7483
     7484/**
    73467485 * @copydoc PDMDEVHLPR3::pfnSTAMRegister
    73477486 */
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