Changeset 82391 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 4, 2019 5:38:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r82388 r82391 956 956 static VBOXSTRICTRC hdaRegReadU32(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 957 957 { 958 uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; 959 960 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ); 961 958 RT_NOREF(pDevIns); 959 960 uint32_t const iRegMem = g_aHdaRegMap[iReg].mem_idx; 962 961 *pu32Value = pThis->au32Regs[iRegMem] & g_aHdaRegMap[iReg].readable; 963 964 DEVHDA_UNLOCK(pDevIns, pThis);965 962 return VINF_SUCCESS; 966 963 } … … 1027 1024 static VBOXSTRICTRC hdaRegReadLPIB(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 1028 1025 { 1029 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);1026 RT_NOREF(pDevIns); 1030 1027 1031 1028 const uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, LPIB, iReg); 1032 uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, uSD); 1033 #ifdef LOG_ENABLED 1034 const uint32_t u32CBL = HDA_STREAM_REG(pThis, CBL, uSD); 1035 LogFlowFunc(("[SD%RU8] LPIB=%RU32, CBL=%RU32\n", uSD, u32LPIB, u32CBL)); 1036 #endif 1037 1029 const uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, uSD); 1038 1030 *pu32Value = u32LPIB; 1039 1040 DEVHDA_UNLOCK(pDevIns, pThis); 1031 LogFlowFunc(("[SD%RU8] LPIB=%RU32, CBL=%RU32\n", uSD, u32LPIB, HDA_STREAM_REG(pThis, CBL, uSD))); 1032 1041 1033 return VINF_SUCCESS; 1042 1034 } … … 1087 1079 #ifdef IN_RING3 /** @todo r=bird: No reason (except logging) for this to be ring-3 only! */ 1088 1080 RT_NOREF(pDevIns, iReg); 1089 DEVHDA_LOCK(pDevIns, pThis);1090 1081 1091 1082 const uint64_t u64WalClkCur = ASMAtomicReadU64(&pThis->u64WalClk); … … 1093 1084 1094 1085 Log3Func(("%RU32 (max @ %RU64)\n", *pu32Value, hdaR3WalClkGetMax(pThis))); 1095 DEVHDA_UNLOCK(pDevIns, pThis);1096 1086 return VINF_SUCCESS; 1097 1087 #else … … 1968 1958 static VBOXSTRICTRC hdaRegReadIRS(PPDMDEVINS pDevIns, PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) 1969 1959 { 1970 DEVHDA_LOCK_RETURN(pDevIns, pThis, VINF_IOM_R3_MMIO_READ);1971 1972 1960 /* regarding 3.4.3 we should mark IRS as busy in case CORB is active */ 1973 1961 if ( HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP) 1974 1962 || (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) 1975 {1976 1963 HDA_REG(pThis, IRS) = HDA_IRS_ICB; /* busy */ 1977 } 1978 1979 VBOXSTRICTRC rc = hdaRegReadU32(pDevIns, pThis, iReg, pu32Value); 1980 DEVHDA_UNLOCK(pDevIns, pThis); 1981 1982 return rc; 1964 1965 return hdaRegReadU32(pDevIns, pThis, iReg, pu32Value); 1983 1966 } 1984 1967 … … 3031 3014 3032 3015 if (!(HDA_REG(pThis, GCTL) & HDA_GCTL_CRST) && idxRegDsc != HDA_REG_GCTL) 3033 LogFunc(("Access to registers except GCTL is blocked while reset\n")); 3034 3035 if (idxRegDsc == -1) 3036 LogRel(("HDA: Invalid read access @0x%x (bytes=%u)\n", (uint32_t)off, cb)); 3037 3038 if (idxRegDsc != -1) 3039 { 3040 /* Leave lock before calling read function. */ 3041 DEVHDA_UNLOCK(pDevIns, pThis); 3042 3016 LogFunc(("Access to registers except GCTL is blocked while resetting\n")); 3017 3018 if (idxRegDsc >= 0) 3019 { 3043 3020 /* ASSUMES gapless DWORD at end of map. */ 3044 3021 if (g_aHdaRegMap[idxRegDsc].size == 4) … … 3087 3064 else 3088 3065 { 3089 DEVHDA_UNLOCK(pDevIns, pThis);3090 3066 LogRel(("HDA: Invalid read access @0x%x (bytes=%u)\n", (uint32_t)off, cb)); 3067 Log3Func(("\tHole at %x is accessed for read\n", offRegLog)); 3091 3068 rc = VINF_IOM_MMIO_UNUSED_FF; 3092 Log3Func(("\tHole at %x is accessed for read\n", offRegLog)); 3093 } 3069 } 3070 3071 DEVHDA_UNLOCK(pDevIns, pThis); 3094 3072 3095 3073 /*
Note:
See TracChangeset
for help on using the changeset viewer.