vbox的更動 7635 路徑 trunk/src/VBox/Devices/Bus
- 時間撮記:
- 2008-3-28 下午05:15:38 (17 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r7072 r7635 1 /* $Id: $ */ 1 2 /** @file 2 * 3 * PCI Device. 3 * PCI BUS Device. 4 4 */ 5 5 … … 214 214 static void pci_update_mappings(PCIDevice *d) 215 215 { 216 PPCIBUS pBus = d->Int.s.pBus; 216 217 PCIIORegion *r; 217 218 int cmd, i; … … 279 280 } 280 281 } else { 281 int rc = d->pDevIns->pDevHlp->pfnMMIODeregister(d->pDevIns, 282 r->addr + PCIBUS2PCIGLOBALS(d->Int.s.pBus)->pci_mem_base, 283 r->size); 284 #if 0 /** @todo deal correctly with deregistration of MMIO2 ranges and such like. */ 285 AssertMsg(VBOX_SUCCESS(rc) || !strcmp(d->name, "vga") || !strcmp(d->name, "VMMDev"), ("rc=%Vrc d=%s\n", rc, d->name)); NOREF(rc); 286 #else /* less strict check */ 287 AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_IOM_MMIO_RANGE_NOT_FOUND, ("rc=%Vrc d=%s\n", rc, d->name)); NOREF(rc); 288 #endif 282 RTGCPHYS GCPhysBase = r->addr + PCIBUS2PCIGLOBALS(pBus)->pci_mem_base; 283 int rc; 284 if (pBus->pPciHlpR3->pfnIsMMIO2Base(pBus->pDevInsHC, d->pDevIns, GCPhysBase)) 285 { 286 /* unmap it. */ 287 int rc = r->map_func(d, i, NIL_RTGCPHYS, r->size, (PCIADDRESSSPACE)(r->type)); 288 AssertRC(rc); 289 rc = PDMDevHlpMMIO2Unmap(d->pDevIns, i, GCPhysBase); 290 } 291 else 292 rc = d->pDevIns->pDevHlp->pfnMMIODeregister(d->pDevIns, GCPhysBase, r->size); 293 AssertMsgRC(rc, ("rc=%Rrc d=%s i=%d GCPhysBase=%RGp size=%#x\n", rc, d->name, i, GCPhysBase, r->size)); 289 294 } 290 295 } … … 292 297 if (r->addr != ~0U) { 293 298 int rc = r->map_func(d, i, 294 r->addr + (r->type & PCI_ADDRESS_SPACE_IO ? 0 : PCIBUS2PCIGLOBALS( d->Int.s.pBus)->pci_mem_base),299 r->addr + (r->type & PCI_ADDRESS_SPACE_IO ? 0 : PCIBUS2PCIGLOBALS(pBus)->pci_mem_base), 295 300 r->size, (PCIADDRESSSPACE)(r->type)); 296 301 AssertRC(rc); … … 772 777 { 773 778 case 0x0101: 774 if (vendor_id == 0x8086 && 779 if (vendor_id == 0x8086 && 775 780 (device_id == 0x7010 || device_id == 0x7111)) { 776 781 /* PIIX3 or PIIX4 IDE */ … … 1083 1088 if (pData->devices[i]) 1084 1089 { 1085 LogRel(("New device in slot %#x, %s (vendor=%#06x device=%#06x)\n", i, pData->devices[i]->name, 1090 LogRel(("New device in slot %#x, %s (vendor=%#06x device=%#06x)\n", i, pData->devices[i]->name, 1086 1091 PCIDevGetVendorId(pData->devices[i]), PCIDevGetDeviceId(pData->devices[i]))); 1087 1092 if (SSMR3HandleGetAfter(pSSMHandle) != SSMAFTER_DEBUG_IT) … … 1100 1105 if (!pDev) 1101 1106 { 1102 LogRel(("Device in slot %#x has been removed! vendor=%#06x device=%#06x\n", i, 1107 LogRel(("Device in slot %#x has been removed! vendor=%#06x device=%#06x\n", i, 1103 1108 PCIDevGetVendorId(&DevTmp), PCIDevGetDeviceId(&DevTmp))); 1104 1109 if (SSMR3HandleGetAfter(pSSMHandle) != SSMAFTER_DEBUG_IT) … … 1118 1123 /* commit the loaded device config. */ 1119 1124 memcpy(pDev->config, DevTmp.config, sizeof(pDev->config)); 1120 if (DevTmp.Int.s.iIrq >= PCI_DEVICES_MAX) 1125 if (DevTmp.Int.s.iIrq >= PCI_DEVICES_MAX) 1121 1126 { 1122 1127 LogRel(("Device %s: Too many devices %d (max=%d)\n", pDev->name, DevTmp.Int.s.iIrq, PCI_DEVICES_MAX)); … … 1326 1331 1327 1332 1328 /** 1333 /** 1329 1334 * @copydoc PDMPCIBUSREG::pfnSetConfigCallbacksHC 1330 1335 */ 1331 static DECLCALLBACK(void) pciSetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld, 1336 static DECLCALLBACK(void) pciSetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld, 1332 1337 PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld) 1333 1338 { … … 1495 1500 return PDMDEV_SET_ERROR(pDevIns, rc, 1496 1501 N_("Failed to register ourselves as a PCI Bus")); 1502 if (pBus->pPciHlpR3->u32Version != PDM_PCIHLPR3_VERSION) 1503 return PDMDevHlpVMSetError(pDevIns, VERR_VERSION_MISMATCH, RT_SRC_POS, 1504 N_("PCI helper version mismatch; got %#x expected %#x"), 1505 pBus->pPciHlpR3->u32Version != PDM_PCIHLPR3_VERSION); 1497 1506 1498 1507 pBus->pPciHlpGC = pBus->pPciHlpR3->pfnGetGCHelpers(pDevIns);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器