Changeset 12687 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 24, 2008 2:07:47 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 36992
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r12409 r12687 1606 1606 int rc; 1607 1607 1608 AssertReturn(iRegion == 1&& enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR);1608 AssertReturn(iRegion <= 2 && enmType == PCI_ADDRESS_SPACE_MEM, VERR_INTERNAL_ERROR); 1609 1609 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 } 1619 1631 } 1620 1632 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 } 1627 1655 } 1628 1656 … … 2245 2273 vmmdevInitRam(pThis); 2246 2274 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 2247 2280 /* 2248 2281 * Register the PCI device. … … 2257 2290 return rc; 2258 2291 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); 2259 2295 if (RT_FAILURE(rc)) 2260 2296 return rc; -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r11820 r12687 91 91 RTGCPHYS32 GCPhysVMMDevRAM; 92 92 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 93 99 /** Information reported by guest via VMMDevReportGuestInfo generic request. 94 100 * Until this information is reported the VMMDev refuses any other requests.
Note:
See TracChangeset
for help on using the changeset viewer.