- Timestamp:
- Oct 6, 2010 3:03:32 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66448
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r32941 r32951 528 528 static void ich9pciSetIrqInternal(PPCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE pPciDev, int iIrq, int iLevel) 529 529 { 530 if (MsiIsEnabled(pPciDev)) 531 { 532 Log2(("Raise a MSI interrupt: %d\n", iIrq)); 533 /* We only trigger MSI on level up, as technically it's matching flip-flop best (maybe even assert that level == PDM_IRQ_LEVEL_FLIP_FLOP) */ 534 if ((iLevel & PDM_IRQ_LEVEL_HIGH) != 0) 535 { 536 PPDMDEVINS pDevIns = pGlobals->aPciBus.CTX_SUFF(pDevIns); 537 MsiNotify(pDevIns, pGlobals->aPciBus.CTX_SUFF(pPciHlp), pPciDev, iIrq); 530 531 if (PCIDevIsIntxDisabled(pPciDev)) 532 { 533 if (MsiIsEnabled(pPciDev)) 534 { 535 Log2(("Raise a MSI interrupt: %d\n", iIrq)); 536 /* We only trigger MSI on level up, as technically it's matching flip-flop best (maybe even assert that level == PDM_IRQ_LEVEL_FLIP_FLOP) */ 537 if ((iLevel & PDM_IRQ_LEVEL_HIGH) != 0) 538 { 539 PPDMDEVINS pDevIns = pGlobals->aPciBus.CTX_SUFF(pDevIns); 540 MsiNotify(pDevIns, pGlobals->aPciBus.CTX_SUFF(pPciHlp), pPciDev, iIrq); 541 } 538 542 } 539 543 return; … … 569 573 uint32_t u32 = 0; 570 574 575 PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE); 576 571 577 ich9pciPhysToPciAddr(pGlobals, GCPhysAddr, &aDest); 572 578 573 PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE);574 579 switch (cb) 575 580 { … … 597 602 PPCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PPCIGLOBALS); 598 603 PciAddress aDest; 599 uint32_t rv = 0; 604 uint32_t rv = 0xffffffff; 605 606 PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE); 600 607 601 608 ich9pciPhysToPciAddr(pGlobals, GCPhysAddr, &aDest); 602 609 603 PCI_LOCK(pDevIns, VINF_IOM_HC_IOPORT_WRITE);604 610 int rc = ich9pciDataReadAddr(pGlobals, &aDest, cb, &rv); 605 if (rc == VINF_SUCCESS) 606 { 607 switch (cb) 608 { 609 case 1: 610 *(uint8_t*)pv = (uint8_t)rv; 611 break; 612 case 2: 613 *(uint16_t*)pv = (uint16_t)rv; 614 break; 615 case 4: 616 *(uint32_t*)pv = (uint32_t)rv; 617 break; 618 default: 619 Assert(false); 620 break; 621 } 611 612 switch (cb) 613 { 614 case 1: 615 *(uint8_t*)pv = (uint8_t)rv; 616 break; 617 case 2: 618 *(uint16_t*)pv = (uint16_t)rv; 619 break; 620 case 4: 621 *(uint32_t*)pv = (uint32_t)rv; 622 break; 623 default: 624 Assert(false); 625 break; 622 626 } 623 627 PCI_UNLOCK(pDevIns); … … 1699 1703 return PCIDevGetByte(aDev, u32Address); 1700 1704 case 2: 1701 return PCIDevGetWord(aDev, u32Address); 1705 return PCIDevGetWord(aDev, u32Address); 1702 1706 case 4: 1703 1707 return PCIDevGetDWord(aDev, u32Address); … … 2263 2267 } 2264 2268 2269 static void ich9pciResetDevice(PPCIDEVICE pDev) 2270 { 2271 pDev->config[VBOX_PCI_COMMAND] &= ~(VBOX_PCI_COMMAND_IO | VBOX_PCI_COMMAND_MEMORY | 2272 VBOX_PCI_COMMAND_MASTER); 2273 2274 if (!PCIIsPci2PciBridge(pDev)) 2275 { 2276 pDev->config[VBOX_PCI_CACHE_LINE_SIZE] = 0x0; 2277 pDev->config[VBOX_PCI_INTERRUPT_LINE] = 0x0; 2278 } 2279 /* Regions ? */ 2280 } 2281 2282 2283 /** 2284 * @copydoc FNPDMDEVRESET 2285 */ 2286 static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns) 2287 { 2288 PPCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PPCIGLOBALS); 2289 PPCIBUS pBus = &pGlobals->aPciBus; 2290 2291 /* Relocate RC pointers for the attached pci devices. */ 2292 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 2293 { 2294 if (pBus->apDevices[i]) 2295 ich9pciResetDevice(pBus->apDevices[i]); 2296 } 2297 } 2298 2265 2299 /** 2266 2300 * @copydoc FNPDMDEVRELOCATE … … 2473 2507 NULL, 2474 2508 /* pfnReset */ 2475 NULL,2509 ich9pciReset, 2476 2510 /* pfnSuspend */ 2477 2511 NULL, -
trunk/src/VBox/Devices/PC/vbox.dsl
r32714 r32951 556 556 APDE, 8, 557 557 } 558 558 559 559 // PCI MCFG MMIO ranges 560 560 Device (^PCIE) … … 565 565 { 566 566 Memory32Fixed (ReadOnly, 567 0x D0000000,// Address Base568 0x 10000000, // Address Length567 0xdc000000, // Address Base 568 0x4000000, // Address Length 569 569 _Y13) 570 570 }) … … 586 586 } 587 587 } 588 } 588 } 589 589 590 590 // Keyboard device
Note:
See TracChangeset
for help on using the changeset viewer.