VirtualBox

Changeset 100766 in vbox for trunk


Ignore:
Timestamp:
Aug 1, 2023 10:58:33 AM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158637
Message:

Devices/Bus/DevPciGenericEcam: Fixes for saved state loading, need to save and restore the PCI interrupt levels of course, bugref:10445

Location:
trunk/src/VBox/Devices/Bus
Files:
2 edited

Legend:

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

    r99823 r100766  
    6060*   Defined Constants And Macros                                                                                                 *
    6161*********************************************************************************************************************************/
     62/** @todo As this shares a lot of code with the ICH9 PCI device we have to also keep the saved state version in sync. */
    6263/** Saved state version of the generic ECAM PCI bus device. */
    63 #define VBOX_PCIGENECAM_SAVED_STATE_VERSION             1
     64#define VBOX_PCIGENECAM_SAVED_STATE_VERSION             VBOX_ICH9PCI_SAVED_STATE_VERSION_4KB_CFG_SPACE
     65/** 4KB config space */
     66#define VBOX_ICH9PCI_SAVED_STATE_VERSION_4KB_CFG_SPACE  4
    6467
    6568
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r99775 r100766  
    11631163     * Save IRQ states.
    11641164     */
    1165     for (unsigned i = 0; i < RT_ELEMENTS(pThis->auPciApicIrqLevels); i++)
    1166         pHlp->pfnSSMPutU32(pSSM, pThis->auPciApicIrqLevels[i]);
     1165    if (pThis->PciBus.enmType == DEVPCIBUSTYPE_ICH9)
     1166    {
     1167        for (unsigned i = 0; i < RT_ELEMENTS(pThis->auPciApicIrqLevels); i++)
     1168            pHlp->pfnSSMPutU32(pSSM, pThis->auPciApicIrqLevels[i]);
     1169    }
     1170    else if (pThis->PciBus.enmType == DEVPCIBUSTYPE_GENERIC_ECAM)
     1171    {
     1172        for (unsigned i = 0; i < RT_ELEMENTS(pThis->u.GenericEcam.auPciIrqLevels); i++)
     1173            pHlp->pfnSSMPutU32(pSSM, pThis->u.GenericEcam.auPciIrqLevels[i]);
     1174    }
     1175    else
     1176        AssertReleaseFailed();
    11671177
    11681178    pHlp->pfnSSMPutU32(pSSM, UINT32_MAX);  /* separator */
     
    17451755     * Load IRQ states.
    17461756     */
    1747     for (unsigned i = 0; i < RT_ELEMENTS(pThis->auPciApicIrqLevels); i++)
    1748         pHlp->pfnSSMGetU32V(pSSM, &pThis->auPciApicIrqLevels[i]);
     1757    if (pThis->PciBus.enmType == DEVPCIBUSTYPE_ICH9)
     1758    {
     1759        for (unsigned i = 0; i < RT_ELEMENTS(pThis->auPciApicIrqLevels); i++)
     1760            pHlp->pfnSSMGetU32V(pSSM, &pThis->auPciApicIrqLevels[i]);
     1761    }
     1762    else if (pThis->PciBus.enmType == DEVPCIBUSTYPE_GENERIC_ECAM)
     1763    {
     1764        for (unsigned i = 0; i < RT_ELEMENTS(pThis->u.GenericEcam.auPciIrqLevels); i++)
     1765            pHlp->pfnSSMGetU32V(pSSM, &pThis->u.GenericEcam.auPciIrqLevels[i]);
     1766    }
     1767    else
     1768        AssertReleaseFailed();
    17491769
    17501770    /* separator */
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