VirtualBox

Changeset 64454 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 28, 2016 12:39:30 PM (8 years ago)
Author:
vboxsync
Message:

DevPci: Cleaned up ich9pciConfigReadDev, eleminating unnecessary MSI and MSI-x workers.

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

Legend:

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

    r64453 r64454  
    18901890{
    18911891    NOREF(pDevIns);
     1892
    18921893    uint32_t uValue;
    1893 
    18941894    if (uAddress + cb <= 256)
    18951895    {
    1896         /* Check for MSI capabilities - not really necessary, MsiPciConfigRead does the same as below! */
    1897         if (   pciDevIsMsiCapable(pPciDev)
    1898             && uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset < (uint32_t)pPciDev->Int.s.u8MsiCapSize )
    1899             return MsiPciConfigRead(pPciDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), pPciDev, uAddress, cb);
    1900 
    1901         /* Check for MSI-X capabilities - not really necessary, MsixPciConfigRead does the same as below! */
    1902         if (   pciDevIsMsixCapable(pPciDev)
    1903             && uAddress - (uint32_t)pPciDev->Int.s.u8MsixCapOffset < (uint32_t)pPciDev->Int.s.u8MsixCapSize)
    1904             return MsixPciConfigRead(pPciDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), pPciDev, uAddress, cb);
    1905 
    19061896        switch (cb)
    19071897        {
     
    19201910                break;
    19211911        }
     1912
     1913#ifdef LOG_ENABLED
     1914        if (   pciDevIsMsiCapable(pPciDev)
     1915            && uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset < (uint32_t)pPciDev->Int.s.u8MsiCapSize )
     1916            Log2(("ich9pciConfigReadDev: MSI CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
     1917        else if (   pciDevIsMsixCapable(pPciDev)
     1918                 && uAddress - (uint32_t)pPciDev->Int.s.u8MsixCapOffset < (uint32_t)pPciDev->Int.s.u8MsixCapSize)
     1919            Log2(("ich9pciConfigReadDev: MSI-X CAP: %#x LB %u -> %#x\n", uAddress - (uint32_t)pPciDev->Int.s.u8MsiCapOffset, cb, uValue));
     1920#endif
    19221921    }
    19231922    else
  • trunk/src/VBox/Devices/Bus/MsiCommon.cpp

    r64393 r64454  
    202202}
    203203
    204 uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPDMPCIDEV pDev, uint32_t u32Address, unsigned len)
    205 {
    206     RT_NOREF1(pDevIns);
    207 #if defined(LOG_ENABLED) || defined(VBOX_STRICT)
    208     int32_t off = u32Address - pDev->Int.s.u8MsiCapOffset;
    209     Assert(off >= 0 && (pciDevIsMsiCapable(pDev) && off < pDev->Int.s.u8MsiCapSize));
    210 #endif
    211     uint32_t rv = 0;
    212 
    213     switch (len)
    214     {
    215         case 1:
    216             rv = PCIDevGetByte(pDev,  u32Address);
    217             break;
    218         case 2:
    219             rv = PCIDevGetWord(pDev,  u32Address);
    220             break;
    221         case 4:
    222             rv = PCIDevGetDWord(pDev, u32Address);
    223             break;
    224         default:
    225             Assert(false);
    226     }
    227 
    228     Log2(("MsiPciConfigRead: %d (%d) -> %x\n", off, len, rv));
    229 
    230     return rv;
    231 }
    232 
    233204int MsiInit(PPDMPCIDEV pDev, PPDMMSIREG pMsiReg)
    234205{
  • trunk/src/VBox/Devices/Bus/MsiCommon.h

    r64387 r64454  
    4242/* PCI config space accessors for MSI registers */
    4343void     MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t u32Address, uint32_t val, unsigned len);
    44 uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPDMPCIDEV pDev, uint32_t u32Address, unsigned len);
    4544#endif
    4645
     
    5958/* PCI config space accessors for MSI-X */
    6059void     MsixPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t u32Address, uint32_t val, unsigned len);
    61 uint32_t MsixPciConfigRead (PPDMDEVINS pDevIns, PPDMPCIDEV pDev, uint32_t u32Address, unsigned len);
    6260#endif
  • trunk/src/VBox/Devices/Bus/MsixCommon.cpp

    r64393 r64454  
    329329}
    330330
    331 
    332 uint32_t MsixPciConfigRead(PPDMDEVINS pDevIns, PPDMPCIDEV pDev, uint32_t u32Address, unsigned len)
    333 {
    334     NOREF(pDevIns);
    335 #if defined(LOG_ENABLED) || defined(VBOX_STRICT)
    336     int32_t iOff = u32Address - pDev->Int.s.u8MsixCapOffset;
    337     Assert(iOff >= 0 && (pciDevIsMsixCapable(pDev) && iOff < pDev->Int.s.u8MsixCapSize));
    338 #endif
    339     uint32_t rv;
    340     switch (len)
    341     {
    342         case 1:
    343             rv = PCIDevGetByte(pDev,  u32Address);
    344             break;
    345         case 2:
    346             rv = PCIDevGetWord(pDev,  u32Address);
    347             break;
    348         case 4:
    349             rv = PCIDevGetDWord(pDev, u32Address);
    350             break;
    351         default:
    352             AssertFailed();
    353             rv = 0;
    354     }
    355 
    356     Log2(("MsixPciConfigRead: %d (%d) -> %x\n", iOff, len, rv));
    357     return rv;
    358 }
    359 
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