- Timestamp:
- Jun 2, 2017 2:32:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r67238 r67241 135 135 #define HDA_REG_IND_NAME(x) HDA_REG_##x 136 136 #define HDA_MEM_IND_NAME(x) HDA_RMX_##x 137 #define HDA_REG_FIELD_MASK(reg, x) HDA_##reg##_##x##_MASK138 #define HDA_REG_FIELD_FLAG_MASK(reg, x) RT_BIT(HDA_##reg##_##x##_SHIFT)139 #define HDA_REG_FIELD_SHIFT(reg, x) HDA_##reg##_##x##_SHIFT140 137 #define HDA_REG_IND(pThis, x) ((pThis)->au32Regs[g_aHdaRegMap[x].mem_idx]) 141 138 #define HDA_REG(pThis, x) (HDA_REG_IND((pThis), HDA_REG_IND_NAME(x))) 142 #define HDA_REG_FLAG_VALUE(pThis, reg, val) (HDA_REG((pThis),reg) & (((HDA_REG_FIELD_FLAG_MASK(reg, val)))))143 139 144 140 … … 173 169 #define HDA_REG_GCTL 5 /* 0x08-0x0B */ 174 170 #define HDA_RMX_GCTL 5 175 #define HDA_GCTL_ RST_SHIFT 0176 #define HDA_GCTL_F SH_SHIFT 1177 #define HDA_GCTL_ UR_SHIFT 8171 #define HDA_GCTL_UNSOL RT_BIT(8) /* Accept Unsolicited Response Enable */ 172 #define HDA_GCTL_FCNTRL RT_BIT(1) /* Flush Control */ 173 #define HDA_GCTL_CRST RT_BIT(0) /* Controller Reset */ 178 174 179 175 #define HDA_REG_WAKEEN 6 /* 0x0C */ … … 186 182 #define HDA_REG_GSTS 8 /* 0x10-0x11*/ 187 183 #define HDA_RMX_GSTS 8 188 #define HDA_GSTS_FS H_SHIFT 1184 #define HDA_GSTS_FSTS RT_BIT(1) /* Flush Status */ 189 185 190 186 #define HDA_REG_OUTSTRMPAY 9 /* 0x18 */ … … 196 192 #define HDA_REG_INTCTL 11 /* 0x20 */ 197 193 #define HDA_RMX_INTCTL 9 198 #define HDA_INTCTL_GIE _SHIFT 31199 #define HDA_INTCTL_CIE _SHIFT 30194 #define HDA_INTCTL_GIE RT_BIT(31) /* Global Interrupt Enable */ 195 #define HDA_INTCTL_CIE RT_BIT(30) /* Controller Interrupt Enable */ 200 196 /* Bits 0-29 correspond to streams 0-29. */ 201 #define HDA_INTCTL_GIE_MASK RT_BIT(31) /* Global Interrupt Enable (3.3.14). */202 197 203 198 #define HDA_REG_INTSTS 12 /* 0x24 */ 204 199 #define HDA_RMX_INTSTS 10 205 #define HDA_INTSTS_GIS _SHIFT 31206 #define HDA_INTSTS_CIS _SHIFT 30200 #define HDA_INTSTS_GIS RT_BIT(31) /* Global Interrupt Status */ 201 #define HDA_INTSTS_CIS RT_BIT(30) /* Controller Interrupt Status */ 207 202 /* Bits 0-29 correspond to streams 0-29. */ 208 203 … … 228 223 #define HDA_REG_CORBRP 18 /* 0x4A */ 229 224 #define HDA_RMX_CORBRP 16 230 #define HDA_CORBRP_RST _SHIFT 15225 #define HDA_CORBRP_RST RT_BIT(15) /* CORB Read Pointer Reset */ 231 226 #define HDA_CORBRP_WP_SHIFT 0 232 227 #define HDA_CORBRP_WP_MASK 0xFF … … 234 229 #define HDA_REG_CORBCTL 19 /* 0x4C */ 235 230 #define HDA_RMX_CORBCTL 17 236 #define HDA_CORBCTL_DMA _SHIFT 1237 #define HDA_CORBCTL_CMEIE _SHIFT 0231 #define HDA_CORBCTL_DMA RT_BIT(1) /* Enable CORB DMA Engine */ 232 #define HDA_CORBCTL_CMEIE RT_BIT(0) /* CORB Memory Error Interrupt Enable */ 238 233 239 234 #define HDA_REG_CORBSTS 20 /* 0x4D */ … … 255 250 #define HDA_REG_RIRBWP 24 /* 0x58 */ 256 251 #define HDA_RMX_RIRBWP 22 257 #define HDA_RIRBWP_RST _SHIFT 15252 #define HDA_RIRBWP_RST RT_BIT(15) /* RIRB Write Pointer Reset */ 258 253 #define HDA_RIRBWP_WP_MASK 0xFF 259 254 … … 264 259 #define HDA_REG_RIRBCTL 26 /* 0x5C */ 265 260 #define HDA_RMX_RIRBCTL 24 266 #define HDA_RIRBCTL_R IC_SHIFT 0267 #define HDA_RIRBCTL_ DMA_SHIFT 1268 #define HDA_R OI_DMA_SHIFT 2261 #define HDA_RIRBCTL_ROIC RT_BIT(2) /* Response Overrun Interrupt Control */ 262 #define HDA_RIRBCTL_RDMAEN RT_BIT(1) /* RIRB DMA Enable */ 263 #define HDA_RIRBCTL_RINTCTL RT_BIT(0) /* Response Interrupt Control */ 269 264 270 265 #define HDA_REG_RIRBSTS 27 /* 0x5D */ 271 266 #define HDA_RMX_RIRBSTS 25 272 #define HDA_RIRBSTS_RI NTFL_SHIFT 0273 #define HDA_RIRBSTS_RI RBOIS_SHIFT 2267 #define HDA_RIRBSTS_RIRBOIS RT_BIT(2) /* Response Overrun Interrupt Status */ 268 #define HDA_RIRBSTS_RINTFL RT_BIT(0) /* Response Interrupt Flag */ 274 269 275 270 #define HDA_REG_RIRBSIZE 28 /* 0x5E */ … … 290 285 #define HDA_REG_IRS 31 /* 0x68 */ 291 286 #define HDA_RMX_IRS 29 292 #define HDA_IRS_I CB_SHIFT 0293 #define HDA_IRS_I RV_SHIFT 1287 #define HDA_IRS_IRV RT_BIT(1) /* Immediate Result Valid */ 288 #define HDA_IRS_ICB RT_BIT(0) /* Immediate Command Busy */ 294 289 295 290 #define HDA_REG_DPLBASE 32 /* 0x70 */ … … 332 327 333 328 #define HDA_SDCTL(pThis, num) HDA_REG((pThis), SD(CTL, num)) 334 #define HDA_SDCTL_NUM(pThis, num) ((HDA_SDCTL((pThis), num) & HDA_REG_FIELD_MASK(SDCTL,NUM)) >> HDA_REG_FIELD_SHIFT(SDCTL, NUM))335 329 #define HDA_SDCTL_NUM_MASK 0xF 336 330 #define HDA_SDCTL_NUM_SHIFT 20 337 #define HDA_SDCTL_DIR _SHIFT 19338 #define HDA_SDCTL_TP _SHIFT 18331 #define HDA_SDCTL_DIR RT_BIT(19) /* Direction (Bidirectional streams only!) */ 332 #define HDA_SDCTL_TP RT_BIT(18) /* Traffic Priority (PCI Express) */ 339 333 #define HDA_SDCTL_STRIPE_MASK 0x3 340 334 #define HDA_SDCTL_STRIPE_SHIFT 16 341 #define HDA_SDCTL_DEIE _SHIFT 4342 #define HDA_SDCTL_FEIE _SHIFT 3343 #define HDA_SDCTL_I CE_SHIFT 2344 #define HDA_SDCTL_RUN _SHIFT 1345 #define HDA_SDCTL_SRST _SHIFT 0335 #define HDA_SDCTL_DEIE RT_BIT(4) /* Descriptor Error Interrupt Enable */ 336 #define HDA_SDCTL_FEIE RT_BIT(3) /* FIFO Error Interrupt Enable */ 337 #define HDA_SDCTL_IOCE RT_BIT(2) /* Interrupt On Completion Enable */ 338 #define HDA_SDCTL_RUN RT_BIT(1) /* Stream Run */ 339 #define HDA_SDCTL_SRST RT_BIT(0) /* Stream Reset */ 346 340 347 341 #define HDA_REG_SD0STS 35 /* 0x83 */ … … 497 491 498 492 #define SDFMT(pThis, num) (HDA_REG((pThis), SD(FMT, num))) 499 #define HDA_SDFMT_BASE_RATE(pThis, num) ((SDFMT(pThis, num) & HDA_REG_FIELD_FLAG_MASK(SDFMT, BASE_RATE)) >> HDA_REG_FIELD_SHIFT(SDFMT, BASE_RATE))500 #define HDA_SDFMT_MULT(pThis, num) ((SDFMT((pThis), num) & HDA_REG_FIELD_MASK(SDFMT,MULT)) >> HDA_REG_FIELD_SHIFT(SDFMT, MULT))501 #define HDA_SDFMT_DIV(pThis, num) ((SDFMT((pThis), num) & HDA_REG_FIELD_MASK(SDFMT,DIV)) >> HDA_REG_FIELD_SHIFT(SDFMT, DIV))502 493 503 494 #define HDA_REG_SD0BDPL 42 /* 0x98 */ … … 1438 1429 uint32_t intSts = 0; 1439 1430 1440 if (/* Response Overrun Interrupt Status (ROIS) */ 1441 HDA_REG_FLAG_VALUE(pThis, RIRBSTS, RIRBOIS) 1431 /** @todo r=michaln This is ignoring HDA_RIRBCTL_ROIC! */ 1432 if (/* Response Overrun Interrupt Status (ROIS aka RIRBOIS) */ 1433 (HDA_REG(pThis, RIRBSTS) & HDA_RIRBSTS_RIRBOIS) 1442 1434 /* Response Interrupt */ 1443 || HDA_REG_FLAG_VALUE(pThis, RIRBSTS,RINTFL)1435 || (HDA_REG(pThis, RIRBSTS) & HDA_RIRBSTS_RINTFL) 1444 1436 /* SDIN State Change Status Flags (SCSF) */ 1445 1437 || (HDA_REG(pThis, STATESTS) & HDA_STATESTS_SCSF_MASK)) 1446 1438 { 1447 intSts |= RT_BIT(30); /* TouchController Interrupt Status (CIS). */1439 intSts |= HDA_INTSTS_CIS; /* Set the Controller Interrupt Status (CIS). */ 1448 1440 } 1449 1441 … … 1469 1461 1470 1462 if (intSts) 1471 intSts |= RT_BIT(31); /* TouchGlobal Interrupt Status (GIS). */1463 intSts |= HDA_INTSTS_GIS; /* Set the Global Interrupt Status (GIS). */ 1472 1464 1473 1465 HDA_REG(pThis, INTSTS) = intSts; … … 1482 1474 int iLevel = 0; 1483 1475 1484 /* Global Interrupt Status (GIS) touched? */1485 if (HDA_REG _FLAG_VALUE(pThis, INTSTS, GIS))1476 /* Global Interrupt Status (GIS) set? */ 1477 if (HDA_REG(pThis, INTSTS) & HDA_INTSTS_GIS) 1486 1478 iLevel = 1; 1487 1479 … … 1489 1481 1490 1482 /* Global Interrupt Enable (GIE) set? */ 1491 if (HDA_REG _FLAG_VALUE(pThis, INTCTL, GIE))1483 if (HDA_REG(pThis, INTCTL) & HDA_INTCTL_GIE) 1492 1484 PDMDevHlpPCISetIrq(pThis->CTX_SUFF(pDevIns), 0, iLevel); 1493 1485 … … 1607 1599 if (fLocal) 1608 1600 { 1609 Assert((HDA_REG _FLAG_VALUE(pThis, CORBCTL, DMA)));1601 Assert((HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)); 1610 1602 Assert(pThis->u64CORBBase); 1611 1603 AssertPtr(pThis->pu32CorbBuf); … … 1640 1632 else 1641 1633 { 1642 Assert((HDA_REG _FLAG_VALUE(pThis, RIRBCTL, DMA)));1634 Assert((HDA_REG(pThis, RIRBCTL) & HDA_RIRBCTL_RDMAEN)); 1643 1635 rc = PDMDevHlpPCIPhysWrite(pThis->CTX_SUFF(pDevIns), pThis->u64RIRBBase, pThis->pu64RirbBuf, pThis->cbRirbBuf); 1644 1636 if (RT_FAILURE(rc)) … … 1690 1682 1691 1683 if ( (uResp & CODEC_RESPONSE_UNSOLICITED) 1692 && ! HDA_REG_FLAG_VALUE(pThis, GCTL, UR))1684 && !(HDA_REG(pThis, GCTL) & HDA_GCTL_UNSOL)) 1693 1685 { 1694 1686 LogFunc(("Unexpected unsolicited response\n")); … … 1711 1703 Log3Func(("CORB(RP:%x, WP:%x) RIRBWP:%x\n", HDA_REG(pThis, CORBRP), HDA_REG(pThis, CORBWP), HDA_REG(pThis, RIRBWP))); 1712 1704 1713 if (HDA_REG _FLAG_VALUE(pThis, RIRBCTL, RIC))1714 { 1715 HDA_REG(pThis, RIRBSTS) |= HDA_R EG_FIELD_FLAG_MASK(RIRBSTS,RINTFL);1705 if (HDA_REG(pThis, RIRBCTL) & HDA_RIRBCTL_RINTCTL) 1706 { 1707 HDA_REG(pThis, RIRBSTS) |= HDA_RIRBSTS_RINTFL; 1716 1708 1717 1709 pThis->u8RespIntCnt = 0; … … 1823 1815 1824 1816 # ifdef VBOX_STRICT 1825 AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, uSD) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN)),1817 AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, uSD) & HDA_SDCTL_RUN), 1826 1818 ("[SD%RU8] Cannot reset stream while in running state\n", uSD)); 1827 1819 # endif … … 1844 1836 /* According to the ICH6 datasheet, 0x40000 is the default value for stream descriptor register 23:20 1845 1837 * bits are reserved for stream number 18.2.33, resets SDnCTL except SRST bit. */ 1846 HDA_STREAM_REG(pThis, CTL, uSD) = 0x40000 | (HDA_STREAM_REG(pThis, CTL, uSD) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, SRST));1838 HDA_STREAM_REG(pThis, CTL, uSD) = 0x40000 | (HDA_STREAM_REG(pThis, CTL, uSD) & HDA_SDCTL_SRST); 1847 1839 /* 1848 1840 * ICH6 defines default values (120 bytes for input and 192 bytes for output descriptors) of FIFO size. 18.2.39. … … 2126 2118 RT_NOREF_PV(iReg); 2127 2119 2128 if (u32Value & HDA_ REG_FIELD_FLAG_MASK(GCTL, RST))2120 if (u32Value & HDA_GCTL_CRST) 2129 2121 { 2130 2122 /* Set the CRST bit to indicate that we're leaving reset mode. */ 2131 HDA_REG(pThis, GCTL) |= HDA_ REG_FIELD_FLAG_MASK(GCTL, RST);2123 HDA_REG(pThis, GCTL) |= HDA_GCTL_CRST; 2132 2124 2133 2125 if (pThis->fInReset) … … 2142 2134 /* Enter reset state. */ 2143 2135 LogFunc(("Guest entering HDA reset with DMA(RIRB:%s, CORB:%s)\n", 2144 HDA_REG _FLAG_VALUE(pThis, CORBCTL, DMA)? "on" : "off",2145 HDA_REG _FLAG_VALUE(pThis, RIRBCTL, DMA)? "on" : "off"));2136 HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA ? "on" : "off", 2137 HDA_REG(pThis, RIRBCTL) & HDA_RIRBCTL_RDMAEN ? "on" : "off")); 2146 2138 2147 2139 /* Clear the CRST bit to indicate that we're in reset state. */ 2148 HDA_REG(pThis, GCTL) &= ~HDA_ REG_FIELD_FLAG_MASK(GCTL, RST);2140 HDA_REG(pThis, GCTL) &= ~HDA_GCTL_CRST; 2149 2141 pThis->fInReset = true; 2150 2142 … … 2155 2147 } 2156 2148 2157 if (u32Value & HDA_ REG_FIELD_FLAG_MASK(GCTL, FSH))2149 if (u32Value & HDA_GCTL_FCNTRL) 2158 2150 { 2159 2151 /* Flush: GSTS:1 set, see 6.2.6. */ 2160 HDA_REG(pThis, GSTS) |= HDA_ REG_FIELD_FLAG_MASK(GSTS, FSH); /* Set the flush state. */2152 HDA_REG(pThis, GSTS) |= HDA_GSTS_FSTS; /* Set the flush status. */ 2161 2153 /* DPLBASE and DPUBASE should be initialized with initial value (see 6.2.6). */ 2162 2154 } … … 2183 2175 2184 2176 /* Global Interrupt Enable (GIE) set? */ 2185 if (u32Value & HDA_INTCTL_GIE _MASK)2177 if (u32Value & HDA_INTCTL_GIE) 2186 2178 { 2187 2179 rc = hdaProcessInterrupt(pThis); … … 2226 2218 RT_NOREF_PV(iReg); 2227 2219 2228 if (u32Value & HDA_ REG_FIELD_FLAG_MASK(CORBRP, RST))2220 if (u32Value & HDA_CORBRP_RST) 2229 2221 { 2230 2222 HDA_REG(pThis, CORBRP) = 0; … … 2242 2234 int rc = hdaRegWriteU8(pThis, iReg, u32Value); 2243 2235 AssertRC(rc); 2244 if ( HDA_REG(pThis, CORBWP) 2245 && HDA_REG_FLAG_VALUE(pThis, CORBCTL, DMA) != 0)2236 if ( HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP) 2237 && (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) 2246 2238 { 2247 2239 return hdaCORBCmdProcess(pThis); … … 2272 2264 if (HDA_REG(pThis, CORBWP) == HDA_REG(pThis, CORBRP)) 2273 2265 return VINF_SUCCESS; 2274 if (! HDA_REG_FLAG_VALUE(pThis, CORBCTL,DMA))2266 if (!(HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) 2275 2267 return VINF_SUCCESS; 2276 2268 rc = hdaCORBCmdProcess(pThis); … … 2323 2315 u32Value = (u32Value & 0x00ffffff); 2324 2316 2325 bool fRun = RT_BOOL(u32Value & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN));2326 bool fInRun = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN));2327 2328 bool fReset = RT_BOOL(u32Value & HDA_ REG_FIELD_FLAG_MASK(SDCTL, SRST));2329 bool fInReset = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, SRST));2317 bool fRun = RT_BOOL(u32Value & HDA_SDCTL_RUN); 2318 bool fInRun = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_SDCTL_RUN); 2319 2320 bool fReset = RT_BOOL(u32Value & HDA_SDCTL_SRST); 2321 bool fInReset = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_SDCTL_SRST); 2330 2322 2331 2323 /* Get the stream descriptor. */ … … 2373 2365 2374 2366 /* Report that we're done resetting this stream by clearing SRST. */ 2375 HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_ REG_FIELD_FLAG_MASK(SDCTL, SRST);2367 HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_SRST; 2376 2368 2377 2369 LogFunc(("[SD%RU8]: Reset exit\n", uSD)); … … 2984 2976 /* regarding 3.4.3 we should mark IRS as busy in case CORB is active */ 2985 2977 if ( HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP) 2986 || HDA_REG_FLAG_VALUE(pThis, CORBCTL,DMA))2987 { 2988 HDA_REG(pThis, IRS) = HDA_ REG_FIELD_FLAG_MASK(IRS, ICB); /* busy */2978 || (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) 2979 { 2980 HDA_REG(pThis, IRS) = HDA_IRS_ICB; /* busy */ 2989 2981 } 2990 2982 … … 3000 2992 * write the response to IR register, and set the IRV (valid in case of success) bit of IRS register. 3001 2993 */ 3002 if ( u32Value & HDA_REG_FIELD_FLAG_MASK(IRS,ICB)3003 && ! HDA_REG_FLAG_VALUE(pThis, IRS,ICB))2994 if ( (u32Value & HDA_IRS_ICB) 2995 && !(HDA_REG(pThis, IRS) & HDA_IRS_ICB)) 3004 2996 { 3005 2997 #ifdef IN_RING3 … … 3015 3007 } 3016 3008 3017 HDA_REG(pThis, IRS) = HDA_ REG_FIELD_FLAG_MASK(IRS, ICB); /* busy */3009 HDA_REG(pThis, IRS) = HDA_IRS_ICB; /* busy */ 3018 3010 3019 3011 uint64_t uResp; … … 3024 3016 3025 3017 HDA_REG(pThis, IR) = (uint32_t)uResp; /** @todo r=andy Do we need a 64-bit response? */ 3026 HDA_REG(pThis, IRS) = HDA_REG_FIELD_FLAG_MASK(IRS, IRV); /* result is ready */ 3027 HDA_REG(pThis, IRS) &= ~HDA_REG_FIELD_FLAG_MASK(IRS, ICB); /* busy is clear */ 3018 HDA_REG(pThis, IRS) = HDA_IRS_IRV; /* result is ready */ 3019 /** @todo r=michaln We just set the IRS value, why are we clearing unset bits? */ 3020 HDA_REG(pThis, IRS) &= ~HDA_IRS_ICB; /* busy is clear */ 3028 3021 return VINF_SUCCESS; 3029 3022 #else /* !IN_RING3 */ … … 3033 3026 3034 3027 /* 3035 * Once the guest read the response, it should clea nthe IRV bit of the IRS register.3028 * Once the guest read the response, it should clear the IRV bit of the IRS register. 3036 3029 */ 3037 if ( u32Value & HDA_REG_FIELD_FLAG_MASK(IRS, IRV) 3038 && HDA_REG_FLAG_VALUE(pThis, IRS, IRV)) 3039 HDA_REG(pThis, IRS) &= ~HDA_REG_FIELD_FLAG_MASK(IRS, IRV); 3030 HDA_REG(pThis, IRS) &= ~(u32Value & HDA_IRS_IRV); 3040 3031 return VINF_SUCCESS; 3041 3032 } … … 3045 3036 RT_NOREF_PV(iReg); 3046 3037 3047 if (u32Value & HDA_R EG_FIELD_FLAG_MASK(RIRBWP, RST))3038 if (u32Value & HDA_RIRBWP_RST) 3048 3039 HDA_REG(pThis, RIRBWP) = 0; 3049 3040 … … 4084 4075 4085 4076 /* Is the stream not in a running state currently? */ 4086 if (!(HDA_STREAM_REG(pThis, CTL, pStream->u8SD) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN)))4077 if (!(HDA_STREAM_REG(pThis, CTL, pStream->u8SD) & HDA_SDCTL_RUN)) 4087 4078 fProceed = false; 4088 4079 /* Is the BCIS (Buffer Completion Interrupt Status) flag set? Then we have to wait and skip. */ … … 4897 4888 4898 4889 /* Is the RUN bit currently set? */ 4899 if ( RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN))4890 if ( RT_BOOL(uSDCTL & HDA_SDCTL_RUN) 4900 4891 /* Are writes to the register denied if RUN bit is set? */ 4901 4892 && !(g_aHdaRegMap[idxRegDsc].fFlags & HDA_RD_FLAG_SD_WRITE_RUN)) … … 5465 5456 hdaStreamEnable(pThis, pStream, false /* fEnable */); 5466 5457 5467 bool fActive = RT_BOOL(HDA_STREAM_REG(pThis, CTL, i) & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN));5458 bool fActive = RT_BOOL(HDA_STREAM_REG(pThis, CTL, i) & HDA_SDCTL_RUN); 5468 5459 if (fActive) 5469 5460 { … … 5514 5505 "SDCTL(raw:%#x, DIR:%s, TP:%RTbool, STRIPE:%x, DEIE:%RTbool, FEIE:%RTbool, IOCE:%RTbool, RUN:%RTbool, RESET:%RTbool)", 5515 5506 uSDCTL, 5516 (uSDCTL & HDA_REG_FIELD_FLAG_MASK(SDCTL, DIR))? "OUT" : "IN",5517 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, TP)),5518 (uSDCTL & HDA_ REG_FIELD_MASK(SDCTL, STRIPE)) >> HDA_SDCTL_STRIPE_SHIFT,5519 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, DEIE)),5520 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, FEIE)),5521 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, ICE)),5522 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN)),5523 RT_BOOL(uSDCTL & HDA_ REG_FIELD_FLAG_MASK(SDCTL, SRST)));5507 uSDCTL & HDA_SDCTL_DIR ? "OUT" : "IN", 5508 RT_BOOL(uSDCTL & HDA_SDCTL_TP), 5509 (uSDCTL & HDA_SDCTL_STRIPE_MASK) >> HDA_SDCTL_STRIPE_SHIFT, 5510 RT_BOOL(uSDCTL & HDA_SDCTL_DEIE), 5511 RT_BOOL(uSDCTL & HDA_SDCTL_FEIE), 5512 RT_BOOL(uSDCTL & HDA_SDCTL_IOCE), 5513 RT_BOOL(uSDCTL & HDA_SDCTL_RUN), 5514 RT_BOOL(uSDCTL & HDA_SDCTL_SRST)); 5524 5515 } 5525 5516 … … 5872 5863 { 5873 5864 /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */ 5874 HDA_STREAM_REG(pThis, CTL, i) &= ~HDA_ REG_FIELD_FLAG_MASK(SDCTL, RUN);5865 HDA_STREAM_REG(pThis, CTL, i) &= ~HDA_SDCTL_RUN; 5875 5866 hdaStreamReset(pThis, &pThis->aStreams[i]); 5876 5867 }
Note:
See TracChangeset
for help on using the changeset viewer.