Changeset 81031 in vbox for trunk/src/VBox/Devices/VMMDev
- Timestamp:
- Sep 26, 2019 7:26:33 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 133634
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r80704 r81031 3203 3203 RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType) 3204 3204 { 3205 RT_NOREF1(cb);3205 PVMMDEV pThis = PDMINS_2_DATA(pDevIns, PVMMDEV); 3206 3206 LogFlow(("vmmdevR3IORAMRegionMap: iRegion=%d GCPhysAddress=%RGp cb=%RGp enmType=%d\n", iRegion, GCPhysAddress, cb, enmType)); 3207 PVMMDEV pThis = RT_FROM_MEMBER(pPciDev, VMMDEV, PciDev); 3207 Assert(pPciDev == pDevIns->apPciDevs[0]); 3208 RT_NOREF(cb, pPciDev); 3209 3208 3210 int rc; 3209 3211 … … 3271 3273 RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType) 3272 3274 { 3275 PVMMDEV pThis = PDMINS_2_DATA(pDevIns, PVMMDEV); 3273 3276 LogFlow(("vmmdevIOPortRegionMap: iRegion=%d GCPhysAddress=%RGp cb=%RGp enmType=%d\n", iRegion, GCPhysAddress, cb, enmType)); 3274 RT_NOREF 3(iRegion, cb, enmType);3275 PVMMDEV pThis = RT_FROM_MEMBER(pPciDev, VMMDEV, PciDev); 3276 3277 RT_NOREF(pPciDev, iRegion, cb, enmType); 3278 3279 Assert(pPciDev == pDevIns->apPciDevs[0]); 3277 3280 Assert(enmType == PCI_ADDRESS_SPACE_IO); 3278 3281 Assert(iRegion == 0); … … 4363 4366 #endif 4364 4367 4368 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0]; 4369 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 4370 4365 4371 /* PCI vendor, just a free bogus value */ 4366 P CIDevSetVendorId(&pThis->PciDev,0x80ee);4372 PDMPciDevSetVendorId(pPciDev, 0x80ee); 4367 4373 /* device ID */ 4368 P CIDevSetDeviceId(&pThis->PciDev,0xcafe);4374 PDMPciDevSetDeviceId(pPciDev, 0xcafe); 4369 4375 /* class sub code (other type of system peripheral) */ 4370 P CIDevSetClassSub(&pThis->PciDev,0x80);4376 PDMPciDevSetClassSub(pPciDev, 0x80); 4371 4377 /* class base code (base system peripheral) */ 4372 P CIDevSetClassBase(&pThis->PciDev,0x08);4378 PDMPciDevSetClassBase(pPciDev, 0x08); 4373 4379 /* header type */ 4374 P CIDevSetHeaderType(&pThis->PciDev,0x00);4380 PDMPciDevSetHeaderType(pPciDev, 0x00); 4375 4381 /* interrupt on pin 0 */ 4376 P CIDevSetInterruptPin(&pThis->PciDev,0x01);4382 PDMPciDevSetInterruptPin(pPciDev, 0x01); 4377 4383 4378 4384 RTTIMESPEC TimeStampNow; … … 4559 4565 * Register the PCI device. 4560 4566 */ 4561 rc = PDMDevHlpPCIRegister(pDevIns, &pThis->PciDev);4567 rc = PDMDevHlpPCIRegister(pDevIns, pPciDev); 4562 4568 if (RT_FAILURE(rc)) 4563 4569 return rc; 4564 if (p This->PciDev.uDevFn != 32 || iInstance != 0)4565 Log(("!!WARNING!!: pThis->PciDev.uDevFn=%d (ignore if testcase or no started by Main)\n", p This->PciDev.uDevFn));4570 if (pPciDev->uDevFn != 32 || iInstance != 0) 4571 Log(("!!WARNING!!: pThis->PciDev.uDevFn=%d (ignore if testcase or no started by Main)\n", pPciDev->uDevFn)); 4566 4572 rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x20, PCI_ADDRESS_SPACE_IO, vmmdevIOPortRegionMap); 4567 4573 if (RT_FAILURE(rc)) … … 4583 4589 * interrupt acknowledge requests more timely. 4584 4590 */ 4585 rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/,4591 rc = PDMDevHlpMMIO2Register(pDevIns, pPciDev, 1 /*iRegion*/, VMMDEV_RAM_SIZE, 0 /*fFlags*/, 4586 4592 (void **)&pThis->pVMMDevRAMR3, "VMMDev"); 4587 4593 if (RT_FAILURE(rc)) … … 4591 4597 if (pThis->fRZEnabled) 4592 4598 { 4593 rc = PDMDevHlpMMIO2MapKernel(pDevIns, &pThis->PciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMR0);4599 rc = PDMDevHlpMMIO2MapKernel(pDevIns, pPciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMR0); 4594 4600 if (RT_FAILURE(rc)) 4595 4601 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, … … 4597 4603 4598 4604 #ifdef VBOX_WITH_RAW_MODE_KEEP 4599 rc = PDMDevHlpMMHyperMapMMIO2(pDevIns, &pThis->PciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMRC);4605 rc = PDMDevHlpMMHyperMapMMIO2(pDevIns, pPciDev, 1 /*iRegion*/, 0 /*off*/, PAGE_SIZE, "VMMDev", &pThis->pVMMDevRAMRC); 4600 4606 if (RT_FAILURE(rc)) 4601 4607 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, … … 4609 4615 if (pThis->fHeapEnabled) 4610 4616 { 4611 rc = PDMDevHlpMMIO2Register(pDevIns, &pThis->PciDev, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/,4617 rc = PDMDevHlpMMIO2Register(pDevIns, pPciDev, 2 /*iRegion*/, VMMDEV_HEAP_SIZE, 0 /*fFlags*/, 4612 4618 (void **)&pThis->pVMMDevHeapR3, "VMMDev Heap"); 4613 4619 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r80118 r81031 121 121 typedef struct VMMDevState 122 122 { 123 /** The PCI device structure. */124 PDMPCIDEV PciDev;125 123 /** The critical section for this device. 126 124 * @remarks We use this rather than the default one, it's simpler with all
Note:
See TracChangeset
for help on using the changeset viewer.