VirtualBox

Changeset 65844 in vbox


Ignore:
Timestamp:
Feb 22, 2017 7:30:22 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113613
Message:

Devices/Bus: symbolic constants

Location:
trunk/src/VBox/Devices/Bus
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r65708 r65844  
    615615                 * through the bridge but we want to be compliant to the spec.
    616616                 */
    617                 if ((pGlobals->uPciBiosIo % 4096) != 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);
    619619                Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosIo));
    620620                pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_BASE, (pGlobals->uPciBiosIo >> 8) & 0xf0);
    621621
    622622                /* 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);
    625625                Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pGlobals->uPciBiosMmio));
    626626                pci_config_writew(pGlobals, uBus, uDevFn, VBOX_PCI_MEMORY_BASE, (pGlobals->uPciBiosMmio >> 16) & UINT32_C(0xffff0));
     
    643643                 * interface. Again this doesn't really matter here but we want to be compliant to the spec.
    644644                 */
    645                 if ((u32IoAddressBase != pGlobals->uPciBiosIo) && ((pGlobals->uPciBiosIo % 4096) != 0))
     645                if ((u32IoAddressBase != pGlobals->uPciBiosIo) && ((pGlobals->uPciBiosIo % 4*_1K) != 0))
    646646                {
    647647                    /* 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);
    649649                }
    650650                pci_config_writeb(pGlobals, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pGlobals->uPciBiosIo >> 8) & 0xf0) - 1);
    651651
    652652                /* 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))
    654654                {
    655655                    /* 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);
    657657                }
    658658                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  
    15641564     * through the bridge but we want to be compliant to the spec.
    15651565     */
    1566     if ((pPciRoot->uPciBiosIo % 4096) != 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);
    15691569        Log(("%s: Aligned I/O start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosIo));
    15701570    }
     
    15721572
    15731573    /* 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);
    15771577        Log(("%s: Aligned MMIO start address. New address %#x\n", __FUNCTION__, pPciRoot->uPciBiosMmio));
    15781578    }
     
    15941594    {
    15951595        /* 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);
    15971597        ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_IO_LIMIT, ((pPciRoot->uPciBiosIo - 1) >> 8) & 0xf0, 1);
    15981598    }
     
    16061606    if (u32MMIOAddressBase != pPciRoot->uPciBiosMmio)
    16071607    {
    1608         pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024);
     1608        pPciRoot->uPciBiosMmio = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M);
    16091609        ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_MEMORY_LIMIT, ((pPciRoot->uPciBiosMmio - 1) >> 16) & UINT32_C(0xfff0), 2);
    16101610    }
     
    18891889    Log(("BIOS init bridge (prefetch): %02x:%02x.%d\n", uBus, uDevFn >> 3, uDevFn & 7));
    18901890
    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);
    18931893
    18941894    /* Save values to compare later to. */
     
    19111911            return false;
    19121912        uBase = u64MMIOAddressBase;
    1913         uLimit = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, 1024*1024) - 1;
     1913        uLimit = RT_ALIGN_64(pPciRoot->uPciBiosMmio64, _1M) - 1;
    19141914    }
    19151915    else
     
    19181918            return false;
    19191919        uBase = u32MMIOAddressBase;
    1920         uLimit = RT_ALIGN_32(pPciRoot->uPciBiosMmio, 1024*1024) - 1;
     1920        uLimit = RT_ALIGN_32(pPciRoot->uPciBiosMmio, _1M) - 1;
    19211921    }
    19221922    ich9pciBiosInitWriteConfig(pPciRoot, uBus, uDevFn, VBOX_PCI_PREF_BASE_UPPER32, uBase >> 32, 4);
     
    22822282    else
    22832283    {
    2284         if (uAddress + cb < 4096)
     2284        if (uAddress + cb < 4*_1K)
    22852285            LogRel(("PCI: %8s/%u: Read from extended register %d fallen back to generic code\n",
    22862286                    pPciDev->pszNameR3, pPciDev->Int.s.CTX_SUFF(pDevIns)->iInstance, uAddress));
     
    26972697        }
    26982698    }
    2699     else if (uAddress + cb <= 4096)
     2699    else if (uAddress + cb <= 4*_1K)
    27002700        LogRel(("PCI: %8s/%u: Write to extended register %d fallen back to generic code\n",
    27012701                pPciDev->pszNameR3, pPciDev->Int.s.CTX_SUFF(pDevIns)->iInstance, uAddress));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette