Changeset 64702 in vbox
- Timestamp:
- Nov 17, 2016 8:42:42 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111981
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r64701 r64702 1690 1690 * Initializes bridges registers used for routing. 1691 1691 * 1692 * We ASSUME PDM bus assignments are the same as the PCI bus assignments and 1693 * will complain if we find any conflicts. This because it is just soo much 1694 * simpler to have the two numbers match one another by default. 1695 * 1692 1696 * @returns Max subordinate bus number. 1693 1697 * @param pPciRoot Global device instance data used to generate unique bus numbers. 1694 1698 * @param pBus The PCI bus to initialize. 1699 * @param pbmUsed Pointer to a 32-bit bitmap tracking which device 1700 * (ranges) has been used. 1695 1701 * @param uBusPrimary The primary bus number the bus is connected to. 1696 * @param uBusSecondary The secondary bus number, i.e. the bus number behind the bridge. 1697 */ 1698 static uint8_t ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, unsigned uBusPrimary, unsigned uBusSecondary) 1702 */ 1703 static uint8_t ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, uint32_t *pbmUsed, unsigned uBusPrimary) 1699 1704 { 1700 1705 PPDMPCIDEV pBridgeDev = &pBus->PciDev; 1701 1706 1707 /* Check if the PDM bus assignment makes sense. */ 1708 AssertLogRelMsg(!(*pbmUsed & RT_BIT_32(pBus->iBus)), 1709 ("PCIBIOS: Bad PCI bridge config! Conflict for bus %#x. Make sure to instantiate bridges for a sub-trees in sequence!\n", 1710 pBus->iBus)); 1711 *pbmUsed |= RT_BIT_32(pBus->iBus); 1712 1702 1713 /* Set only if we are not on the root bus, it has no primary bus attached. */ 1703 if ( uBusSecondary!= 0)1714 if (pBus->iBus != 0) 1704 1715 { 1705 1716 PCIDevSetByte(pBridgeDev, VBOX_PCI_PRIMARY_BUS, uBusPrimary); 1706 PCIDevSetByte(pBridgeDev, VBOX_PCI_SECONDARY_BUS, uBusSecondary);1717 PCIDevSetByte(pBridgeDev, VBOX_PCI_SECONDARY_BUS, pBus->iBus); 1707 1718 } 1708 1719 … … 1714 1725 ("Device is not a PCI bridge but on the list of PCI bridges\n")); 1715 1726 PDEVPCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS); 1716 uint8_t uMaxChildSubBus = ich9pciBiosInitBridgeTopology(pPciRoot, pChildBus, uBusSecondary, pChildBus->iBus);1727 uint8_t uMaxChildSubBus = ich9pciBiosInitBridgeTopology(pPciRoot, pChildBus, pbmUsed, pBus->iBus); 1717 1728 uMaxSubNum = RT_MAX(uMaxSubNum, uMaxChildSubBus); 1718 1729 } 1730 1719 1731 PCIDevSetByte(pBridgeDev, VBOX_PCI_SUBORDINATE_BUS, uMaxSubNum); 1732 for (uint32_t i = pBus->iBus; i <= uMaxSubNum; i++) 1733 *pbmUsed |= RT_BIT_32(i); 1734 1720 1735 Log2(("ich9pciBiosInitBridgeTopology: for bus %p: primary=%d secondary=%d subordinate=%d\n", 1721 1736 pBus, … … 1761 1776 PDEVPCIBUS pBus = &pPciRoot->PciBus; 1762 1777 AssertLogRel(pBus->iBus == 0); 1763 ich9pciBiosInitBridgeTopology(pPciRoot, pBus, 0, pBus->iBus); 1778 uint32_t bmUsed = 0; 1779 ich9pciBiosInitBridgeTopology(pPciRoot, pBus, &bmUsed, 0); 1764 1780 1765 1781 /* … … 2760 2776 pBus->pPciHlpRC = pBus->pPciHlpR3->pfnGetRCHelpers(pDevIns); 2761 2777 pBus->pPciHlpR0 = pBus->pPciHlpR3->pfnGetR0Helpers(pDevIns); 2778 LogRel(("PCI: Registered bridge instance #%u as PDM bus no %u.\n", iInstance, pBus->iBus)); 2762 2779 2763 2780
Note:
See TracChangeset
for help on using the changeset viewer.