VirtualBox

Changeset 36716 in vbox


Ignore:
Timestamp:
Apr 18, 2011 2:17:17 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71232
Message:

PCI: 64-bit BARs tweaks, release logs on device attach, allow extended register space access

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pci.h

    r36678 r36716  
    10491049    }
    10501050
     1051    PciBusAddress(int32_t iAddr)
     1052    {
     1053        clear();
     1054        fromLong(iAddr);
     1055    }
     1056
    10511057    PciBusAddress& clear()
    10521058    {
     
    11401146        return true;
    11411147    }
     1148
     1149    static const size_t cMaxAddrSize = 10;
    11421150};
    11431151#endif /* __cplusplus */
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r36678 r36716  
    299299    int rc = VINF_SUCCESS;
    300300
    301     if (pAddr->iRegister > 0xff)
    302     {
    303         LogRel(("PCI: attempt to write extended register: %x (%d) <- val\n", pAddr->iRegister, cb, val));
    304         goto out;
    305     }
    306 
    307301    if (pAddr->iBus != 0)
    308302    {
     
    403397{
    404398    int rc = VINF_SUCCESS;
    405 
    406     if (pPciAddr->iRegister > 0xff)
    407     {
    408         LogRel(("PCI: attempt to read extended register: %x\n", pPciAddr->iRegister));
    409         ich9pciNoMem(pu32, cb);
    410         goto out;
    411     }
    412 
    413399
    414400    if (pPciAddr->iBus != 0)
     
    949935         pPciDev->name, iRegion, cbRegion, enmType));
    950936
     937    /* Make sure that we haven't marked this region as continuation of 64-bit region. */
     938    Assert(pPciDev->Int.s.aIORegions[iRegion].type != 0xff);
     939
    951940    /*
    952941     * Register the I/O region.
     
    957946    pRegion->type        = enmType;
    958947    pRegion->map_func    = pfnCallback;
     948
     949    if ((enmType & PCI_ADDRESS_SPACE_BAR64) != 0)
     950    {
     951        AssertMsgReturn(iRegion  < 4,
     952                        ("Region %d cannot be 64-bit\n", iRegion),
     953                        VERR_INVALID_PARAMETER);
     954        /* Mark next region as continuation of this one. */
     955        pPciDev->Int.s.aIORegions[iRegion+1].type = 0xff;
     956    }
    959957
    960958    /* Set type in the PCI config space. */
     
    19111909{
    19121910    PCIIORegion * pRegion = &aDev->Int.s.aIORegions[iRegion];
    1913 
    1914     int iRegionSize = pRegion->size;
     1911    int64_t iRegionSize = pRegion->size;
    19151912
    19161913    Log3(("ich9pciWriteBarByte: region=%d off=%d val=%x size=%d\n",
    19171914         iRegion, iOffset, u8Val, iRegionSize));
     1915
     1916    if (iOffset > 3)
     1917        Assert((aDev->Int.s.aIORegions[iRegion].type & PCI_ADDRESS_SPACE_BAR64) != 0);
     1918
     1919    /* Check if we're writing to upper part of 64-bit BAR. */
     1920    if (aDev->Int.s.aIORegions[iRegion].type == 0xff)
     1921    {
     1922        ich9pciWriteBarByte(aDev, iRegion-1, iOffset+4, u8Val);
     1923        return;
     1924    }
    19181925
    19191926    /* Region doesn't exist */
     
    19241931    /* Region size must be power of two */
    19251932    Assert((iRegionSize & (iRegionSize - 1)) == 0);
    1926     uint8_t uMask = (((uint32_t)iRegionSize - 1) >> (iOffset*8) ) & 0xff;
     1933    uint8_t uMask = ((iRegionSize - 1) >> (iOffset*8) ) & 0xff;
    19271934
    19281935    if (iOffset == 0)
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