Changeset 64373 in vbox for trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
- Timestamp:
- Oct 23, 2016 7:03:39 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r64356 r64373 2879 2879 * @callback_method_impl{FNPCIIOREGIONMAP,MMIO/MMIO2 regions} 2880 2880 */ 2881 static DECLCALLBACK(int) 2882 vmmdevIORAMRegionMap(PPCIDEVICE pPciDev, int iRegion,RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)2881 static DECLCALLBACK(int) vmmdevIORAMRegionMap(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, uint32_t iRegion, 2882 RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType) 2883 2883 { 2884 2884 RT_NOREF1(cb); … … 2898 2898 pThis->GCPhysVMMDevRAM = GCPhysAddress; 2899 2899 Assert(pThis->GCPhysVMMDevRAM == GCPhysAddress); 2900 rc = PDMDevHlpMMIOExMap(p PciDev->pDevIns, pPciDev, iRegion, GCPhysAddress);2900 rc = PDMDevHlpMMIOExMap(pDevIns, pPciDev, iRegion, GCPhysAddress); 2901 2901 } 2902 2902 else … … 2920 2920 pThis->GCPhysVMMDevHeap = GCPhysAddress; 2921 2921 Assert(pThis->GCPhysVMMDevHeap == GCPhysAddress); 2922 rc = PDMDevHlpMMIOExMap(p PciDev->pDevIns, pPciDev, iRegion, GCPhysAddress);2922 rc = PDMDevHlpMMIOExMap(pDevIns, pPciDev, iRegion, GCPhysAddress); 2923 2923 if (RT_SUCCESS(rc)) 2924 rc = PDMDevHlpRegisterVMMDevHeap(p PciDev->pDevIns, GCPhysAddress, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE);2924 rc = PDMDevHlpRegisterVMMDevHeap(pDevIns, GCPhysAddress, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE); 2925 2925 } 2926 2926 else … … 2929 2929 * It is about to be unmapped, just clean up. 2930 2930 */ 2931 PDMDevHlpRegisterVMMDevHeap(p PciDev->pDevIns, NIL_RTGCPHYS, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE);2931 PDMDevHlpRegisterVMMDevHeap(pDevIns, NIL_RTGCPHYS, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE); 2932 2932 pThis->GCPhysVMMDevHeap = NIL_RTGCPHYS32; 2933 2933 rc = VINF_SUCCESS; … … 2947 2947 * @callback_method_impl{FNPCIIOREGIONMAP,I/O Port Region} 2948 2948 */ 2949 static DECLCALLBACK(int) 2950 vmmdevIOPortRegionMap(PPCIDEVICE pPciDev, int iRegion,RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType)2949 static DECLCALLBACK(int) vmmdevIOPortRegionMap(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, uint32_t iRegion, 2950 RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType) 2951 2951 { 2952 2952 RT_NOREF3(iRegion, cb, enmType); … … 2960 2960 * Register our port IO handlers. 2961 2961 */ 2962 int rc = PDMDevHlpIOPortRegister(p PciDev->pDevIns, (RTIOPORT)GCPhysAddress + VMMDEV_PORT_OFF_REQUEST, 1,2962 int rc = PDMDevHlpIOPortRegister(pDevIns, (RTIOPORT)GCPhysAddress + VMMDEV_PORT_OFF_REQUEST, 1, 2963 2963 pThis, vmmdevRequestHandler, NULL, NULL, NULL, "VMMDev Request Handler"); 2964 2964 AssertRC(rc); … … 4146 4146 4147 4147 /* 4148 * Allocate and initialize the MMIO2 memory.4149 */4150 rc = PDMDevHlpMMIO2Register(pDevIns, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/, (void **)&pThis->pVMMDevRAMR3, "VMMDev");4151 if (RT_FAILURE(rc))4152 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,4153 N_("Failed to allocate %u bytes of memory for the VMM device"), VMMDEV_RAM_SIZE);4154 vmmdevInitRam(pThis);4155 4156 if (pThis->fHeapEnabled)4157 {4158 rc = PDMDevHlpMMIO2Register(pDevIns, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/, (void **)&pThis->pVMMDevHeapR3, "VMMDev Heap");4159 if (RT_FAILURE(rc))4160 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,4161 N_("Failed to allocate %u bytes of memory for the VMM device heap"), PAGE_SIZE);4162 4163 /* Register the memory area with PDM so HM can access it before it's mapped. */4164 rc = PDMDevHlpRegisterVMMDevHeap(pDevIns, NIL_RTGCPHYS, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE);4165 AssertLogRelRCReturn(rc, rc);4166 }4167 4168 /*4169 4148 * Register the PCI device. 4170 4149 */ … … 4185 4164 if (RT_FAILURE(rc)) 4186 4165 return rc; 4166 } 4167 4168 /* 4169 * Allocate and initialize the MMIO2 memory. 4170 */ 4171 rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/, 4172 (void **)&pThis->pVMMDevRAMR3, "VMMDev"); 4173 if (RT_FAILURE(rc)) 4174 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 4175 N_("Failed to allocate %u bytes of memory for the VMM device"), VMMDEV_RAM_SIZE); 4176 vmmdevInitRam(pThis); 4177 4178 if (pThis->fHeapEnabled) 4179 { 4180 rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/, 4181 (void **)&pThis->pVMMDevHeapR3, "VMMDev Heap"); 4182 if (RT_FAILURE(rc)) 4183 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 4184 N_("Failed to allocate %u bytes of memory for the VMM device heap"), PAGE_SIZE); 4185 4186 /* Register the memory area with PDM so HM can access it before it's mapped. */ 4187 rc = PDMDevHlpRegisterVMMDevHeap(pDevIns, NIL_RTGCPHYS, pThis->pVMMDevHeapR3, VMMDEV_HEAP_SIZE); 4188 AssertLogRelRCReturn(rc, rc); 4187 4189 } 4188 4190
Note:
See TracChangeset
for help on using the changeset viewer.