VirtualBox

Changeset 91960 in vbox for trunk/src


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

VMM,DevPciBios: Add helper callback for PDMR3QueryLun and make use of it, also replace CPUMGetGuestMicroarch with PDMDevHlpCpuGetGuestMicroarch, bugref:10074

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r91897 r91960  
    769769    uint32_t        u32;
    770770    unsigned        i;
    771     PUVM            pUVM = PDMDevHlpGetUVM(pDevIns); AssertRelease(pUVM);
    772771    PPDMIMEDIA      apHDs[4] = {0};
    773772    LogFlow(("pcbiosInitComplete:\n"));
     
    862861    {
    863862        PPDMIBASE pBase;
    864         int rc = PDMR3QueryLun(pUVM, pThis->pszFDDevice, 0, i, &pBase);
     863        int rc = PDMDevHlpQueryLun(pDevIns, pThis->pszFDDevice, 0, i, &pBase);
    865864        if (RT_SUCCESS(rc))
    866865        {
     
    904903    {
    905904        PPDMIBASE pBase;
    906         int rc = PDMR3QueryLun(pUVM, pThis->pszHDDevice, 0, i, &pBase);
     905        int rc = PDMDevHlpQueryLun(pDevIns, pThis->pszHDDevice, 0, i, &pBase);
    907906        if (RT_SUCCESS(rc))
    908907            apHDs[i] = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIA);
     
    965964        {
    966965            PPDMIBASE pBase;
    967             int rc = PDMR3QueryLun(pUVM, pThis->pszSataDevice, 0, pThis->iSataHDLUN[i], &pBase);
     966            int rc = PDMDevHlpQueryLun(pDevIns, pThis->pszSataDevice, 0, pThis->iSataHDLUN[i], &pBase);
    968967            if (RT_SUCCESS(rc))
    969968                apHDs[i] = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIA);
     
    10191018        {
    10201019            PPDMIBASE pBase;
    1021             int rc = PDMR3QueryLun(pUVM, pThis->pszScsiDevice, 0, pThis->iScsiHDLUN[i], &pBase);
     1020            int rc = PDMDevHlpQueryLun(pDevIns, pThis->pszScsiDevice, 0, pThis->iScsiHDLUN[i], &pBase);
    10221021            if (RT_SUCCESS(rc))
    10231022                apHDs[i] = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIA);
     
    15011500     * Get the CPU arch so we can load the appropriate ROMs.
    15021501     */
    1503     PVM pVM = PDMDevHlpGetVM(pDevIns);
    1504     CPUMMICROARCH const enmMicroarch = pVM ? CPUMGetGuestMicroarch(pVM) : kCpumMicroarch_Intel_P6;
     1502    CPUMMICROARCH const enmMicroarch = pVM ? PDMDevHlpCpuGetGuestMicroarch(pDevIns) : kCpumMicroarch_Intel_P6;
    15051503
    15061504    if (pThis->pszPcBiosFile)
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r91944 r91960  
    46654665
    46664666    LogFlow(("pdmR3DevHlp_SharedModuleCheckAll: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     4667    return rc;
     4668}
     4669
     4670
     4671/** @interface_method_impl{PDMDEVHLPR3,pfnQueryLun} */
     4672static DECLCALLBACK(int) pdmR3DevHlp_pfnQueryLun(PPDMDEVINS pDevIns, const char *pszDevice,
     4673                                                 unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     4674{
     4675    PDMDEV_ASSERT_DEVINS(pDevIns);
     4676
     4677    LogFlow(("pdmR3DevHlp_pfnQueryLun: caller='%s'/%d: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
     4678             pDevIns->pReg->szName, pDevIns->iInstance, pszDevice, pszDevice, iInstance, iLun, ppBase));
     4679
     4680    int rc = PDMR3QueryLun(pDevIns->Internal.s.pVMR3->pUVM, pszDevice, iInstance, iLun, ppBase);
     4681
     4682    LogFlow(("pdmR3DevHlp_pfnQueryLun: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
    46674683    return rc;
    46684684}
     
    50515067    pdmR3DevHlp_SharedModuleGetPageState,
    50525068    pdmR3DevHlp_SharedModuleCheckAll,
     5069    pdmR3DevHlp_pfnQueryLun,
    50535070    PDM_DEVHLPR3_VERSION /* the end */
    50545071};
     
    54385455    pdmR3DevHlp_SharedModuleGetPageState,
    54395456    pdmR3DevHlp_SharedModuleCheckAll,
     5457    pdmR3DevHlp_pfnQueryLun,
    54405458    PDM_DEVHLPR3_VERSION /* the end */
    54415459};
     
    57085726{
    57095727    PDMDEV_ASSERT_DEVINS(pDevIns);
     5728    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
     5729                            pDevIns->pReg->szName, pDevIns->iInstance));
     5730    return VERR_ACCESS_DENIED;
     5731}
     5732
     5733
     5734/** @interface_method_impl{PDMDEVHLPR3,pfnQUeryLun} */
     5735static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_QueryLun(PPDMDEVINS pDevIns, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     5736{
     5737    PDMDEV_ASSERT_DEVINS(pDevIns);
     5738    RT_NOREF(pszDevice, iInstance, iLun, ppBase);
    57105739    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n",
    57115740                            pDevIns->pReg->szName, pDevIns->iInstance));
     
    60966125    pdmR3DevHlp_Untrusted_SharedModuleGetPageState,
    60976126    pdmR3DevHlp_Untrusted_SharedModuleCheckAll,
     6127    pdmR3DevHlp_Untrusted_QueryLun,
    60986128    PDM_DEVHLPR3_VERSION /* the end */
    60996129};
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