Changeset 90247 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jul 19, 2021 7:04:28 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r90178 r90247 2030 2030 * up to and we cannot really make much of a plan out of it. 2031 2031 */ 2032 uint8_t const bLvi = pStream->Regs.lvi % AC97_MAX_BDLE /* paranoia */; 2033 uint8_t const bCiv = pStream->Regs.civ % AC97_MAX_BDLE /* paranoia */; 2034 uint32_t const uAddrBdl = pStream->Regs.bdbar; 2035 2036 /* Linux does this a number of times while probing/whatever the device. The 2037 IOMMU usually does allow us to read address zero, so let's skip and hope 2038 for a better config before the guest actually wants to play/record. 2039 (Note that bLvi and bCiv are also zero then, but I'm not entirely sure if 2040 that can be taken to mean anything as such, as it still indicates that 2041 BDLE00 is valid (LVI == last valid index).) */ 2042 /** @todo Instead of refusing to read address zero, we should probably allow 2043 * reading address zero if explicitly programmed. But, too much work now. */ 2044 if (uAddrBdl != 0) 2045 LogFlowFunc(("bdbar=%#x bLvi=%#x bCiv=%#x\n", uAddrBdl, bLvi, bCiv)); 2046 else 2047 { 2048 LogFunc(("Invalid stream #%u: bdbar=%#x bLvi=%#x bCiv=%#x (%s)\n", pStreamCC->u8SD, uAddrBdl, bLvi, bCiv, 2049 PDMAudioStrmCfgToString(&Cfg, szTmp, sizeof(szTmp)))); 2050 return VERR_OUT_OF_RANGE; 2051 } 2052 2032 2053 AC97BDLE aBdl[AC97_MAX_BDLE]; 2033 2054 RT_ZERO(aBdl); 2034 PDMDevHlpPCIPhysRead(pDevIns, pStream->Regs.bdbar, aBdl, sizeof(aBdl)); 2035 2036 uint8_t const bLvi = pStream->Regs.lvi % AC97_MAX_BDLE /* paranoia */; 2037 uint8_t const bCiv = pStream->Regs.civ % AC97_MAX_BDLE /* paranoia */; 2055 PDMDevHlpPCIPhysRead(pDevIns, uAddrBdl, aBdl, sizeof(aBdl)); 2056 2038 2057 uint32_t cSamplesMax = 0; 2039 2058 uint32_t cSamplesMin = UINT32_MAX; … … 2043 2062 for (uintptr_t i = bCiv; ; cBuffers++) 2044 2063 { 2064 Log2Func(("BDLE%02u: %#x LB %#x; %#x\n", i, aBdl[i].addr, aBdl[i].ctl_len & AC97_BD_LEN_MASK, aBdl[i].ctl_len >> 16)); 2045 2065 cSamplesTotal += aBdl[i].ctl_len & AC97_BD_LEN_MASK; 2046 2066 cSamplesCur += aBdl[i].ctl_len & AC97_BD_LEN_MASK;
Note:
See TracChangeset
for help on using the changeset viewer.