VirtualBox

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


Ignore:
Timestamp:
Oct 21, 2021 7:41:36 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147726
Message:

VMM,Devices: Eliminate direct calls to PGMR3SharedModule* APIs and introduce callbacks in the device helper callback table, bugref:10074

File:
1 edited

Legend:

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

    r91920 r91921  
    24242424
    24252425/** Current PDMDEVHLPR3 version number. */
    2426 #define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 53, 0)
     2426#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 54, 0)
    24272427
    24282428/**
     
    31403140
    31413141    /**
     3142     * Inflate or deflate a memory balloon
     3143     *
     3144     * @returns VBox status code.
     3145     * @param   pDevIns             The device instance.
     3146     * @param   fInflate            Inflate or deflate memory balloon
     3147     * @param   cPages              Number of pages to free
     3148     * @param   paPhysPage          Array of guest physical addresses
     3149     */
     3150    DECLR3CALLBACKMEMBER(int, pfnPhysChangeMemBalloon,(PPDMDEVINS pDevIns, bool fInflate, unsigned cPages, RTGCPHYS *paPhysPage));
     3151
     3152    /**
    31423153     * Allocate memory which is associated with current VM instance
    31433154     * and automatically freed on it's destruction.
     
    46674678     */
    46684679    DECLR3CALLBACKMEMBER(int, pfnVMMDeregisterPatchMemory, (PPDMDEVINS pDevIns, RTGCPTR GCPtrPatchMem, uint32_t cbPatchMem));
     4680
     4681    /**
     4682     * Registers a new shared module for the VM
     4683     *
     4684     * @returns VBox status code.
     4685     * @param   pDevIns             The device instance.
     4686     * @param   enmGuestOS          Guest OS type.
     4687     * @param   pszModuleName       Module name.
     4688     * @param   pszVersion          Module version.
     4689     * @param   GCBaseAddr          Module base address.
     4690     * @param   cbModule            Module size.
     4691     * @param   cRegions            Number of shared region descriptors.
     4692     * @param   paRegions           Shared region(s).
     4693     */
     4694    DECLR3CALLBACKMEMBER(int, pfnSharedModuleRegister,(PPDMDEVINS pDevIns, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion,
     4695                                                       RTGCPTR GCBaseAddr, uint32_t cbModule,
     4696                                                       uint32_t cRegions, VMMDEVSHAREDREGIONDESC const *paRegions));
     4697
     4698    /**
     4699     * Unregisters a shared module for the VM
     4700     *
     4701     * @returns VBox status code.
     4702     * @param   pDevIns             The device instance.
     4703     * @param   pszModuleName       Module name.
     4704     * @param   pszVersion          Module version.
     4705     * @param   GCBaseAddr          Module base address.
     4706     * @param   cbModule            Module size.
     4707     */
     4708    DECLR3CALLBACKMEMBER(int, pfnSharedModuleUnregister,(PPDMDEVINS pDevIns, char *pszModuleName, char *pszVersion,
     4709                                                         RTGCPTR GCBaseAddr, uint32_t cbModule));
     4710
     4711    /**
     4712     * Query the state of a page in a shared module
     4713     *
     4714     * @returns VBox status code.
     4715     * @param   pVM                 The cross context VM structure.
     4716     * @param   GCPtrPage           Page address.
     4717     * @param   pfShared            Shared status (out).
     4718     * @param   pfPageFlags         Page flags (out).
     4719     */
     4720    DECLR3CALLBACKMEMBER(int, pfnSharedModuleGetPageState, (PPDMDEVINS pDevIns, RTGCPTR GCPtrPage, bool *pfShared, uint64_t *pfPageFlags));
     4721
     4722    /**
     4723     * Check all registered modules for changes.
     4724     *
     4725     * @returns VBox status code.
     4726     * @param   pDevIns             The device instance.
     4727     */
     4728    DECLR3CALLBACKMEMBER(int, pfnSharedModuleCheckAll,(PPDMDEVINS pDevIns));
    46694729
    46704730    /** @} */
     
    67596819{
    67606820    return pDevIns->CTX_SUFF(pHlp)->pfnPhysIsGCPhysNormal(pDevIns, GCPhys);
     6821}
     6822
     6823/**
     6824 * @copydoc PDMDEVHLPR3::pfnPhysChangeMemBalloon
     6825 */
     6826DECLINLINE(int) PDMDevHlpPhysChangeMemBalloon(PPDMDEVINS pDevIns, bool fInflate, unsigned cPages, RTGCPHYS *paPhysPage)
     6827{
     6828    return pDevIns->CTX_SUFF(pHlp)->pfnPhysChangeMemBalloon(pDevIns, fInflate, cPages, paPhysPage);
    67616829}
    67626830
     
    88518919}
    88528920
     8921/**
     8922 * @copydoc PDMDEVHLPR3::pfnSharedModuleRegister
     8923 */
     8924DECLINLINE(int) PDMDevHlpSharedModuleRegister(PPDMDEVINS pDevIns, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion,
     8925                                              RTGCPTR GCBaseAddr, uint32_t cbModule,
     8926                                              uint32_t cRegions, VMMDEVSHAREDREGIONDESC const *paRegions)
     8927{
     8928    return pDevIns->pHlpR3->pfnSharedModuleRegister(pDevIns, enmGuestOS, pszModuleName, pszVersion,
     8929                                                    GCBaseAddr, cbModule, cRegions, paRegions);
     8930}
     8931
     8932/**
     8933 * @copydoc PDMDEVHLPR3::pfnSharedModuleUnregister
     8934 */
     8935DECLINLINE(int) PDMDevHlpSharedModuleUnregister(PPDMDEVINS pDevIns, char *pszModuleName, char *pszVersion,
     8936                                                RTGCPTR GCBaseAddr, uint32_t cbModule)
     8937{
     8938    return pDevIns->pHlpR3->pfnSharedModuleUnregister(pDevIns, pszModuleName, pszVersion, GCBaseAddr, cbModule);
     8939}
     8940
     8941/**
     8942 * @copydoc PDMDEVHLPR3::pfnSharedModuleGetPageState
     8943 */
     8944DECLINLINE(int) PDMDevHlpSharedModuleGetPageState(PPDMDEVINS pDevIns, RTGCPTR GCPtrPage, bool *pfShared,
     8945                                                  uint64_t *pfPageFlags)
     8946{
     8947    return pDevIns->pHlpR3->pfnSharedModuleGetPageState(pDevIns, GCPtrPage, pfShared, pfPageFlags);
     8948}
     8949
     8950/**
     8951 * @copydoc PDMDEVHLPR3::pfnSharedModuleCheckAll
     8952 */
     8953DECLINLINE(int) PDMDevHlpSharedModuleCheckAll(PPDMDEVINS pDevIns)
     8954{
     8955    return pDevIns->pHlpR3->pfnSharedModuleCheckAll(pDevIns);
     8956}
     8957
    88538958/** Wrapper around SSMR3GetU32 for simplifying getting enum values saved as uint32_t. */
    88548959# define PDMDEVHLP_SSM_GET_ENUM32_RET(a_pHlp, a_pSSM, a_enmDst, a_EnumType) \
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