VirtualBox

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


Ignore:
Timestamp:
Sep 24, 2008 2:07:47 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
36992
Message:

Started with VMM device heap for use with VT-x real-mode emulation. (v86 tss)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r12409 r12687  
    16061606    int rc;
    16071607
    1608     AssertReturn(iRegion == 1 && enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR);
     1608    AssertReturn(iRegion <= 2 && enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR);
    16091609    Assert(pThis->pVMMDevRAMR3 != NULL);
    1610 
    1611     if (GCPhysAddress != NIL_RTGCPHYS)
    1612     {
    1613         /*
    1614          * Map the MMIO2 memory.
    1615          */
    1616         pThis->GCPhysVMMDevRAM = GCPhysAddress;
    1617         Assert(pThis->GCPhysVMMDevRAM == GCPhysAddress);
    1618         rc = PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress);
     1610    Assert(pThis->pVMMDevHeapR3 != NULL);
     1611
     1612    if (iRegion == 1)
     1613    {
     1614        if (GCPhysAddress != NIL_RTGCPHYS)
     1615        {
     1616            /*
     1617             * Map the MMIO2 memory.
     1618             */
     1619            pThis->GCPhysVMMDevRAM = GCPhysAddress;
     1620            Assert(pThis->GCPhysVMMDevRAM == GCPhysAddress);
     1621            rc = PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress);
     1622        }
     1623        else
     1624        {
     1625            /*
     1626             * It is about to be unmapped, just clean up.
     1627             */
     1628            pThis->GCPhysVMMDevRAM = NIL_RTGCPHYS32;
     1629            rc = VINF_SUCCESS;
     1630        }
    16191631    }
    16201632    else
    1621     {
    1622         /*
    1623          * It is about to be unmapped, just clean up.
    1624          */
    1625         pThis->GCPhysVMMDevRAM = NIL_RTGCPHYS32;
    1626         rc = VINF_SUCCESS;
     1633    if (iRegion == 2)
     1634    {
     1635        if (GCPhysAddress != NIL_RTGCPHYS)
     1636        {
     1637            /*
     1638             * Map the MMIO2 memory.
     1639             */
     1640            pThis->GCPhysVMMDevHeap = GCPhysAddress;
     1641            Assert(pThis->GCPhysVMMDevHeap == GCPhysAddress);
     1642            rc = PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress);
     1643            if (VBOX_SUCCESS(rc))
     1644                rc = PDMDevHlpRegisterVMMDevHeap(pPciDev->pDevIns, GCPhysAddress, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE);
     1645        }
     1646        else
     1647        {
     1648            /*
     1649             * It is about to be unmapped, just clean up.
     1650             */
     1651            PDMDevHlpUnregisterVMMDevHeap(pPciDev->pDevIns, GCPhysAddress);
     1652            pThis->GCPhysVMMDevHeap = NIL_RTGCPHYS32;
     1653            rc = VINF_SUCCESS;
     1654        }
    16271655    }
    16281656
     
    22452273    vmmdevInitRam(pThis);
    22462274
     2275    rc = PDMDevHlpMMIO2Register(pDevIns, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0, (void **)&pThis->pVMMDevHeapR3, "VMMDev Heap");
     2276    if (RT_FAILURE(rc))
     2277        return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
     2278                                   N_("Failed to allocate %u bytes of memory for the VMM device"), PAGE_SIZE);
     2279
    22472280    /*
    22482281     * Register the PCI device.
     
    22572290        return rc;
    22582291    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 1, VMMDEV_RAM_SIZE, PCI_ADDRESS_SPACE_MEM, vmmdevIORAMRegionMap);
     2292    if (RT_FAILURE(rc))
     2293        return rc;
     2294    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 2, VMMDEV_HEAP_SIZE, PCI_ADDRESS_SPACE_MEM, vmmdevIORAMRegionMap);
    22592295    if (RT_FAILURE(rc))
    22602296        return rc;
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r11820 r12687  
    9191    RTGCPHYS32 GCPhysVMMDevRAM;
    9292
     93    /** R3 pointer to VMMDev Heap RAM area
     94     */
     95    R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3;
     96    /** GC physical address of VMMDev Heap RAM area */
     97    RTGCPHYS32 GCPhysVMMDevHeap;
     98
    9399    /** Information reported by guest via VMMDevReportGuestInfo generic request.
    94100     * Until this information is reported the VMMDev refuses any other requests.
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