VirtualBox

Changeset 91968 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2021 3:52:28 PM (3 years ago)
Author:
vboxsync
Message:

VMM,Devices: Replace remaining direct calls to VBoxVMM with device and driver callbacks, bugref:10074

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r91897 r91968  
    16491649     * CPU frequencies.
    16501650     */
    1651     pThisCC->u64TscFrequency = TMCpuTicksPerSecond(PDMDevHlpGetVM(pDevIns));
     1651    pThisCC->u64TscFrequency = PDMDevHlpTMCpuTicksPerSecond(pDevIns);
    16521652    pThisCC->u64CpuFrequency = pThisCC->u64TscFrequency;
    1653     pThisCC->u64FsbFrequency = CPUMGetGuestScalableBusFrequency(PDMDevHlpGetVM(pDevIns));
     1653    pThisCC->u64FsbFrequency = PDMDevHlpCpuGetGuestScalableBusFrequency(pDevIns);
    16541654
    16551655    /*
  • trunk/src/VBox/Devices/GIMDev/GIMDev.cpp

    r82968 r91968  
    265265     * Get debug setup requirements from GIM.
    266266     */
    267     PVMCC pVM = PDMDevHlpGetVM(pDevIns);
    268     int rc = GIMR3GetDebugSetup(pVM, &pThis->DbgSetup);
     267    int rc = PDMDevHlpGIMGetDebugSetup(pDevIns, &pThis->DbgSetup);
    269268    if (   RT_SUCCESS(rc)
    270269        && pThis->DbgSetup.cbDbgRecvBuf > 0)
     
    336335     * Register this device with the GIM component.
    337336     */
    338     GIMR3GimDeviceRegister(pVM, pDevIns, pThis->DbgSetup.cbDbgRecvBuf ? &pThis->Dbg : NULL);
     337    PDMDevHlpGIMDeviceRegister(pDevIns, pThis->DbgSetup.cbDbgRecvBuf ? &pThis->Dbg : NULL);
    339338
    340339    /*
     
    343342/** @todo r=bird: consider ditching this as GIM doesn't actually make use of it */
    344343    uint32_t        cRegions  = 0;
    345     PGIMMMIO2REGION paRegions = GIMGetMmio2Regions(pVM, &cRegions);
     344    PGIMMMIO2REGION paRegions = PDMDevHlpGIMGetMmio2Regions(pDevIns, &cRegions);
    346345    if (   cRegions
    347346        && paRegions)
  • trunk/src/VBox/Devices/Makefile.kmk

    r91768 r91968  
    875875 VBoxDD_LIBS            += \
    876876        $(PATH_STAGE_LIB)/VgaDefBiosLogo$(VBOX_SUFF_LIB) \
    877         $(LIB_VMM) \
    878877        $(LIB_RUNTIME)
    879878 ifeq ($(KBUILD_TARGET),win)
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r91897 r91968  
    943943        pOEMSpecific->header.u8Length  = sizeof(*pOEMSpecific);
    944944        pOEMSpecific->header.u16Handle = 0x0008; /* Just next free handle */
    945         pOEMSpecific->u32CpuFreqKHz    = RT_H2LE_U32((uint32_t)((uint64_t)TMCpuTicksPerSecond(PDMDevHlpGetVM(pDevIns)) / 1000));
     945        pOEMSpecific->u32CpuFreqKHz    = RT_H2LE_U32((uint32_t)((uint64_t)PDMDevHlpTMCpuTicksPerSecond(pDevIns) / 1000));
    946946        DMI_TERM_STRUCT;
    947947
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r91960 r91968  
    754754
    755755
     756/** @interface_method_impl{PDMDEVHLPR3,pfnTMCpuTicksPerSecond} */
     757static DECLCALLBACK(uint64_t) pdmR3DevHlp_TMCpuTicksPerSecond(PPDMDEVINS pDevIns)
     758{
     759    PDMDEV_ASSERT_DEVINS(pDevIns);
     760    LogFlow(("pdmR3DevHlp_TMCpuTicksPerSecond: caller='%s'/%d\n",
     761             pDevIns->pReg->szName, pDevIns->iInstance));
     762
     763    uint64_t u64CpuTicksPerSec = TMCpuTicksPerSecond(pDevIns->Internal.s.pVMR3);
     764
     765    LogFlow(("pdmR3DevHlp_TMCpuTicksPerSecond: caller='%s'/%d: returns %RU64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64CpuTicksPerSec));
     766    return u64CpuTicksPerSec;
     767}
     768
     769
    756770/** @interface_method_impl{PDMDEVHLPR3,pfnGetSupDrvSession} */
    757771static DECLCALLBACK(PSUPDRVSESSION) pdmR3DevHlp_GetSupDrvSession(PPDMDEVINS pDevIns)
     
    11321146
    11331147    Log(("pdmR3DevHlp_CpuGetGuestAddrWidths: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
     1148}
     1149
     1150
     1151/** @interface_method_impl{PDMDEVHLPR3,pfnCpuGuestScalableBusFrequency} */
     1152static DECLCALLBACK(uint64_t) pdmR3DevHlp_CpuGetGuestScalableBusFrequency(PPDMDEVINS pDevIns)
     1153{
     1154    PDMDEV_ASSERT_DEVINS(pDevIns);
     1155    LogFlow(("pdmR3DevHlp_CpuGetGuestScalableBusFrequency: caller='%s'/%d\n",
     1156             pDevIns->pReg->szName, pDevIns->iInstance));
     1157
     1158    uint64_t u64Fsb = CPUMGetGuestScalableBusFrequency(pDevIns->Internal.s.pVMR3);
     1159
     1160    Log(("pdmR3DevHlp_CpuGetGuestScalableBusFrequency: caller='%s'/%d: returns %#RX64\n", pDevIns->pReg->szName, pDevIns->iInstance, u64Fsb));
     1161    return u64Fsb;
    11341162}
    11351163
     
    46704698
    46714699/** @interface_method_impl{PDMDEVHLPR3,pfnQueryLun} */
    4672 static DECLCALLBACK(int) pdmR3DevHlp_pfnQueryLun(PPDMDEVINS pDevIns, const char *pszDevice,
     4700static DECLCALLBACK(int) pdmR3DevHlp_QueryLun(PPDMDEVINS pDevIns, const char *pszDevice,
    46734701                                                 unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
    46744702{
    46754703    PDMDEV_ASSERT_DEVINS(pDevIns);
    46764704
    4677     LogFlow(("pdmR3DevHlp_pfnQueryLun: caller='%s'/%d: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
     4705    LogFlow(("pdmR3DevHlp_QueryLun: caller='%s'/%d: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
    46784706             pDevIns->pReg->szName, pDevIns->iInstance, pszDevice, pszDevice, iInstance, iLun, ppBase));
    46794707
    46804708    int rc = PDMR3QueryLun(pDevIns->Internal.s.pVMR3->pUVM, pszDevice, iInstance, iLun, ppBase);
    46814709
    4682     LogFlow(("pdmR3DevHlp_pfnQueryLun: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
    4683     return rc;
     4710    LogFlow(("pdmR3DevHlp_QueryLun: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     4711    return rc;
     4712}
     4713
     4714
     4715/** @interface_method_impl{PDMDEVHLPR3,pfnGIMDeviceRegister} */
     4716static DECLCALLBACK(void) pdmR3DevHlp_GIMDeviceRegister(PPDMDEVINS pDevIns, PGIMDEBUG pDbg)
     4717{
     4718    PDMDEV_ASSERT_DEVINS(pDevIns);
     4719
     4720    LogFlow(("pdmR3DevHlp_GIMDeviceRegister: caller='%s'/%d: pDbg=%p\n",
     4721             pDevIns->pReg->szName, pDevIns->iInstance, pDbg));
     4722
     4723    GIMR3GimDeviceRegister(pDevIns->Internal.s.pVMR3, pDevIns, pDbg);
     4724
     4725    LogFlow(("pdmR3DevHlp_GIMDeviceRegister: caller='%s'/%d: returns\n", pDevIns->pReg->szName, pDevIns->iInstance));
     4726}
     4727
     4728
     4729/** @interface_method_impl{PDMDEVHLPR3,pfnGIMGetDebugSetup} */
     4730static DECLCALLBACK(int) pdmR3DevHlp_GIMGetDebugSetup(PPDMDEVINS pDevIns, PGIMDEBUGSETUP pDbgSetup)
     4731{
     4732    PDMDEV_ASSERT_DEVINS(pDevIns);
     4733
     4734    LogFlow(("pdmR3DevHlp_GIMGetDebugSetup: caller='%s'/%d: pDbgSetup=%p\n",
     4735             pDevIns->pReg->szName, pDevIns->iInstance, pDbgSetup));
     4736
     4737    int rc = GIMR3GetDebugSetup(pDevIns->Internal.s.pVMR3, pDbgSetup);
     4738
     4739    LogFlow(("pdmR3DevHlp_GIMGetDebugSetup: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     4740    return rc;
     4741}
     4742
     4743
     4744/** @interface_method_impl{PDMDEVHLPR3,pfnGIMGetMmio2Regions} */
     4745static DECLCALLBACK(PGIMMMIO2REGION) pdmR3DevHlp_GIMGetMmio2Regions(PPDMDEVINS pDevIns, uint32_t *pcRegions)
     4746{
     4747    PDMDEV_ASSERT_DEVINS(pDevIns);
     4748
     4749    LogFlow(("pdmR3DevHlp_GIMGetMmio2Regions: caller='%s'/%d: pcRegions=%p\n",
     4750             pDevIns->pReg->szName, pDevIns->iInstance, pcRegions));
     4751
     4752    PGIMMMIO2REGION pRegion = GIMGetMmio2Regions(pDevIns->Internal.s.pVMR3, pcRegions);
     4753
     4754    LogFlow(("pdmR3DevHlp_GIMGetMmio2Regions: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pRegion));
     4755    return pRegion;
    46844756}
    46854757
     
    50285100    pdmR3DevHlp_CpuGetGuestMicroarch,
    50295101    pdmR3DevHlp_CpuGetGuestAddrWidths,
     5102    pdmR3DevHlp_CpuGetGuestScalableBusFrequency,
    50305103    pdmR3DevHlp_STAMDeregisterByPrefix,
    50315104    0,
     
    50545127    pdmR3DevHlp_TMTimeVirtGetFreq,
    50555128    pdmR3DevHlp_TMTimeVirtGetNano,
     5129    pdmR3DevHlp_TMCpuTicksPerSecond,
    50565130    pdmR3DevHlp_GetSupDrvSession,
    50575131    pdmR3DevHlp_QueryGenericUserObject,
     
    50675141    pdmR3DevHlp_SharedModuleGetPageState,
    50685142    pdmR3DevHlp_SharedModuleCheckAll,
    5069     pdmR3DevHlp_pfnQueryLun,
     5143    pdmR3DevHlp_QueryLun,
     5144    pdmR3DevHlp_GIMDeviceRegister,
     5145    pdmR3DevHlp_GIMGetDebugSetup,
     5146    pdmR3DevHlp_GIMGetMmio2Regions,
    50705147    PDM_DEVHLPR3_VERSION /* the end */
    50715148};
     
    54165493    pdmR3DevHlp_CpuGetGuestMicroarch,
    54175494    pdmR3DevHlp_CpuGetGuestAddrWidths,
     5495    pdmR3DevHlp_CpuGetGuestScalableBusFrequency,
    54185496    pdmR3DevHlp_STAMDeregisterByPrefix,
    54195497    0,
     
    54425520    pdmR3DevHlp_TMTimeVirtGetFreq,
    54435521    pdmR3DevHlp_TMTimeVirtGetNano,
     5522    pdmR3DevHlp_TMCpuTicksPerSecond,
    54445523    pdmR3DevHlp_GetSupDrvSession,
    54455524    pdmR3DevHlp_QueryGenericUserObject,
     
    54555534    pdmR3DevHlp_SharedModuleGetPageState,
    54565535    pdmR3DevHlp_SharedModuleCheckAll,
    5457     pdmR3DevHlp_pfnQueryLun,
     5536    pdmR3DevHlp_QueryLun,
     5537    pdmR3DevHlp_GIMDeviceRegister,
     5538    pdmR3DevHlp_GIMGetDebugSetup,
     5539    pdmR3DevHlp_GIMGetMmio2Regions,
    54585540    PDM_DEVHLPR3_VERSION /* the end */
    54595541};
     
    57325814
    57335815
    5734 /** @interface_method_impl{PDMDEVHLPR3,pfnQUeryLun} */
     5816/** @interface_method_impl{PDMDEVHLPR3,pfnQueryLun} */
    57355817static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_QueryLun(PPDMDEVINS pDevIns, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
    57365818{
     
    57405822                            pDevIns->pReg->szName, pDevIns->iInstance));
    57415823    return VERR_ACCESS_DENIED;
     5824}
     5825
     5826
     5827/** @interface_method_impl{PDMDEVHLPR3,pfnGIMDeviceRegister} */
     5828static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_GIMDeviceRegister(PPDMDEVINS pDevIns, PGIMDEBUG pDbg)
     5829{
     5830    PDMDEV_ASSERT_DEVINS(pDevIns);
     5831    RT_NOREF(pDbg);
     5832    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
     5833                            pDevIns->pReg->szName, pDevIns->iInstance));
     5834}
     5835
     5836
     5837/** @interface_method_impl{PDMDEVHLPR3,pfnGIMGetDebugSetup} */
     5838static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_GIMGetDebugSetup(PPDMDEVINS pDevIns, PGIMDEBUGSETUP pDbgSetup)
     5839{
     5840    PDMDEV_ASSERT_DEVINS(pDevIns);
     5841    RT_NOREF(pDbgSetup);
     5842    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
     5843                            pDevIns->pReg->szName, pDevIns->iInstance));
     5844    return VERR_ACCESS_DENIED;
     5845}
     5846
     5847
     5848/** @interface_method_impl{PDMDEVHLPR3,pfnGIMGetMmio2Regions} */
     5849static DECLCALLBACK(PGIMMMIO2REGION) pdmR3DevHlp_Untrusted_GIMGetMmio2Regions(PPDMDEVINS pDevIns, uint32_t *pcRegions)
     5850{
     5851    PDMDEV_ASSERT_DEVINS(pDevIns);
     5852    RT_NOREF(pcRegions);
     5853    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
     5854                            pDevIns->pReg->szName, pDevIns->iInstance));
     5855    return NULL;
    57425856}
    57435857
     
    60866200    pdmR3DevHlp_CpuGetGuestMicroarch,
    60876201    pdmR3DevHlp_CpuGetGuestAddrWidths,
     6202    pdmR3DevHlp_CpuGetGuestScalableBusFrequency,
    60886203    pdmR3DevHlp_STAMDeregisterByPrefix,
    60896204    0,
     
    61126227    pdmR3DevHlp_TMTimeVirtGetFreq,
    61136228    pdmR3DevHlp_TMTimeVirtGetNano,
     6229    pdmR3DevHlp_TMCpuTicksPerSecond,
    61146230    pdmR3DevHlp_Untrusted_GetSupDrvSession,
    61156231    pdmR3DevHlp_Untrusted_QueryGenericUserObject,
     
    61266242    pdmR3DevHlp_Untrusted_SharedModuleCheckAll,
    61276243    pdmR3DevHlp_Untrusted_QueryLun,
     6244    pdmR3DevHlp_Untrusted_GIMDeviceRegister,
     6245    pdmR3DevHlp_Untrusted_GIMGetDebugSetup,
     6246    pdmR3DevHlp_Untrusted_GIMGetMmio2Regions,
    61286247    PDM_DEVHLPR3_VERSION /* the end */
    61296248};
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