VirtualBox

Changeset 77300 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 13, 2019 1:59:41 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128820
Message:

DevVGA,PCI,PGM: Hacks for making it possible to load saved states of the VBoxSVGA device with the 'wrong' BAR layout. bugref:9359

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r76553 r77300  
    12341234
    12351235/**
     1236 * @callback_method_impl{FNPCIIOREGIONSWAP}
     1237 */
     1238static DECLCALLBACK(int) devpciR3CommonRestoreSwapRegions(PPDMPCIDEV pPciDev, uint32_t iRegion, uint32_t iOtherRegion)
     1239{
     1240    AssertReturn(iRegion < iOtherRegion, VERR_INVALID_PARAMETER);
     1241    AssertLogRelReturn(iOtherRegion < RT_ELEMENTS(pPciDev->Int.s.aIORegions), VERR_INVALID_PARAMETER);
     1242    AssertReturn(pPciDev->Int.s.bPadding0 == (0xe0 | (uint8_t)iRegion), VERR_INVALID_PARAMETER);
     1243
     1244    PCIIOREGION Tmp = pPciDev->Int.s.aIORegions[iRegion];
     1245    pPciDev->Int.s.aIORegions[iRegion] = pPciDev->Int.s.aIORegions[iOtherRegion];
     1246    pPciDev->Int.s.aIORegions[iOtherRegion] = Tmp;
     1247
     1248    return VINF_SUCCESS;
     1249}
     1250
     1251
     1252/**
    12361253 * Checks for and deals with changes in resource sizes and types.
    12371254 *
     
    12601277                if (pPciDev->pfnRegionLoadChangeHookR3)
    12611278                {
     1279                    pPciDev->Int.s.bPadding0 = 0xe0 | (uint8_t)iRegion;
    12621280                    rc = pPciDev->pfnRegionLoadChangeHookR3(pPciDev->Int.s.pDevInsR3, pPciDev, iRegion, paIoRegions[iRegion].size,
    1263                                                             (PCIADDRESSSPACE)paIoRegions[iRegion].type, NULL /*pfnOldSetter*/);
     1281                                                            (PCIADDRESSSPACE)paIoRegions[iRegion].type, NULL /*pfnOldSetter*/,
     1282                                                            devpciR3CommonRestoreSwapRegions);
     1283                    pPciDev->Int.s.bPadding0 = 0;
    12641284                    if (RT_FAILURE(rc))
    12651285                        return SSMR3SetLoadError(pSSM, rc, RT_SRC_POS,
     
    12791299    {
    12801300        rc = pPciDev->pfnRegionLoadChangeHookR3(pPciDev->Int.s.pDevInsR3, pPciDev, UINT32_MAX, RTGCPHYS_MAX, (PCIADDRESSSPACE)-1,
    1281                                                 devpciR3CommonRestoreOldSetRegion);
     1301                                                devpciR3CommonRestoreOldSetRegion, NULL);
    12821302        if (RT_FAILURE(rc))
    12831303            return SSMR3SetLoadError(pSSM, rc, RT_SRC_POS,  N_("Device %s/%u failed to resize its resources: %Rrc"),
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