Changeset 82382 in vbox
- Timestamp:
- Dec 4, 2019 1:12:29 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135216
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82345 r82382 266 266 * @{ 267 267 */ 268 static int hdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);269 static int hdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);268 static FNHDAREGREAD hdaRegReadUnimpl; 269 static FNHDAREGWRITE hdaRegWriteUnimpl; 270 270 /** @} */ 271 271 … … 273 273 * @{ 274 274 */ 275 static int hdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);276 static int hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);277 static int hdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);278 static int hdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);279 static int hdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);280 static int hdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);281 static int hdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);282 static int hdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);283 static int hdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);284 static int hdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);285 static int hdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);286 static int hdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);287 static int hdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);288 static int hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);289 static int hdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);275 static FNHDAREGWRITE hdaRegWriteGCTL; 276 static FNHDAREGREAD hdaRegReadLPIB; 277 static FNHDAREGREAD hdaRegReadWALCLK; 278 static FNHDAREGWRITE hdaRegWriteCORBWP; 279 static FNHDAREGWRITE hdaRegWriteCORBRP; 280 static FNHDAREGWRITE hdaRegWriteCORBCTL; 281 static FNHDAREGWRITE hdaRegWriteCORBSIZE; 282 static FNHDAREGWRITE hdaRegWriteCORBSTS; 283 static FNHDAREGWRITE hdaRegWriteRINTCNT; 284 static FNHDAREGWRITE hdaRegWriteRIRBWP; 285 static FNHDAREGWRITE hdaRegWriteRIRBSTS; 286 static FNHDAREGWRITE hdaRegWriteSTATESTS; 287 static FNHDAREGWRITE hdaRegWriteIRS; 288 static FNHDAREGREAD hdaRegReadIRS; 289 static FNHDAREGWRITE hdaRegWriteBase; 290 290 /** @} */ 291 291 … … 293 293 * @{ 294 294 */ 295 static int hdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);296 static int hdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);297 static int hdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);298 static int hdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);299 static int hdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);300 static int hdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);301 static int hdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);302 static int hdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);303 static int hdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);295 static FNHDAREGWRITE hdaRegWriteSDCBL; 296 static FNHDAREGWRITE hdaRegWriteSDCTL; 297 static FNHDAREGWRITE hdaRegWriteSDSTS; 298 static FNHDAREGWRITE hdaRegWriteSDLVI; 299 static FNHDAREGWRITE hdaRegWriteSDFIFOW; 300 static FNHDAREGWRITE hdaRegWriteSDFIFOS; 301 static FNHDAREGWRITE hdaRegWriteSDFMT; 302 static FNHDAREGWRITE hdaRegWriteSDBDPL; 303 static FNHDAREGWRITE hdaRegWriteSDBDPU; 304 304 /** @} */ 305 305 … … 307 307 * @{ 308 308 */ 309 static int hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);310 static int hdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);311 static int hdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);309 static FNHDAREGREAD hdaRegReadU32; 310 static FNHDAREGWRITE hdaRegWriteU32; 311 static FNHDAREGREAD hdaRegReadU24; 312 312 #ifdef IN_RING3 313 static int hdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);313 static FNHDAREGWRITE hdaRegWriteU24; 314 314 #endif 315 static int hdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);316 static int hdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);317 static int hdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);318 static int hdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);315 static FNHDAREGREAD hdaRegReadU16; 316 static FNHDAREGWRITE hdaRegWriteU16; 317 static FNHDAREGREAD hdaRegReadU8; 318 static FNHDAREGWRITE hdaRegWriteU8; 319 319 /** @} */ 320 320 … … 326 326 static int hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg); 327 327 # ifdef HDA_USE_DMA_ACCESS_HANDLER 328 static DECLCALLBACK(VBOXSTRICTRC) hdaR3D MAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,328 static DECLCALLBACK(VBOXSTRICTRC) hdaR3DmaAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, 329 329 void *pvBuf, size_t cbBuf, 330 330 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser); … … 386 386 HDA_REG_MAP_STRM(HDA_REG_DESC_SD0_BASE + (index * 32 /* 0x20 */), name) 387 387 388 /* See 302349 p 6.2. */388 /** See 302349 p 6.2. */ 389 389 const HDAREGDESC g_aHdaRegMap[HDA_NUM_REGS] = 390 390 { … … 899 899 /* Register access handlers. */ 900 900 901 static inthdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)901 static VBOXSTRICTRC hdaRegReadUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 902 902 { 903 903 RT_NOREF(pDevIns, pThis, iReg); … … 906 906 } 907 907 908 static inthdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)908 static VBOXSTRICTRC hdaRegWriteUnimpl(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 909 909 { 910 910 RT_NOREF(pDevIns, pThis, iReg, u32Value); … … 913 913 914 914 /* U8 */ 915 static inthdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)915 static VBOXSTRICTRC hdaRegReadU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 916 916 { 917 917 Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffffff00) == 0); … … 919 919 } 920 920 921 static inthdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)921 static VBOXSTRICTRC hdaRegWriteU8(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 922 922 { 923 923 Assert((u32Value & 0xffffff00) == 0); … … 926 926 927 927 /* U16 */ 928 static inthdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)928 static VBOXSTRICTRC hdaRegReadU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 929 929 { 930 930 Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffff0000) == 0); … … 932 932 } 933 933 934 static inthdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)934 static VBOXSTRICTRC hdaRegWriteU16(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 935 935 { 936 936 Assert((u32Value & 0xffff0000) == 0); … … 939 939 940 940 /* U24 */ 941 static inthdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)941 static VBOXSTRICTRC hdaRegReadU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 942 942 { 943 943 Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xff000000) == 0); … … 946 946 947 947 #ifdef IN_RING3 948 static inthdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)948 static VBOXSTRICTRC hdaRegWriteU24(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 949 949 { 950 950 Assert((u32Value & 0xff000000) == 0); … … 954 954 955 955 /* U32 */ 956 static inthdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)956 static VBOXSTRICTRC hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 957 957 { 958 958 uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; … … 966 966 } 967 967 968 static inthdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)968 static VBOXSTRICTRC hdaRegWriteU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 969 969 { 970 970 uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; … … 978 978 } 979 979 980 static inthdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)980 static VBOXSTRICTRC hdaRegWriteGCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 981 981 { 982 982 RT_NOREF_PV(iReg); … … 1023 1023 } 1024 1024 1025 static inthdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1025 static VBOXSTRICTRC hdaRegWriteSTATESTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1026 1026 { 1027 1027 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 1036 1036 } 1037 1037 1038 static inthdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)1038 static VBOXSTRICTRC hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 1039 1039 { 1040 1040 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ); … … 1094 1094 #endif /* IN_RING3 */ 1095 1095 1096 static inthdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)1096 static VBOXSTRICTRC hdaRegReadWALCLK(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 1097 1097 { 1098 1098 #ifdef IN_RING3 … … 1113 1113 } 1114 1114 1115 static inthdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1115 static VBOXSTRICTRC hdaRegWriteCORBRP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1116 1116 { 1117 1117 RT_NOREF(iReg); … … 1143 1143 } 1144 1144 1145 static inthdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1145 static VBOXSTRICTRC hdaRegWriteCORBCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1146 1146 { 1147 1147 #ifdef IN_RING3 1148 1148 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); 1149 1149 1150 intrc = hdaRegWriteU8(pDevIns, pThis, iReg, u32Value);1150 VBOXSTRICTRC rc = hdaRegWriteU8(pDevIns, pThis, iReg, u32Value); 1151 1151 AssertRC(rc); 1152 1152 1153 1153 if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Start DMA engine. */ 1154 {1155 1154 rc = hdaR3CORBCmdProcess(pThis); 1156 }1157 1155 else 1158 1156 LogFunc(("CORB DMA not running, skipping\n")); … … 1166 1164 } 1167 1165 1168 static inthdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1166 static VBOXSTRICTRC hdaRegWriteCORBSIZE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1169 1167 { 1170 1168 #ifdef IN_RING3 … … 1226 1224 } 1227 1225 1228 static inthdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1226 static VBOXSTRICTRC hdaRegWriteCORBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1229 1227 { 1230 1228 RT_NOREF_PV(iReg); … … 1238 1236 } 1239 1237 1240 static inthdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1238 static VBOXSTRICTRC hdaRegWriteCORBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1241 1239 { 1242 1240 #ifdef IN_RING3 1243 1241 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); 1244 1242 1245 intrc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);1246 AssertRCSuccess( rc);1243 VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value); 1244 AssertRCSuccess(VBOXSTRICTRC_VAL(rc)); 1247 1245 1248 1246 rc = hdaR3CORBCmdProcess(pThis); … … 1256 1254 } 1257 1255 1258 static inthdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1256 static VBOXSTRICTRC hdaRegWriteSDCBL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1259 1257 { 1260 1258 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); 1261 1259 1262 intrc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);1263 AssertRCSuccess( rc);1260 VBOXSTRICTRC rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value); 1261 AssertRCSuccess(VBOXSTRICTRC_VAL(rc)); 1264 1262 1265 1263 DEVHDA_UNLOCK(pDevIns, pThis); … … 1267 1265 } 1268 1266 1269 static inthdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1267 static VBOXSTRICTRC hdaRegWriteSDCTL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1270 1268 { 1271 1269 #ifdef IN_RING3 … … 1454 1452 } 1455 1453 1456 intrc2 = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value);1457 AssertRC( rc2);1454 VBOXSTRICTRC rc2 = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value); 1455 AssertRC(VBOXSTRICTRC_VAL(rc2)); 1458 1456 1459 1457 DEVHDA_UNLOCK_BOTH(pDevIns, pThis, pStream); … … 1465 1463 } 1466 1464 1467 static inthdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1465 static VBOXSTRICTRC hdaRegWriteSDSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1468 1466 { 1469 1467 #ifdef IN_RING3 … … 1580 1578 } 1581 1579 1582 static inthdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1580 static VBOXSTRICTRC hdaRegWriteSDLVI(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1583 1581 { 1584 1582 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 1604 1602 ("LVI for stream #%RU8 must not be bigger than %RU8\n", uSD, UINT8_MAX - 1)); 1605 1603 1606 intrc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);1607 AssertRC( rc2);1604 VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value); 1605 AssertRC(VBOXSTRICTRC_VAL(rc2)); 1608 1606 1609 1607 DEVHDA_UNLOCK(pDevIns, pThis); … … 1611 1609 } 1612 1610 1613 static inthdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1611 static VBOXSTRICTRC hdaRegWriteSDFIFOW(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1614 1612 { 1615 1613 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 1657 1655 LogFunc(("[SD%RU8] Updating FIFOW to %RU32 bytes\n", uSD, pStream->u16FIFOW)); 1658 1656 1659 intrc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOW);1660 AssertRC( rc2);1657 VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOW); 1658 AssertRC(VBOXSTRICTRC_VAL(rc2)); 1661 1659 } 1662 1660 … … 1668 1666 * @note This method could be called for changing value on Output Streams only (ICH6 datasheet 18.2.39). 1669 1667 */ 1670 static inthdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1668 static VBOXSTRICTRC hdaRegWriteSDFIFOS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1671 1669 { 1672 1670 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 1701 1699 } 1702 1700 1703 intrc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOS);1704 AssertRC( rc2);1701 VBOXSTRICTRC rc2 = hdaRegWriteU16(pDevIns, pThis, iReg, u32FIFOS); 1702 AssertRC(VBOXSTRICTRC_VAL(rc2)); 1705 1703 1706 1704 DEVHDA_UNLOCK(pDevIns, pThis); … … 1988 1986 #endif /* IN_RING3 */ 1989 1987 1990 static inthdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)1988 static VBOXSTRICTRC hdaRegWriteSDFMT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 1991 1989 { 1992 1990 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 1999 1997 * When ignoring those (invalid) formats, this leads to MacOS thinking that the device is malfunctioning 2000 1998 * and therefore disabling the device completely. */ 2001 intrc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);2002 AssertRC( rc);1999 VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value); 2000 AssertRC(VBOXSTRICTRC_VAL(rc)); 2003 2001 2004 2002 DEVHDA_UNLOCK(pDevIns, pThis); 2005 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ 2003 return VINF_SUCCESS; /* Always return success to the MMIO handler. */ /** @todo r=bird: This is non-sense in this context, though due to the double locking not really a problem */ 2006 2004 } 2007 2005 … … 2029 2027 # endif 2030 2028 2031 intrc2 = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);2032 AssertRC( rc2);2029 VBOXSTRICTRC rc2 = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value); 2030 AssertRC(VBOXSTRICTRC_VAL(rc2)); 2033 2031 2034 2032 DEVHDA_UNLOCK(pDevIns, pThis); … … 2040 2038 } 2041 2039 2042 static inthdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2040 static VBOXSTRICTRC hdaRegWriteSDBDPL(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2043 2041 { 2044 2042 return hdaRegWriteSDBDPX(pDevIns, pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPL, iReg)); 2045 2043 } 2046 2044 2047 static inthdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2045 static VBOXSTRICTRC hdaRegWriteSDBDPU(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2048 2046 { 2049 2047 return hdaRegWriteSDBDPX(pDevIns, pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPU, iReg)); 2050 2048 } 2051 2049 2052 static inthdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)2050 static VBOXSTRICTRC hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 2053 2051 { 2054 2052 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ); … … 2061 2059 } 2062 2060 2063 intrc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value);2061 VBOXSTRICTRC rc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value); 2064 2062 DEVHDA_UNLOCK(pDevIns, pThis); 2065 2063 … … 2067 2065 } 2068 2066 2069 static inthdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2067 static VBOXSTRICTRC hdaRegWriteIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2070 2068 { 2071 2069 RT_NOREF_PV(iReg); … … 2123 2121 } 2124 2122 2125 static inthdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2123 static VBOXSTRICTRC hdaRegWriteRIRBWP(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2126 2124 { 2127 2125 RT_NOREF(iReg); … … 2156 2154 } 2157 2155 2158 static inthdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2156 static VBOXSTRICTRC hdaRegWriteRINTCNT(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2159 2157 { 2160 2158 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 2168 2166 } 2169 2167 2170 intrc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);2171 AssertRC( rc);2168 VBOXSTRICTRC rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value); 2169 AssertRC(VBOXSTRICTRC_VAL(rc)); 2172 2170 2173 2171 LogFunc(("Response interrupt count is now %RU8\n", HDA_REG(pThis, RINTCNT) & 0xFF)); … … 2177 2175 } 2178 2176 2179 static inthdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2177 static VBOXSTRICTRC hdaRegWriteBase(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2180 2178 { 2181 2179 uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; 2182 2180 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); 2183 2181 2184 intrc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value);2185 AssertRCSuccess( rc);2182 VBOXSTRICTRC rc = hdaRegWriteU32(pDevIns, pThis, iReg, u32Value); 2183 AssertRCSuccess(VBOXSTRICTRC_VAL(rc)); 2186 2184 2187 2185 switch (iReg) … … 2228 2226 } 2229 2227 2230 static inthdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value)2228 static VBOXSTRICTRC hdaRegWriteRIRBSTS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) 2231 2229 { 2232 2230 RT_NOREF_PV(iReg); … … 2236 2234 HDA_REG(pThis, RIRBSTS) &= ~(v & u32Value); 2237 2235 2238 intrc = HDA_PROCESS_INTERRUPT(pDevIns, pThis);2236 VBOXSTRICTRC rc = HDA_PROCESS_INTERRUPT(pDevIns, pThis); 2239 2237 2240 2238 DEVHDA_UNLOCK(pDevIns, pThis); … … 2885 2883 * @param pvUser User argument. 2886 2884 */ 2887 static DECLCALLBACK(VBOXSTRICTRC) hdaR3D MAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys,2885 static DECLCALLBACK(VBOXSTRICTRC) hdaR3DmaAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, 2888 2886 void *pvBuf, size_t cbBuf, 2889 2887 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) … … 3121 3119 * spec. 3122 3120 */ 3123 static DECLCALLBACK(VBOXSTRICTRC) hdaM MIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)3124 { 3125 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE);3126 intrc;3121 static DECLCALLBACK(VBOXSTRICTRC) hdaMmioRead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb) 3122 { 3123 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 3124 VBOXSTRICTRC rc; 3127 3125 RT_NOREF_PV(pvUser); 3128 3126 Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC); … … 3160 3158 */ 3161 3159 rc = g_aHdaRegMap[idxRegDsc].pfnRead(pDevIns, pThis, idxRegDsc, (uint32_t *)pv); 3162 Log3Func(("\tRead %s => %x (%Rrc)\n", g_aHdaRegMap[idxRegDsc].abbrev, *(uint32_t *)pv, rc));3160 Log3Func(("\tRead %s => %x (%Rrc)\n", g_aHdaRegMap[idxRegDsc].abbrev, *(uint32_t *)pv, VBOXSTRICTRC_VAL(rc))); 3163 3161 } 3164 3162 else … … 3177 3175 3178 3176 rc = g_aHdaRegMap[idxRegDsc].pfnRead(pDevIns, pThis, idxRegDsc, &u32Tmp); 3179 Log3Func(("\tRead %s[%db] => %x (%Rrc)*\n", g_aHdaRegMap[idxRegDsc].abbrev, cbReg, u32Tmp, rc));3177 Log3Func(("\tRead %s[%db] => %x (%Rrc)*\n", g_aHdaRegMap[idxRegDsc].abbrev, cbReg, u32Tmp, VBOXSTRICTRC_VAL(rc))); 3180 3178 if (rc != VINF_SUCCESS) 3181 3179 break; … … 3210 3208 #ifdef LOG_ENABLED 3211 3209 if (cbLog == 4) 3212 Log3Func(("\tReturning @%#05x -> %#010x %Rrc\n", offRegLog, *(uint32_t *)pv, rc));3210 Log3Func(("\tReturning @%#05x -> %#010x %Rrc\n", offRegLog, *(uint32_t *)pv, VBOXSTRICTRC_VAL(rc))); 3213 3211 else if (cbLog == 2) 3214 Log3Func(("\tReturning @%#05x -> %#06x %Rrc\n", offRegLog, *(uint16_t *)pv, rc));3212 Log3Func(("\tReturning @%#05x -> %#06x %Rrc\n", offRegLog, *(uint16_t *)pv, VBOXSTRICTRC_VAL(rc))); 3215 3213 else if (cbLog == 1) 3216 Log3Func(("\tReturning @%#05x -> %#04x %Rrc\n", offRegLog, *(uint8_t *)pv, rc));3214 Log3Func(("\tReturning @%#05x -> %#04x %Rrc\n", offRegLog, *(uint8_t *)pv, VBOXSTRICTRC_VAL(rc))); 3217 3215 #endif 3218 3216 return rc; … … 3220 3218 3221 3219 3222 DECLINLINE( int) hdaWriteReg(PPDMDEVINS pDevIns, PHDASTATE pThis, int idxRegDsc, uint32_t u32Value, char const *pszLog)3220 DECLINLINE(VBOXSTRICTRC) hdaWriteReg(PPDMDEVINS pDevIns, PHDASTATE pThis, int idxRegDsc, uint32_t u32Value, char const *pszLog) 3223 3221 { 3224 3222 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_WRITE); … … 3278 3276 uint32_t const u32OldValue = pThis->au32Regs[idxRegMem]; 3279 3277 #endif 3280 intrc = g_aHdaRegMap[idxRegDsc].pfnWrite(pDevIns, pThis, idxRegDsc, u32Value);3278 VBOXSTRICTRC rc = g_aHdaRegMap[idxRegDsc].pfnWrite(pDevIns, pThis, idxRegDsc, u32Value); 3281 3279 Log3Func(("Written value %#x to %s[%d byte]; %x => %x%s, rc=%d\n", u32Value, g_aHdaRegMap[idxRegDsc].abbrev, 3282 g_aHdaRegMap[idxRegDsc].size, u32OldValue, pThis->au32Regs[idxRegMem], pszLog, rc));3280 g_aHdaRegMap[idxRegDsc].size, u32OldValue, pThis->au32Regs[idxRegMem], pszLog, VBOXSTRICTRC_VAL(rc))); 3283 3281 RT_NOREF(pszLog); 3284 3282 return rc; … … 3290 3288 * Looks up and calls the appropriate handler.} 3291 3289 */ 3292 static DECLCALLBACK(VBOXSTRICTRC) hdaM MIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)3290 static DECLCALLBACK(VBOXSTRICTRC) hdaMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb) 3293 3291 { 3294 3292 PHDASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PHDASTATE); 3295 int rc;3296 3293 RT_NOREF_PV(pvUser); 3297 3294 Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC); … … 3331 3328 * Try for a direct hit first. 3332 3329 */ 3330 VBOXSTRICTRC rc; 3333 3331 if (idxRegDsc >= 0 && g_aHdaRegMap[idxRegDsc].size == cb) 3334 3332 { … … 4830 4828 AssertRCReturn(rc, rc); 4831 4829 4832 rc = PDMDevHlpPCIIORegionCreateMmio(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaM MIOWrite, hdaMMIORead, NULL /*pvUser*/,4830 rc = PDMDevHlpPCIIORegionCreateMmio(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaMmioWrite, hdaMmioRead, NULL /*pvUser*/, 4833 4831 IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_PASSTHRU, "HDA", &pThis->hMmio); 4834 4832 AssertRCReturn(rc, rc); … … 5191 5189 AssertRCReturn(rc, rc); 5192 5190 5193 rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmio, hdaM MIOWrite, hdaMMIORead, NULL /*pvUser*/);5191 rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmio, hdaMmioWrite, hdaMmioRead, NULL /*pvUser*/); 5194 5192 AssertRCReturn(rc, rc); 5195 5193 -
trunk/src/VBox/Devices/Audio/DevHDACommon.h
r82332 r82382 25 25 #include <VBox/log.h> /* LOG_ENABLED */ 26 26 27 /** Read callback. */ 28 typedef VBOXSTRICTRC FNHDAREGREAD(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); 29 /** Write callback. */ 30 typedef VBOXSTRICTRC FNHDAREGWRITE(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); 31 27 32 /** See 302349 p 6.2. */ 28 33 typedef struct HDAREGDESC 29 34 { 30 35 /** Register offset in the register space. */ 31 uint32_t offset;36 uint32_t offset; 32 37 /** Size in bytes. Registers of size > 4 are in fact tables. */ 33 uint32_t size;38 uint32_t size; 34 39 /** Readable bits. */ 35 uint32_t readable;40 uint32_t readable; 36 41 /** Writable bits. */ 37 uint32_t writable;42 uint32_t writable; 38 43 /** Register descriptor (RD) flags of type HDA_RD_FLAG_. 39 44 * These are used to specify the handling (read/write) 40 45 * policy of the register. */ 41 uint32_t fFlags;46 uint32_t fFlags; 42 47 /** Read callback. */ 43 int (*pfnRead)(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value);48 FNHDAREGREAD *pfnRead; 44 49 /** Write callback. */ 45 int (*pfnWrite)(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t u32Value);50 FNHDAREGWRITE *pfnWrite; 46 51 /** Index into the register storage array. */ 47 uint32_t mem_idx;52 uint32_t mem_idx; 48 53 /** Abbreviated name. */ 49 const char *abbrev;54 const char *abbrev; 50 55 /** Descripton. */ 51 const char *desc;52 } HDAREGDESC , *PHDAREGDESC;56 const char *desc; 57 } HDAREGDESC; 53 58 54 59 /** … … 62 67 /** The register index. */ 63 68 int idxAlias; 64 } HDAREGALIAS , *PHDAREGALIAS;69 } HDAREGALIAS; 65 70 66 71 /**
Note:
See TracChangeset
for help on using the changeset viewer.