VirtualBox

Changeset 82215 in vbox


Ignore:
Timestamp:
Nov 26, 2019 3:03:45 AM (5 years ago)
Author:
vboxsync
Message:

DevPCNet: Convered the temp MMIO2 region we create when loading old old saved states. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r82147 r82215  
    397397    /** Emulated device type. */
    398398    uint8_t                             uDevType;
    399     /** Backwards compatible shared memory region during state loading. */
    400     bool                                fSharedRegion;
    401     bool                                afAlignment5[2];
     399    bool                                afAlignment5[3];
    402400    /** Link speed to be reported through CSR68. */
    403401    uint32_t                            u32LinkSpeed;
     
    418416    /** ISA I/O ports offset 0x00-0x0f. */
    419417    IOMIOPORTHANDLE                     hIoPortsIsaAProm;
     418
     419    /** Backwards compatible shared memory region during state loading (before 4.3.6). */
     420    PGMMMIO2HANDLE                      hMmio2Shared;
    420421
    421422    /** The loopback transmit buffer (avoid stack allocations). */
     
    44854486        /* older saved states contain the shared memory region which was never used for ages. */
    44864487        void *pvSharedMMIOR3;
    4487         rc = PDMDevHlpMMIO2Register(pDevIns, pDevIns->apPciDevs[0], 2, _512K, 0, (void **)&pvSharedMMIOR3, "PCnetSh");
     4488        rc = PDMDevHlpMmio2Create(pDevIns, pDevIns->apPciDevs[0], 2, _512K, 0, "PCnetSh", &pvSharedMMIOR3, &pThis->hMmio2Shared);
    44884489        if (RT_FAILURE(rc))
    44894490            rc = PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
    44904491                                     N_("Failed to allocate the dummy shmem region for the PCnet device"));
    4491         pThis->fSharedRegion = true;
    4492     }
     4492    }
     4493
    44934494    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
    4494 
    44954495    return rc;
    44964496}
     
    46104610    PPCNETSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE);
    46114611    int rc = VINF_SUCCESS;
    4612     if (pThis->fSharedRegion)
     4612    if (pThis->hMmio2Shared != NIL_PGMMMIO2HANDLE)
    46134613    {
    46144614        /* drop this dummy region */
    4615         rc = PDMDevHlpMMIOExDeregister(pDevIns, NULL, 2);
    4616         pThis->fSharedRegion = false;
     4615        rc = pDevIns->pHlpR3->pfnMmio2Destroy(pDevIns, pThis->hMmio2Shared);
     4616        AssertLogRelRC(rc);
     4617        pThis->hMmio2Shared = NIL_PGMMMIO2HANDLE;
    46174618    }
    46184619    return rc;
     
    50795080    pThis->hIoPortsIsa          = NIL_IOMIOPORTHANDLE;
    50805081    pThis->hIoPortsIsaAProm     = NIL_IOMIOPORTHANDLE;
     5082    pThis->hMmio2Shared         = NIL_PGMMMIO2HANDLE;
    50815083    pThisCC->pDevIns            = pDevIns;
    50825084
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