VirtualBox

Changeset 71769 in vbox for trunk/src/VBox/Devices/Bus


Ignore:
Timestamp:
Apr 9, 2018 2:14:17 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121872
Message:

Msi: Some R3 prefixes and some clenaup.

File:
1 edited

Legend:

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

    r71768 r71769  
    102102}
    103103
    104 DECLINLINE(bool)      msixIsPending(PPDMPCIDEV pDev, uint32_t iVector)
     104#ifdef IN_RING3
     105
     106DECLINLINE(bool)      msixR3IsPending(PPDMPCIDEV pDev, uint32_t iVector)
    105107{
    106108    return (*msixPendingByte(pDev, iVector) & (1 << (iVector & 0x7))) != 0;
    107109}
    108110
    109 static void msixCheckPendingVector(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t iVector)
    110 {
    111     if (msixIsPending(pDev, iVector) && !msixIsVectorMasked(pDev, iVector))
     111static void msixR3CheckPendingVector(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t iVector)
     112{
     113    if (msixR3IsPending(pDev, iVector) && !msixIsVectorMasked(pDev, iVector))
    112114        MsixNotify(pDevIns, pPciHlp, pDev, iVector, 1 /* iLevel */, 0 /*uTagSrc*/);
    113115}
    114116
    115 #ifdef IN_RING3
    116117
    117118PDMBOTHCBDECL(int) msixR3MMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
     
    152153    *(uint32_t *)msixGetPageOffset(pPciDev, off) = *(uint32_t *)pv;
    153154
    154     msixCheckPendingVector(pDevIns, (PCPDMPCIHLP)pPciDev->Int.s.pPciBusPtrR3, pPciDev, off / VBOX_MSIX_ENTRY_SIZE);
     155    msixR3CheckPendingVector(pDevIns, (PCPDMPCIHLP)pPciDev->Int.s.pPciBusPtrR3, pPciDev, off / VBOX_MSIX_ENTRY_SIZE);
    155156    return VINF_SUCCESS;
    156157}
     
    279280}
    280281
    281 DECLINLINE(bool) msixBitJustCleared(uint32_t uOldValue,
    282                                     uint32_t uNewValue,
    283                                     uint32_t uMask)
    284 {
    285     return (!!(uOldValue & uMask) && !(uNewValue & uMask));
    286 }
    287 
    288 static void msixCheckPendingVectors(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev)
     282#ifdef IN_RING3
     283
     284DECLINLINE(bool) msixR3BitJustCleared(uint32_t uOldValue, uint32_t uNewValue, uint32_t uMask)
     285{
     286    return !!(uOldValue & uMask) && !(uNewValue & uMask);
     287}
     288
     289
     290static void msixR3CheckPendingVectors(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev)
    289291{
    290292    for (uint32_t i = 0; i < msixTableSize(pDev); i++)
    291         msixCheckPendingVector(pDevIns, pPciHlp, pDev, i);
     293        msixR3CheckPendingVector(pDevIns, pPciHlp, pDev, i);
    292294}
    293295
     
    321323                u8NewVal = (u8Val & UINT8_C(~0x3f)) | (pDev->abConfig[uAddr] & UINT8_C(0x3f));
    322324                /* If just enabled globally - check pending vectors */
    323                 fJustEnabled |= msixBitJustCleared(pDev->abConfig[uAddr], u8NewVal, VBOX_PCI_MSIX_FLAGS_ENABLE >> 8);
    324                 fJustEnabled |= msixBitJustCleared(pDev->abConfig[uAddr], u8NewVal, VBOX_PCI_MSIX_FLAGS_FUNCMASK >> 8);
     325                fJustEnabled |= msixR3BitJustCleared(pDev->abConfig[uAddr], u8NewVal, VBOX_PCI_MSIX_FLAGS_ENABLE >> 8);
     326                fJustEnabled |= msixR3BitJustCleared(pDev->abConfig[uAddr], u8NewVal, VBOX_PCI_MSIX_FLAGS_FUNCMASK >> 8);
    325327                pDev->abConfig[uAddr] = u8NewVal;
    326328                break;
     
    335337
    336338    if (fJustEnabled)
    337         msixCheckPendingVectors(pDevIns, pPciHlp, pDev);
    338 }
    339 
     339        msixR3CheckPendingVectors(pDevIns, pPciHlp, pDev);
     340}
     341
     342#endif /* IN_RING3 */
Note: See TracChangeset for help on using the changeset viewer.

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