VirtualBox

Ignore:
Timestamp:
Mar 13, 2020 1:02:08 PM (5 years ago)
Author:
vboxsync
Message:

PDMDevHlp,tstDevice: Create two more wrappers used by the graphics device to eliminate direct imports from the VMM library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r83263 r83281  
    732732
    733733
     734/** @interface_method_impl{PDMDEVHLPR3,pfnPGMHandlerPhysicalTypeRegister} */
     735static DECLCALLBACK(int) pdmR3DevHlp_PGMHandlerPhysicalTypeRegister(PPDMDEVINS pDevIns, PGMPHYSHANDLERKIND enmKind,
     736                                                                    R3PTRTYPE(PFNPGMPHYSHANDLER) pfnHandlerR3,
     737                                                                    const char *pszHandlerR0, const char *pszPfHandlerR0,
     738                                                                    const char *pszHandlerRC, const char *pszPfHandlerRC,
     739                                                                    const char *pszDesc, PPGMPHYSHANDLERTYPE phType)
     740{
     741    PDMDEV_ASSERT_DEVINS(pDevIns);
     742    PVM  pVM = pDevIns->Internal.s.pVMR3;
     743    LogFlow(("pdmR3DevHlp_PGMHandlerPhysicalTypeRegister: caller='%s'/%d: enmKind=%d pfnHandlerR3=%p pszHandlerR0=%p:{%s} pszPfHandlerR0=%p:{%s} pszHandlerRC=%p:{%s} pszPfHandlerRC=%p:{%s} pszDesc=%p:{%s} phType=%p\n",
     744             pDevIns->pReg->szName, pDevIns->iInstance, pfnHandlerR3,
     745             pszHandlerR0, pszHandlerR0, pszPfHandlerR0, pszPfHandlerR0,
     746             pszHandlerRC, pszHandlerRC, pszPfHandlerRC, pszPfHandlerRC,
     747             pszDesc, pszDesc, phType));
     748
     749    int rc = PGMR3HandlerPhysicalTypeRegister(pVM, enmKind, pfnHandlerR3,
     750                                              pDevIns->pReg->pszR0Mod, pszHandlerR0, pszPfHandlerR0,
     751                                              pDevIns->pReg->pszRCMod, pszHandlerRC, pszPfHandlerRC,
     752                                              pszDesc, phType);
     753
     754    Log(("pdmR3DevHlp_PGMHandlerPhysicalTypeRegister: caller='%s'/%d: returns %Rrc\n",
     755         pDevIns->pReg->szName, pDevIns->iInstance, rc));
     756    return rc;
     757}
     758
     759
    734760/** @interface_method_impl{PDMDEVHLPR3,pfnPhysRead} */
    735761static DECLCALLBACK(int) pdmR3DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
     
    920946
    921947    Log(("pdmR3DevHlp_PhysBulkReleasePageMappingLocks: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
     948}
     949
     950
     951/** @interface_method_impl{PDMDEVHLPR3,pfnCpuGetGuestMicroarch} */
     952static DECLCALLBACK(CPUMMICROARCH) pdmR3DevHlp_CpuGetGuestMicroarch(PPDMDEVINS pDevIns)
     953{
     954    PDMDEV_ASSERT_DEVINS(pDevIns);
     955    PVM pVM = pDevIns->Internal.s.pVMR3;
     956    LogFlow(("pdmR3DevHlp_CpuGetGuestMicroarch: caller='%s'/%d\n",
     957             pDevIns->pReg->szName, pDevIns->iInstance));
     958
     959    CPUMMICROARCH enmMicroarch = CPUMGetGuestMicroarch(pVM);
     960
     961    Log(("pdmR3DevHlp_CpuGetGuestMicroarch: caller='%s'/%d: returns %u\n", pDevIns->pReg->szName, pDevIns->iInstance, enmMicroarch));
     962    return enmMicroarch;
    922963}
    923964
     
    41944235    pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly,
    41954236    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
     4237    pdmR3DevHlp_CpuGetGuestMicroarch,
    41964238    0,
    41974239    0,
     
    42224264    pdmR3DevHlp_GetSupDrvSession,
    42234265    pdmR3DevHlp_QueryGenericUserObject,
     4266    pdmR3DevHlp_PGMHandlerPhysicalTypeRegister,
    42244267    PDM_DEVHLPR3_VERSION /* the end */
    42254268};
     
    43654408                            pDevIns->pReg->szName, pDevIns->iInstance, pUuid));
    43664409    return NULL;
     4410}
     4411
     4412
     4413/** @interface_method_impl{PDMDEVHLPR3,pfnPGMHandlerPhysicalTypeRegister} */
     4414static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PGMHandlerPhysicalTypeRegister(PPDMDEVINS pDevIns, PGMPHYSHANDLERKIND enmKind,
     4415                                                                              R3PTRTYPE(PFNPGMPHYSHANDLER) pfnHandlerR3,
     4416                                                                              const char *pszHandlerR0, const char *pszPfHandlerR0,
     4417                                                                              const char *pszHandlerRC, const char *pszPfHandlerRC,
     4418                                                                              const char *pszDesc, PPGMPHYSHANDLERTYPE phType)
     4419{
     4420    PDMDEV_ASSERT_DEVINS(pDevIns);
     4421    RT_NOREF(enmKind, pfnHandlerR3, pszHandlerR0, pszPfHandlerR0, pszHandlerRC, pszPfHandlerRC, pszDesc, phType);
     4422    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
     4423                            pDevIns->pReg->szName, pDevIns->iInstance));
     4424    return VERR_ACCESS_DENIED;
    43674425}
    43684426
     
    46794737    pdmR3DevHlp_PhysBulkGCPhys2CCPtrReadOnly,
    46804738    pdmR3DevHlp_PhysBulkReleasePageMappingLocks,
     4739    pdmR3DevHlp_CpuGetGuestMicroarch,
    46814740    0,
    46824741    0,
     
    47074766    pdmR3DevHlp_Untrusted_GetSupDrvSession,
    47084767    pdmR3DevHlp_Untrusted_QueryGenericUserObject,
     4768    pdmR3DevHlp_Untrusted_PGMHandlerPhysicalTypeRegister,
    47094769    PDM_DEVHLPR3_VERSION /* the end */
    47104770};
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