VirtualBox

Changeset 91930 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2021 10:12:30 AM (3 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r91928 r91930  
    632632            if (pThis->fRemappedVGA)
    633633            {
    634                 IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     634                PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    635635                pThis->fRemappedVGA = false;
    636636            }
     
    671671            if (pThis->fRemappedVGA)
    672672            {
    673                 IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     673                PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    674674                pThis->fRemappedVGA = false;
    675675            }
     
    928928            if (pThis->fRemappedVGA)
    929929            {
    930                 IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     930                PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    931931                pThis->fRemappedVGA = false;
    932932            }
     
    10371037            if (pThis->fRemappedVGA)
    10381038            {
    1039                 IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     1039                PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    10401040                pThis->fRemappedVGA = false;
    10411041            }
     
    11381138            /** @todo only allow read access (doesn't work now) */
    11391139            STAM_COUNTER_INC(&pThis->StatMapPage);
    1140             IOMMmioMapMmio2Page(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
    1141                                 pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
     1140            PDMDevHlpMmioMapMmio2Page(pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
     1141                                      pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
    11421142            /* Set as dirty as write accesses won't be noticed now. */
    11431143            vgaR3MarkDirty(pThis, addr);
     
    12461246            {
    12471247                STAM_COUNTER_INC(&pThis->StatMapPage);
    1248                 IOMMmioMapMmio2Page(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
    1249                                     pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
     1248                PDMDevHlpMmioMapMmio2Page(pDevIns, pThis->hMmioLegacy, GCPhys - 0xa0000,
     1249                                          pThis->hMmio2VRam, addr, X86_PTE_RW | X86_PTE_P);
    12501250                pThis->fRemappedVGA = true;
    12511251            }
     
    47924792    if (pThis->fRemappedVGA)
    47934793    {
    4794         IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     4794        PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    47954795        pThis->fRemappedVGA = false;
    47964796    }
     
    48204820    if (pThis->fRemappedVGA)
    48214821    {
    4822         IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     4822        PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    48234823        pThis->fRemappedVGA = false;
    48244824    }
     
    60606060    if (pThis->fRemappedVGA)
    60616061    {
    6062         IOMMmioResetRegion(PDMDevHlpGetVM(pDevIns), pDevIns, pThis->hMmioLegacy);
     6062        PDMDevHlpMmioResetRegion(pDevIns, pThis->hMmioLegacy);
    60636063        pThis->fRemappedVGA = false;
    60646064    }
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r91928 r91930  
    13291329
    13301330    Log(("pdmR0DevHlp_PGMHandlerPhysicalPageTempOff: caller='%s'/%d: returns %Rrc\n",
     1331         pDevIns->pReg->szName, pDevIns->iInstance, rc));
     1332    return rc;
     1333}
     1334
     1335
     1336/** @interface_method_impl{PDMDEVHLPR0,pfnMmioMapMmio2Page} */
     1337static DECLCALLBACK(int) pdmR0DevHlp_MmioMapMmio2Page(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     1338                                                      uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
     1339{
     1340    PDMDEV_ASSERT_DEVINS(pDevIns);
     1341    LogFlow(("pdmR0DevHlp_MmioMapMmio2Page: caller='%s'/%d: hRegion=%RX64 offRegion=%RGp hMmio2=%RX64 offMmio2=%RGp fPageFlags=%RX64\n",
     1342             pDevIns->pReg->szName, pDevIns->iInstance, hRegion, offRegion, hMmio2, offMmio2, fPageFlags));
     1343
     1344    int rc = IOMMmioMapMmio2Page(pDevIns->Internal.s.pGVM, pDevIns, hRegion, offRegion, hMmio2, offMmio2, fPageFlags);
     1345
     1346    Log(("pdmR0DevHlp_MmioMapMmio2Page: caller='%s'/%d: returns %Rrc\n",
     1347         pDevIns->pReg->szName, pDevIns->iInstance, rc));
     1348    return rc;
     1349}
     1350
     1351
     1352/** @interface_method_impl{PDMDEVHLPR0,pfnMmioResetRegion} */
     1353static DECLCALLBACK(int) pdmR0DevHlp_MmioResetRegion(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
     1354{
     1355    PDMDEV_ASSERT_DEVINS(pDevIns);
     1356    LogFlow(("pdmR0DevHlp_MmioResetRegion: caller='%s'/%d: hRegion=%RX64\n",
     1357             pDevIns->pReg->szName, pDevIns->iInstance, hRegion));
     1358
     1359    int rc = IOMMmioResetRegion(pDevIns->Internal.s.pGVM, pDevIns, hRegion);
     1360
     1361    Log(("pdmR0DevHlp_MmioResetRegion: caller='%s'/%d: returns %Rrc\n",
    13311362         pDevIns->pReg->szName, pDevIns->iInstance, rc));
    13321363    return rc;
     
    14271458    pdmR0DevHlp_HpetSetUpContext,
    14281459    pdmR0DevHlp_PGMHandlerPhysicalPageTempOff,
     1460    pdmR0DevHlp_MmioMapMmio2Page,
     1461    pdmR0DevHlp_MmioResetRegion,
    14291462    NULL /*pfnReserved1*/,
    14301463    NULL /*pfnReserved2*/,
     
    15351568    pdmR0DevHlp_HpetSetUpContext,
    15361569    pdmR0DevHlp_PGMHandlerPhysicalPageTempOff,
     1570    pdmR0DevHlp_MmioMapMmio2Page,
     1571    pdmR0DevHlp_MmioResetRegion,
    15371572    NULL /*pfnReserved1*/,
    15381573    NULL /*pfnReserved2*/,
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r91928 r91930  
    351351
    352352    LogFlow(("pdmR3DevHlp_Mmio2ChangeRegionNo: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     353    return rc;
     354}
     355
     356
     357/** @interface_method_impl{PDMDEVHLPR3,pfnMmioMapMmio2Page} */
     358static DECLCALLBACK(int) pdmR3DevHlp_MmioMapMmio2Page(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion, RTGCPHYS offRegion,
     359                                                      uint64_t hMmio2, RTGCPHYS offMmio2, uint64_t fPageFlags)
     360{
     361    PDMDEV_ASSERT_DEVINS(pDevIns);
     362    LogFlow(("pdmR3DevHlp_MmioMapMmio2Page: caller='%s'/%d: hRegion=%RX64 offRegion=%RGp hMmio2=%RX64 offMmio2=%RGp fPageFlags=%RX64\n",
     363             pDevIns->pReg->szName, pDevIns->iInstance, hRegion, offRegion, hMmio2, offMmio2, fPageFlags));
     364
     365    int rc = IOMMmioMapMmio2Page(pDevIns->Internal.s.pVMR3, pDevIns, hRegion, offRegion, hMmio2, offMmio2, fPageFlags);
     366
     367    Log(("pdmR3DevHlp_MmioMapMmio2Page: caller='%s'/%d: returns %Rrc\n",
     368         pDevIns->pReg->szName, pDevIns->iInstance, rc));
     369    return rc;
     370}
     371
     372
     373/** @interface_method_impl{PDMDEVHLPR3,pfnMmioResetRegion} */
     374static DECLCALLBACK(int) pdmR3DevHlp_MmioResetRegion(PPDMDEVINS pDevIns, IOMMMIOHANDLE hRegion)
     375{
     376    PDMDEV_ASSERT_DEVINS(pDevIns);
     377    LogFlow(("pdmR3DevHlp_MmioResetRegion: caller='%s'/%d: hRegion=%RX64\n",
     378             pDevIns->pReg->szName, pDevIns->iInstance, hRegion));
     379
     380    int rc = IOMMmioResetRegion(pDevIns->Internal.s.pVMR3, pDevIns, hRegion);
     381
     382    Log(("pdmR3DevHlp_MmioResetRegion: caller='%s'/%d: returns %Rrc\n",
     383         pDevIns->pReg->szName, pDevIns->iInstance, rc));
    353384    return rc;
    354385}
     
    45664597    pdmR3DevHlp_Mmio2GetMappingAddress,
    45674598    pdmR3DevHlp_Mmio2ChangeRegionNo,
     4599    pdmR3DevHlp_MmioMapMmio2Page,
     4600    pdmR3DevHlp_MmioResetRegion,
    45684601    pdmR3DevHlp_ROMRegister,
    45694602    pdmR3DevHlp_ROMProtectShadow,
     
    49454978    pdmR3DevHlp_Mmio2GetMappingAddress,
    49464979    pdmR3DevHlp_Mmio2ChangeRegionNo,
     4980    pdmR3DevHlp_MmioMapMmio2Page,
     4981    pdmR3DevHlp_MmioResetRegion,
    49474982    pdmR3DevHlp_ROMRegister,
    49484983    pdmR3DevHlp_ROMProtectShadow,
     
    55955630    pdmR3DevHlp_Mmio2GetMappingAddress,
    55965631    pdmR3DevHlp_Mmio2ChangeRegionNo,
     5632    pdmR3DevHlp_MmioMapMmio2Page,
     5633    pdmR3DevHlp_MmioResetRegion,
    55975634    pdmR3DevHlp_ROMRegister,
    55985635    pdmR3DevHlp_ROMProtectShadow,
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