Changeset 71769 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Apr 9, 2018 2:14:17 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121872
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/MsixCommon.cpp
r71768 r71769 102 102 } 103 103 104 DECLINLINE(bool) msixIsPending(PPDMPCIDEV pDev, uint32_t iVector) 104 #ifdef IN_RING3 105 106 DECLINLINE(bool) msixR3IsPending(PPDMPCIDEV pDev, uint32_t iVector) 105 107 { 106 108 return (*msixPendingByte(pDev, iVector) & (1 << (iVector & 0x7))) != 0; 107 109 } 108 110 109 static void msix CheckPendingVector(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t iVector)110 { 111 if (msix IsPending(pDev, iVector) && !msixIsVectorMasked(pDev, iVector))111 static void msixR3CheckPendingVector(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev, uint32_t iVector) 112 { 113 if (msixR3IsPending(pDev, iVector) && !msixIsVectorMasked(pDev, iVector)) 112 114 MsixNotify(pDevIns, pPciHlp, pDev, iVector, 1 /* iLevel */, 0 /*uTagSrc*/); 113 115 } 114 116 115 #ifdef IN_RING3116 117 117 118 PDMBOTHCBDECL(int) msixR3MMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb) … … 152 153 *(uint32_t *)msixGetPageOffset(pPciDev, off) = *(uint32_t *)pv; 153 154 154 msix CheckPendingVector(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); 155 156 return VINF_SUCCESS; 156 157 } … … 279 280 } 280 281 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 284 DECLINLINE(bool) msixR3BitJustCleared(uint32_t uOldValue, uint32_t uNewValue, uint32_t uMask) 285 { 286 return !!(uOldValue & uMask) && !(uNewValue & uMask); 287 } 288 289 290 static void msixR3CheckPendingVectors(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPDMPCIDEV pDev) 289 291 { 290 292 for (uint32_t i = 0; i < msixTableSize(pDev); i++) 291 msix CheckPendingVector(pDevIns, pPciHlp, pDev, i);293 msixR3CheckPendingVector(pDevIns, pPciHlp, pDev, i); 292 294 } 293 295 … … 321 323 u8NewVal = (u8Val & UINT8_C(~0x3f)) | (pDev->abConfig[uAddr] & UINT8_C(0x3f)); 322 324 /* If just enabled globally - check pending vectors */ 323 fJustEnabled |= msix BitJustCleared(pDev->abConfig[uAddr], u8NewVal, VBOX_PCI_MSIX_FLAGS_ENABLE >> 8);324 fJustEnabled |= msix BitJustCleared(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); 325 327 pDev->abConfig[uAddr] = u8NewVal; 326 328 break; … … 335 337 336 338 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.