Changeset 42431 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 27, 2012 8:22:29 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79534
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
r40112 r42431 514 514 515 515 516 /** @todo r=bird: Why aren't these static? And why use DECLCALLBACK for 517 * internal functions? */ 516 518 DECLCALLBACK(int) hdaRegReadUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value); 517 519 DECLCALLBACK(int) hdaRegWriteUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t pu32Value); … … 552 554 DECLCALLBACK(int) hdaRegWriteU8(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t pu32Value); 553 555 554 static inline voidhdaInitTransferDescriptor(PINTELHDLinkState pState, PHDABDLEDESC pBdle, uint8_t u8Strm, PHDASTREAMTRANSFERDESC pStreamDesc);556 DECLINLINE(void) hdaInitTransferDescriptor(PINTELHDLinkState pState, PHDABDLEDESC pBdle, uint8_t u8Strm, PHDASTREAMTRANSFERDESC pStreamDesc); 555 557 static int hdaMMIORegLookup(INTELHDLinkState* pState, uint32_t u32Offset); 556 558 static void hdaFetchBdle(INTELHDLinkState *pState, PHDABDLEDESC pBdle, PHDASTREAMTRANSFERDESC pStreamDesc); … … 953 955 954 956 955 DECLCALLBACK(int) hdaRegReadUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)957 DECLCALLBACK(int) hdaRegReadUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 956 958 { 957 959 *pu32Value = 0; 958 960 return VINF_SUCCESS; 959 961 } 960 DECLCALLBACK(int) hdaRegWriteUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)962 DECLCALLBACK(int) hdaRegWriteUnimplemented(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 961 963 { 962 964 return VINF_SUCCESS; 963 965 } 964 966 /* U8 */ 965 DECLCALLBACK(int) hdaRegReadU8(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)967 DECLCALLBACK(int) hdaRegReadU8(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 966 968 { 967 969 Assert(((pState->au32Regs[index] & s_ichIntelHDRegMap[index].readable) & 0xffffff00) == 0); … … 969 971 } 970 972 971 DECLCALLBACK(int) hdaRegWriteU8(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)973 DECLCALLBACK(int) hdaRegWriteU8(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 972 974 { 973 975 Assert(((u32Value & 0xffffff00) == 0)); … … 975 977 } 976 978 /* U16 */ 977 DECLCALLBACK(int) hdaRegReadU16(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)979 DECLCALLBACK(int) hdaRegReadU16(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 978 980 { 979 981 Assert(((pState->au32Regs[index] & s_ichIntelHDRegMap[index].readable) & 0xffff0000) == 0); … … 981 983 } 982 984 983 DECLCALLBACK(int) hdaRegWriteU16(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)985 DECLCALLBACK(int) hdaRegWriteU16(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 984 986 { 985 987 Assert(((u32Value & 0xffff0000) == 0)); … … 988 990 989 991 /* U24 */ 990 DECLCALLBACK(int) hdaRegReadU24(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)992 DECLCALLBACK(int) hdaRegReadU24(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 991 993 { 992 994 Assert(((pState->au32Regs[index] & s_ichIntelHDRegMap[index].readable) & 0xff000000) == 0); … … 994 996 } 995 997 996 DECLCALLBACK(int) hdaRegWriteU24(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)998 DECLCALLBACK(int) hdaRegWriteU24(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 997 999 { 998 1000 Assert(((u32Value & 0xff000000) == 0)); … … 1000 1002 } 1001 1003 /* U32 */ 1002 DECLCALLBACK(int) hdaRegReadU32(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1004 DECLCALLBACK(int) hdaRegReadU32(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1003 1005 { 1004 1006 *pu32Value = pState->au32Regs[index] & s_ichIntelHDRegMap[index].readable; … … 1006 1008 } 1007 1009 1008 DECLCALLBACK(int) hdaRegWriteU32(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1010 DECLCALLBACK(int) hdaRegWriteU32(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1009 1011 { 1010 1012 pState->au32Regs[index] = (u32Value & s_ichIntelHDRegMap[index].writable) … … 1013 1015 } 1014 1016 1015 DECLCALLBACK(int) hdaRegReadGCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1017 DECLCALLBACK(int) hdaRegReadGCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1016 1018 { 1017 1019 return hdaRegReadU32(pState, offset, index, pu32Value); 1018 1020 } 1019 1021 1020 DECLCALLBACK(int) hdaRegWriteGCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1022 DECLCALLBACK(int) hdaRegWriteGCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1021 1023 { 1022 1024 if (u32Value & HDA_REG_FIELD_FLAG_MASK(GCTL, RST)) … … 1049 1051 } 1050 1052 1051 DECLCALLBACK(int) hdaRegWriteSTATESTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1053 DECLCALLBACK(int) hdaRegWriteSTATESTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1052 1054 { 1053 1055 uint32_t v = pState->au32Regs[index]; … … 1057 1059 } 1058 1060 1059 DECLCALLBACK(int) hdaRegReadINTSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1061 DECLCALLBACK(int) hdaRegReadINTSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1060 1062 { 1061 1063 uint32_t v = 0; … … 1083 1085 } 1084 1086 1085 DECLCALLBACK(int) hdaRegReadWALCLK(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1087 DECLCALLBACK(int) hdaRegReadWALCLK(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1086 1088 { 1087 1089 /* HDA spec (1a): 3.3.16 WALCLK counter ticks with 24Mhz bitclock rate. */ … … 1090 1092 } 1091 1093 1092 DECLCALLBACK(int) hdaRegReadGCAP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1094 DECLCALLBACK(int) hdaRegReadGCAP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1093 1095 { 1094 1096 return hdaRegReadU16(pState, offset, index, pu32Value); 1095 1097 } 1096 1098 1097 DECLCALLBACK(int) hdaRegWriteCORBRP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1099 DECLCALLBACK(int) hdaRegWriteCORBRP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1098 1100 { 1099 1101 if (u32Value & HDA_REG_FIELD_FLAG_MASK(CORBRP, RST)) … … 1104 1106 } 1105 1107 1106 DECLCALLBACK(int) hdaRegWriteCORBCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1108 DECLCALLBACK(int) hdaRegWriteCORBCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1107 1109 { 1108 1110 int rc = hdaRegWriteU8(pState, offset, index, u32Value); … … 1114 1116 } 1115 1117 1116 DECLCALLBACK(int) hdaRegWriteCORBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1118 DECLCALLBACK(int) hdaRegWriteCORBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1117 1119 { 1118 1120 uint32_t v = CORBSTS(pState); … … 1121 1123 } 1122 1124 1123 DECLCALLBACK(int) hdaRegWriteCORBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1125 DECLCALLBACK(int) hdaRegWriteCORBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1124 1126 { 1125 1127 int rc; … … 1135 1137 } 1136 1138 1137 DECLCALLBACK(int) hdaRegReadSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1139 DECLCALLBACK(int) hdaRegReadSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1138 1140 { 1139 1141 return hdaRegReadU24(pState, offset, index, pu32Value); 1140 1142 } 1141 1143 1142 DECLCALLBACK(int) hdaRegWriteSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1144 DECLCALLBACK(int) hdaRegWriteSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1143 1145 { 1144 1146 bool fRun = RT_BOOL((u32Value & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN))); … … 1211 1213 } 1212 1214 1213 DECLCALLBACK(int) hdaRegWriteSDSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1215 DECLCALLBACK(int) hdaRegWriteSDSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1214 1216 { 1215 1217 uint32_t v = HDA_REG_IND(pState, index); … … 1220 1222 } 1221 1223 1222 DECLCALLBACK(int) hdaRegWriteSDLVI(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1224 DECLCALLBACK(int) hdaRegWriteSDLVI(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1223 1225 { 1224 1226 int rc = hdaRegWriteU32(pState, offset, index, u32Value); … … 1228 1230 } 1229 1231 1230 DECLCALLBACK(int) hdaRegWriteSDFIFOW(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1232 DECLCALLBACK(int) hdaRegWriteSDFIFOW(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1231 1233 { 1232 1234 switch (u32Value) … … 1246 1248 * 1247 1249 */ 1248 DECLCALLBACK(int) hdaRegWriteSDFIFOS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1250 DECLCALLBACK(int) hdaRegWriteSDFIFOS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1249 1251 { 1250 1252 switch (index) … … 1340 1342 } 1341 1343 1342 DECLCALLBACK(int) hdaRegWriteSDFMT(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1344 DECLCALLBACK(int) hdaRegWriteSDFMT(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1343 1345 { 1344 1346 #ifdef VBOX_WITH_HDA_CODEC_EMU … … 1368 1370 } 1369 1371 1370 DECLCALLBACK(int) hdaRegWriteSDBDPL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1372 DECLCALLBACK(int) hdaRegWriteSDBDPL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1371 1373 { 1372 1374 int rc = hdaRegWriteU32(pState, offset, index, u32Value); … … 1376 1378 } 1377 1379 1378 DECLCALLBACK(int) hdaRegWriteSDBDPU(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1380 DECLCALLBACK(int) hdaRegWriteSDBDPU(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1379 1381 { 1380 1382 int rc = hdaRegWriteU32(pState, offset, index, u32Value); … … 1384 1386 } 1385 1387 1386 DECLCALLBACK(int) hdaRegReadIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value)1388 DECLCALLBACK(int) hdaRegReadIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1387 1389 { 1388 1390 int rc = VINF_SUCCESS; … … 1396 1398 } 1397 1399 1398 DECLCALLBACK(int) hdaRegWriteIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1400 DECLCALLBACK(int) hdaRegWriteIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1399 1401 { 1400 1402 int rc = VINF_SUCCESS; … … 1440 1442 } 1441 1443 1442 DECLCALLBACK(int) hdaRegWriteRIRBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1444 DECLCALLBACK(int) hdaRegWriteRIRBWP(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1443 1445 { 1444 1446 if (u32Value & HDA_REG_FIELD_FLAG_MASK(RIRBWP, RST)) … … 1450 1452 } 1451 1453 1452 DECLCALLBACK(int) hdaRegWriteBase(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1454 DECLCALLBACK(int) hdaRegWriteBase(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1453 1455 { 1454 1456 int rc = hdaRegWriteU32(pState, offset, index, u32Value); … … 1489 1491 } 1490 1492 1491 DECLCALLBACK(int) hdaRegWriteRIRBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value)1493 DECLCALLBACK(int) hdaRegWriteRIRBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1492 1494 { 1493 1495 uint8_t v = RIRBSTS(pState); … … 1568 1570 } 1569 1571 1570 static inline voidhdaBackendWriteTransferReported(PHDABDLEDESC pBdle, uint32_t cbArranged2Copy, uint32_t cbCopied, uint32_t *pu32DMACursor, uint32_t *pu32BackendBufferCapacity)1572 DECLINLINE(void) hdaBackendWriteTransferReported(PHDABDLEDESC pBdle, uint32_t cbArranged2Copy, uint32_t cbCopied, uint32_t *pu32DMACursor, uint32_t *pu32BackendBufferCapacity) 1571 1573 { 1572 1574 Log(("hda:hdaBackendWriteTransferReported: cbArranged2Copy: %d, cbCopied: %d, pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n", … … 1598 1600 } 1599 1601 1600 static inline voidhdaBackendReadTransferReported(PHDABDLEDESC pBdle, uint32_t cbArranged2Copy, uint32_t cbCopied, uint32_t *pu32DMACursor, uint32_t *pu32BackendBufferCapacity)1602 DECLINLINE(void) hdaBackendReadTransferReported(PHDABDLEDESC pBdle, uint32_t cbArranged2Copy, uint32_t cbCopied, uint32_t *pu32DMACursor, uint32_t *pu32BackendBufferCapacity) 1601 1603 { 1602 1604 Assert((cbCopied, cbArranged2Copy)); … … 1610 1612 } 1611 1613 1612 static inline voidhdaBackendTransferUnreported(INTELHDLinkState *pState, PHDABDLEDESC pBdle, PHDASTREAMTRANSFERDESC pStreamDesc, uint32_t cbCopied, uint32_t *pu32BackendBufferCapacity)1614 DECLINLINE(void) hdaBackendTransferUnreported(INTELHDLinkState *pState, PHDABDLEDESC pBdle, PHDASTREAMTRANSFERDESC pStreamDesc, uint32_t cbCopied, uint32_t *pu32BackendBufferCapacity) 1613 1615 { 1614 1616 Log(("hda:hdaBackendTransferUnreported: CVI (cbUnderFifoW:%d, pos:%d, len:%d)\n", pBdle->cbUnderFifoW, pBdle->u32BdleCviPos, pBdle->u32BdleCviLen)); … … 1644 1646 } 1645 1647 1646 static inline voidhdaStreamCounterUpdate(PINTELHDLinkState pState, PHDABDLEDESC pBdle, PHDASTREAMTRANSFERDESC pStreamDesc, uint32_t cbInc)1648 DECLINLINE(void) hdaStreamCounterUpdate(PINTELHDLinkState pState, PHDABDLEDESC pBdle, PHDASTREAMTRANSFERDESC pStreamDesc, uint32_t cbInc) 1647 1649 { 1648 1650 /* … … 1789 1791 } 1790 1792 1791 static inline voidhdaInitTransferDescriptor(PINTELHDLinkState pState, PHDABDLEDESC pBdle, uint8_t u8Strm, PHDASTREAMTRANSFERDESC pStreamDesc)1793 DECLINLINE(void) hdaInitTransferDescriptor(PINTELHDLinkState pState, PHDABDLEDESC pBdle, uint8_t u8Strm, PHDASTREAMTRANSFERDESC pStreamDesc) 1792 1794 { 1793 1795 Assert(( pState … … 2272 2274 } 2273 2275 2274 static inline inthdaLookUpRegisterByName(INTELHDLinkState *pState, const char *pszArgs)2276 DECLINLINE(int) hdaLookUpRegisterByName(INTELHDLinkState *pState, const char *pszArgs) 2275 2277 { 2276 2278 int iReg = 0; … … 2280 2282 return -1; 2281 2283 } 2282 static inline voidhdaDbgPrintRegister(INTELHDLinkState *pState, PCDBGFINFOHLP pHlp, int iHdaIndex)2284 DECLINLINE(void) hdaDbgPrintRegister(INTELHDLinkState *pState, PCDBGFINFOHLP pHlp, int iHdaIndex) 2283 2285 { 2284 2286 Assert( pState … … 2299 2301 } 2300 2302 2301 static inline voidhdaDbgPrintStream(INTELHDLinkState *pState, PCDBGFINFOHLP pHlp, int iHdaStrmIndex)2303 DECLINLINE(void) hdaDbgPrintStream(INTELHDLinkState *pState, PCDBGFINFOHLP pHlp, int iHdaStrmIndex) 2302 2304 { 2303 2305 Assert( pState … … 2311 2313 } 2312 2314 2313 static inline inthdaLookUpStreamIndex(INTELHDLinkState *pState, const char *pszArgs)2315 DECLINLINE(int) hdaLookUpStreamIndex(INTELHDLinkState *pState, const char *pszArgs) 2314 2316 { 2315 2317 /* todo: add args parsing */ … … 2459 2461 * This routine registers debugger info extensions and custom printf formatters 2460 2462 */ 2461 static inline inthdaInitMisc(PPDMDEVINS pDevIns)2463 DECLINLINE(int) hdaInitMisc(PPDMDEVINS pDevIns) 2462 2464 { 2463 2465 int rc; -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r42190 r42431 240 240 } 241 241 242 DECLINLINE(int) tftpSessionParseAndMarkOption(const char *pcszRawOption, PTFPTPSESSIONOPTDESC pTftpSessionOption)242 DECLINLINE(int) tftpSessionParseAndMarkOption(const char *pcszRawOption, PTFPTPSESSIONOPTDESC pTftpSessionOption) 243 243 { 244 244 int rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.