Changeset 89899 in vbox for trunk/src/VBox/Devices/Audio/DevHda.h
- Timestamp:
- Jun 24, 2021 6:57:00 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHda.h
r89897 r89899 168 168 /** Direct register access by HDASTATE::au32Reg index. */ 169 169 #define HDA_REG_BY_IDX(a_pThis, a_idxReg) ((a_pThis)->au32Regs[(a_idxReg)]) 170 170 171 /** Accesses register @a ShortRegNm. */ 171 #define HDA_REG(a_pThis, a_ShortRegNm) HDA_REG_BY_IDX(a_pThis, HDA_MEM_IND_NAME(a_ShortRegNm)) 172 #ifdef VBOX_STRICT 173 # define HDA_REG(a_pThis, a_ShortRegNm) (*hdaStrictRegAccessor(a_pThis, HDA_REG_IND_NAME(a_ShortRegNm), HDA_MEM_IND_NAME(a_ShortRegNm))) 174 #else 175 # define HDA_REG(a_pThis, a_ShortRegNm) HDA_REG_BY_IDX(a_pThis, HDA_MEM_IND_NAME(a_ShortRegNm)) 176 #endif 177 172 178 /** Indirect register access via g_aHdaRegMap[].mem_idx. */ 173 179 #define HDA_REG_IND(a_pThis, a_idxMap) HDA_REG_BY_IDX(a_pThis, g_aHdaRegMap[(a_idxMap)].mem_idx) … … 827 833 } 828 834 835 /* Used by hdaR3StreamSetUp: */ 836 uint8_t hdaSDFIFOWToBytes(uint16_t u16RegFIFOW); 837 838 829 839 #ifdef VBOX_STRICT 840 /** 841 * Strict register accessor verifing defines and mapping table. 842 * @see HDA_REG 843 */ 844 DECLINLINE(uint32_t *) hdaStrictRegAccessor(PHDASTATE pThis, uint32_t idxMap, uint32_t idxReg) 845 { 846 Assert(idxMap < RT_ELEMENTS(g_aHdaRegMap)); 847 AssertMsg(idxReg == g_aHdaRegMap[idxMap].mem_idx, ("idxReg=%d\n", idxReg)); 848 return &pThis->au32Regs[idxReg]; 849 } 850 851 /** 852 * Strict stream register accessor verifing defines and mapping table. 853 * @see HDA_STREAM_REG 854 */ 830 855 DECLINLINE(uint32_t *) hdaStrictStreamRegAccessor(PHDASTATE pThis, uint32_t idxMap0, uint32_t idxReg0, size_t idxStream) 831 856 { 857 Assert(idxMap0 < RT_ELEMENTS(g_aHdaRegMap)); 832 858 AssertMsg(idxStream < RT_ELEMENTS(pThis->aStreams), ("%#zx\n", idxStream)); 833 859 AssertMsg(idxReg0 + idxStream * 10 == g_aHdaRegMap[idxMap0 + idxStream * 10].mem_idx, … … 835 861 return &pThis->au32Regs[idxReg0 + idxStream * 10]; 836 862 } 837 #endif 838 839 /* Used by hdaR3StreamSetUp: */ 840 uint8_t hdaSDFIFOWToBytes(uint16_t u16RegFIFOW); 863 864 #endif /* VBOX_STRICT */ 841 865 842 866
Note:
See TracChangeset
for help on using the changeset viewer.