Changeset 32935 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Oct 6, 2010 9:28:42 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66421
- Location:
- trunk/src/VBox/Devices/Bus
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r32860 r32935 528 528 static void ich9pciSetIrqInternal(PPCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE pPciDev, int iIrq, int iLevel) 529 529 { 530 if (M SIIsEnabled(pPciDev))530 if (MsiIsEnabled(pPciDev)) 531 531 { 532 532 Log2(("Raise a MSI interrupt: %d\n", iIrq)); 533 533 /* We only trigger MSI on level up, as technically it's matching flip-flop best (maybe even assert that level == PDM_IRQ_LEVEL_FLIP_FLOP) */ 534 534 if ((iLevel & PDM_IRQ_LEVEL_HIGH) != 0) 535 MSINotify(pGlobals->aPciBus.CTX_SUFF(pDevIns), pPciDev, iIrq); 535 { 536 PPDMDEVINS pDevIns = pGlobals->aPciBus.CTX_SUFF(pDevIns); 537 MsiNotify(pDevIns, pGlobals->aPciBus.CTX_SUFF(pPciHlp), pPciDev, iIrq); 538 } 536 539 return; 537 540 } … … 786 789 static DECLCALLBACK(int) ich9pciRegisterMsi(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PPDMMSIREG pMsiReg) 787 790 { 788 return M SIInit(pPciDev, pMsiReg);791 return MsiInit(pPciDev, pMsiReg); 789 792 } 790 793 … … 1686 1689 ) 1687 1690 { 1688 return M SIPciConfigRead(aDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), aDev, u32Address, len);1691 return MsiPciConfigRead(aDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), aDev, u32Address, len); 1689 1692 } 1690 1693 … … 1723 1726 ) 1724 1727 { 1725 MSIPciConfigWrite(aDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), aDev, u32Address, val, len); 1728 MsiPciConfigWrite(aDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pDevIns), 1729 aDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pPciHlp), 1730 aDev, u32Address, val, len); 1726 1731 return; 1727 1732 } -
trunk/src/VBox/Devices/Bus/MsiCommon.cpp
r32862 r32935 92 92 93 93 94 void M SIPciConfigWrite(PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len)94 void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len) 95 95 { 96 96 int32_t iOff = u32Address - pDev->Int.s.u8MsiCapOffset; … … 113 113 /* don't change read-only bits: 1-3,7 */ 114 114 val &= UINT32_C(~0x8e); 115 pDev->config[uAddr] &= ~val;115 pDev->config[uAddr] = val; 116 116 break; 117 117 case VBOX_MSI_CAP_MESSAGE_CONTROL + 1: … … 149 149 /* To ensure that we're no longer masked */ 150 150 pDev->config[uAddr] &= ~iBit; 151 M SINotify(pDevIns, pDev, maskUpdated*8 + iBitNum);151 MsiNotify(pDevIns, pPciHlp, pDev, maskUpdated*8 + iBitNum); 152 152 } 153 153 } … … 162 162 } 163 163 164 uint32_t M SIPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len)164 uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len) 165 165 { 166 166 int32_t iOff = u32Address - pDev->Int.s.u8MsiCapOffset; … … 172 172 { 173 173 case 1: 174 rv = PCIDevGetByte(pDev, u32Address);174 rv = PCIDevGetByte(pDev, u32Address); 175 175 break; 176 176 case 2: 177 rv = PCIDevGetWord(pDev, u32Address);177 rv = PCIDevGetWord(pDev, u32Address); 178 178 break; 179 179 case 4: … … 190 190 191 191 192 int M SIInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg)192 int MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg) 193 193 { 194 194 uint16_t cVectors = pMsiReg->cVectors; … … 225 225 226 226 227 bool M SIIsEnabled(PPCIDEVICE pDev)227 bool MsiIsEnabled(PPCIDEVICE pDev) 228 228 { 229 229 return PCIIsMsiCapable(pDev) && msiIsEnabled(pDev); 230 230 } 231 231 232 void M SINotify(PPDMDEVINS pDevIns, PPCIDEVICE pDev, int iVector)232 void MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector) 233 233 { 234 234 Log2(("MSINotify: %d\n", iVector)); … … 250 250 *upPending &= ~(1<<iVector); 251 251 252 PDMDevHlpPhysWrite(pDevIns, GCAddr, &u32Value, sizeof(u32Value)); 253 } 252 Assert(pPciHlp->pfnIoApicSendMsi != NULL); 253 pPciHlp->pfnIoApicSendMsi(pDevIns, GCAddr, u32Value); 254 } -
trunk/src/VBox/Devices/Bus/MsiCommon.h
r32860 r32935 15 15 */ 16 16 17 /* Maybe belongs to types.h */ 18 #ifdef IN_RING3 19 typedef PCPDMPCIHLPR3 PCPDMPCIHLP; 20 #endif 21 22 #ifdef IN_RING0 23 typedef PCPDMPCIHLPR0 PCPDMPCIHLP; 24 #endif 25 26 #ifdef IN_RC 27 typedef PCPDMPCIHLPRC PCPDMPCIHLP; 28 #endif 29 17 30 /* Init MSI support in the device. */ 18 int M SIInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg);31 int MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg); 19 32 20 33 /* If MSI is enabled, so that MSINotify() shall be used for notifications. */ 21 bool MSIIsEnabled(PPCIDEVICE pDev); 34 bool MsiIsEnabled(PPCIDEVICE pDev); 35 22 36 /* Device notification (aka interrupt). */ 23 void M SINotify(PPDMDEVINS pDevIns, PPCIDEVICE pDev, int iVector);37 void MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector); 24 38 25 39 /* PCI config space accessors for MSI registers */ 26 void M SIPciConfigWrite(PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len);27 uint32_t M SIPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);40 void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len); 41 uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);
Note:
See TracChangeset
for help on using the changeset viewer.