Changeset 36663 in vbox for trunk/src/VBox
- Timestamp:
- Apr 13, 2011 3:57:33 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71145
- Location:
- trunk/src/VBox/Devices/Bus
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r36288 r36663 891 891 892 892 rc = MsiInit(pPciDev, pMsiReg); 893 if ( rc != VINF_SUCCESS)893 if (RT_FAILURE(rc)) 894 894 return rc; 895 895 896 896 rc = MsixInit(pPciDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pPciHlp), pPciDev, pMsiReg); 897 if ( rc != VINF_SUCCESS)897 if (RT_FAILURE(rc)) 898 898 return rc; 899 899 900 return rc;900 return VINF_SUCCESS; 901 901 } 902 902 … … 1874 1874 if ((u32Address + len) > 256 && (u32Address + len) < 4096) 1875 1875 { 1876 AssertMsgReturn(false, ("Read from extended registers falle dback to generic code\n"), 0);1877 } 1878 1879 AssertMsgReturn(u32Address + len <= 256, ("Read after end of PCI config space\n"),1876 AssertMsgReturn(false, ("Read from extended registers fallen back to generic code\n"), 0); 1877 } 1878 1879 AssertMsgReturn(u32Address + len <= 256, ("Read after the end of PCI config space\n"), 1880 1880 0); 1881 1881 if ( pciDevIsMsiCapable(aDev) … … 1956 1956 if ((u32Address + len) > 256 && (u32Address + len) < 4096) 1957 1957 { 1958 AssertMsgReturnVoid(false, ("Write to extended registers falle dback to generic code\n"));1958 AssertMsgReturnVoid(false, ("Write to extended registers fallen back to generic code\n")); 1959 1959 } 1960 1960 -
trunk/src/VBox/Devices/Bus/MsiCommon.cpp
r36574 r36663 102 102 } 103 103 104 104 #ifdef IN_RING3 105 105 void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len) 106 106 { … … 214 214 } 215 215 216 217 216 int MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg) 218 217 { 219 218 if (pMsiReg->cMsiVectors == 0) 220 219 return VINF_SUCCESS; 220 221 /* We cannot init MSI on raw devices yet. */ 222 Assert(!pciDevIsPassthrough(pDev)); 221 223 222 224 uint16_t cVectors = pMsiReg->cMsiVectors; … … 261 263 } 262 264 265 #endif /* IN_RING3 */ 266 263 267 264 268 bool MsiIsEnabled(PPCIDEVICE pDev) -
trunk/src/VBox/Devices/Bus/MsiCommon.h
r33315 r36663 28 28 #endif 29 29 30 #ifdef IN_RING3 30 31 /* Init MSI support in the device. */ 31 32 int MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg); 33 #endif 32 34 33 35 /* If MSI is enabled, so that MSINotify() shall be used for notifications. */ … … 37 39 void MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel); 38 40 41 #ifdef IN_RING3 39 42 /* PCI config space accessors for MSI registers */ 40 43 void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len); 41 44 uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len); 45 #endif 42 46 43 47 #ifdef IN_RING3 44 48 /* Init MSI-X support in the device. */ 45 #ifdef IN_RING346 49 int MsixInit(PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, PPDMMSIREG pMsiReg); 47 50 #endif … … 53 56 void MsixNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel); 54 57 58 #ifdef IN_RING3 55 59 /* PCI config space accessors for MSI-X */ 56 60 void MsixPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len); 57 61 uint32_t MsixPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len); 62 #endif -
trunk/src/VBox/Devices/Bus/MsixCommon.cpp
r36574 r36663 167 167 return VINF_SUCCESS; 168 168 169 uint16_t cVectors = pMsiReg->cMsixVectors; 169 /* We cannot init MSI-X on raw devices yet. */ 170 Assert(!pciDevIsPassthrough(pDev)); 171 172 uint16_t cVectors = pMsiReg->cMsixVectors; 170 173 uint8_t iCapOffset = pMsiReg->iMsixCapOffset; 171 174 uint8_t iNextOffset = pMsiReg->iMsixNextOffset; … … 173 176 174 177 if (cVectors > VBOX_MSIX_MAX_ENTRIES) 178 { 179 AssertMsgFailed(("Too many MSI-X vectors: %d\n", cVectors)); 175 180 return VERR_TOO_MUCH_DATA; 181 } 176 182 177 183 if (iBar > 5) 184 { 185 AssertMsgFailed(("Using wrong BAR for MSI-X: %d\n", iBar)); 178 186 return VERR_INVALID_PARAMETER; 187 } 179 188 180 189 Assert(iCapOffset != 0 && iCapOffset < 0xff && iNextOffset < 0xff); 181 190 182 int rc; 183 184 rc = PDMDevHlpPCIIORegionRegister (pDev->pDevIns, iBar, 0x1000, PCI_ADDRESS_SPACE_MEM, msixMap); 185 if (RT_FAILURE (rc)) 186 return rc; 191 int rc = VINF_SUCCESS; 192 193 /* If device is passthrough, BAR is registered using common mechanism. */ 194 if (!pciDevIsPassthrough(pDev)) 195 { 196 rc = PDMDevHlpPCIIORegionRegister (pDev->pDevIns, iBar, 0x1000, PCI_ADDRESS_SPACE_MEM, msixMap); 197 if (RT_FAILURE (rc)) 198 return rc; 199 } 187 200 188 201 pDev->Int.s.u8MsixCapOffset = iCapOffset;
Note:
See TracChangeset
for help on using the changeset viewer.