Changeset 65844 in vbox
- Timestamp:
- Feb 22, 2017 7:30:22 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113613
- Location:
- trunk/src/VBox/Devices/Bus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r65708 r65844 615 615 * through the bridge but we want to be compliant to the spec. 616 616 */ 617 if ((pGlobals->uPciBiosIo % 4 096) != 0)618 pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, 4* 1024);617 if ((pGlobals->uPciBiosIo % 4*_1K) != 0) 618 pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, 4*_1K); 619 619 Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosIo)); 620 620 pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_BASE, (pGlobals->uPciBiosIo >> 8) & 0xf0); 621 621 622 622 /* The MMIO range for the bridge must be aligned to a 1MB boundary. */ 623 if ((pGlobals->uPciBiosMmio % (1024 * 1024)) != 0)624 pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, 1024*1024);623 if ((pGlobals->uPciBiosMmio % _1M) != 0) 624 pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, _1M); 625 625 Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosMmio)); 626 626 pci_config_writew(pGlobals, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pGlobals->uPciBiosMmio >> 16) & UINT32_C(0xffff0)); … … 643 643 * interface. Again this doesn't really matter here but we want to be compliant to the spec. 644 644 */ 645 if ((u32IoAddressBase != pGlobals->uPciBiosIo) && ((pGlobals->uPciBiosIo % 4 096) != 0))645 if ((u32IoAddressBase != pGlobals->uPciBiosIo) && ((pGlobals->uPciBiosIo % 4*_1K) != 0)) 646 646 { 647 647 /* The upper boundary must be one byte less than a 4KB boundary. */ 648 pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, 4* 1024);648 pGlobals->uPciBiosIo = RT_ALIGN_32(pGlobals->uPciBiosIo, 4*_1K); 649 649 } 650 650 pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pGlobals->uPciBiosIo >> 8) & 0xf0) - 1); 651 651 652 652 /* Same with the MMIO limit register but with 1MB boundary here. */ 653 if ((u32MMIOAddressBase != pGlobals->uPciBiosMmio) && ((pGlobals->uPciBiosMmio % (1024 * 1024)) != 0))653 if ((u32MMIOAddressBase != pGlobals->uPciBiosMmio) && ((pGlobals->uPciBiosMmio % _1M) != 0)) 654 654 { 655 655 /* The upper boundary must be one byte less than a 1MB boundary. */ 656 pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, 1024*1024);656 pGlobals->uPciBiosMmio = RT_ALIGN_32(pGlobals->uPciBiosMmio, _1M); 657 657 } 658 658 pci_config_writew(pGlobals, uBus, uDevFn, VBOX_PCI_MEMORY_LIMIT, ((pGlobals->uPciBiosMmio >> 16) & UINT32_C(0xfff0)) - 1); -
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r65820 r65844 1564 1564 * through the bridge but we want to be compliant to the spec. 1565 1565 */ 1566 if ((pPciRoot->uPciBiosIo % 4 096) != 0)1567 { 1568 pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, 4* 1024);1566 if ((pPciRoot->uPciBiosIo % 4*_1K) != 0) 1567 { 1568 pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, 4*_1K); 1569 1569 Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosIo)); 1570 1570 } … … 1572 1572 1573 1573 /* The MMIO range for the bridge must be aligned to a 1MB boundary. */ 1574 if ((pPciRoot->uPciBiosMmio % (1024 * 1024)) != 0)1575 { 1576 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024);1574 if ((pPciRoot->uPciBiosMmio % _1M) != 0) 1575 { 1576 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M); 1577 1577 Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosMmio)); 1578 1578 } … … 1594 1594 { 1595 1595 /* Need again alignment to a 4KB boundary. */ 1596 pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, 4* 1024);1596 pPciRoot->uPciBiosIo = RT_ALIGN_32(pPciRoot->uPciBiosIo, 4*_1K); 1597 1597 ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pPciRoot->uPciBiosIo - 1) >> 8) & 0xf0, 1); 1598 1598 } … … 1606 1606 if (u32MMIOAddressBase != pPciRoot->uPciBiosMmio) 1607 1607 { 1608 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024);1608 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M); 1609 1609 ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_LIMIT, ((pPciRoot->uPciBiosMmio - 1) >> 16) & UINT32_C(0xfff0), 2); 1610 1610 } … … 1889 1889 Log(("BIOS init bridge (prefetch): %02x:%02x.%d\n", uBus, uDevFn >> 3, uDevFn & 7)); 1890 1890 1891 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024);1892 pPciRoot->uPciBiosMmio64 = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, 1024*1024);1891 pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M); 1892 pPciRoot->uPciBiosMmio64 = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, _1M); 1893 1893 1894 1894 /* Save values to compare later to. */ … … 1911 1911 return false; 1912 1912 uBase = u64MMIOAddressBase; 1913 uLimit = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, 1024*1024) - 1;1913 uLimit = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, _1M) - 1; 1914 1914 } 1915 1915 else … … 1918 1918 return false; 1919 1919 uBase = u32MMIOAddressBase; 1920 uLimit = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024) - 1;1920 uLimit = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M) - 1; 1921 1921 } 1922 1922 ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_BASE_UPPER32, uBase >> 32, 4); … … 2282 2282 else 2283 2283 { 2284 if (uAddress + cb < 4 096)2284 if (uAddress + cb < 4*_1K) 2285 2285 LogRel(("PCI: %8s/%u: Read from extended register %d fallen back to generic code\n", 2286 2286 pPciDev->pszNameR3, pPciDev->Int.s.CTX_SUFF(pDevIns)->iInstance, uAddress)); … … 2697 2697 } 2698 2698 } 2699 else if (uAddress + cb <= 4 096)2699 else if (uAddress + cb <= 4*_1K) 2700 2700 LogRel(("PCI: %8s/%u: Write to extended register %d fallen back to generic code\n", 2701 2701 pPciDev->pszNameR3, pPciDev->Int.s.CTX_SUFF(pDevIns)->iInstance, uAddress));
Note:
See TracChangeset
for help on using the changeset viewer.