- Timestamp:
- Jul 27, 2016 8:11:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r62605 r62612 883 883 static FNPDMDEVRESET hdaReset; 884 884 885 /* 886 * Stubs.885 /** @name Register read/write stubs. 886 * @{ 887 887 */ 888 888 static int hdaRegReadUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); 889 889 static int hdaRegWriteUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t pu32Value); 890 891 /* 892 * Global register set read/write functions. 890 /** @} */ 891 892 /** @name Global register set read/write functions. 893 * @{ 893 894 */ 894 895 static int hdaRegWriteGCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); … … 909 910 static int hdaRegReadIRS(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); 910 911 static int hdaRegWriteBase(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); 911 912 /* 913 * {IOB}SDn read/write functions. 912 /** @} */ 913 914 /** @name {IOB}SDn write functions. 915 * @{ 914 916 */ 915 917 static int hdaRegWriteSDCBL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); … … 922 924 static int hdaRegWriteSDBDPL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); 923 925 static int hdaRegWriteSDBDPU(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); 926 /** @} */ 927 928 /* Locking + logging. */ 924 929 DECLINLINE(int) hdaRegWriteSDLock(PHDASTATE pThis, PHDASTREAM pStream, uint32_t iReg, uint32_t u32Value); 925 930 DECLINLINE(void) hdaRegWriteSDUnlock(PHDASTREAM pStream); 926 931 927 /* 928 * Generic register read/write functions.932 /** @name Generic register read/write functions. 933 * @{ 929 934 */ 930 935 static int hdaRegReadU32(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); … … 936 941 static int hdaRegReadU8(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); 937 942 static int hdaRegWriteU8(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); 943 /** @} */ 938 944 939 945 #ifdef IN_RING3 … … 1397 1403 * 1398 1404 * @returns Register index on success, -1 if not found. 1399 * @param pThis The HDA device state.1400 1405 * @param offReg The register offset. 1401 1406 */ 1402 static int hdaRegLookup( PHDASTATE pThis,uint32_t offReg)1407 static int hdaRegLookup(uint32_t offReg) 1403 1408 { 1404 1409 /* … … 1449 1454 * 1450 1455 * @returns Register index on success, -1 if not found. 1451 * @param pThis The HDA device state.1452 1456 * @param offReg The register offset. 1453 1457 */ 1454 static int hdaRegLookupWithin( PHDASTATE pThis,uint32_t offReg)1458 static int hdaRegLookupWithin(uint32_t offReg) 1455 1459 { 1456 1460 /* … … 2790 2794 } 2791 2795 2792 rc= hdaRegWriteSDLock(pThis, pStream, iReg, u32Value);2793 AssertRC(rc );2796 int rcSem = hdaRegWriteSDLock(pThis, pStream, iReg, u32Value); 2797 AssertRC(rcSem); 2794 2798 2795 2799 LogFunc(("[SD%RU8]: Hz=%RU32, Channels=%RU8, enmFmt=%RU32\n", … … 2801 2805 { 2802 2806 case PDMAUDIODIR_IN: 2803 # ifdef VBOX_WITH_HDA_MIC_IN2804 # error "Implement me!"2805 # else2807 # ifdef VBOX_WITH_HDA_MIC_IN 2808 # error "Implement me!" 2809 # else 2806 2810 strmCfg.DestSource.Source = PDMAUDIORECSOURCE_LINE; 2807 2811 RTStrPrintf(strmCfg.szName, RT_ELEMENTS(strmCfg.szName), "Line In"); 2808 # endif2812 # endif 2809 2813 break; 2810 2814 … … 2835 2839 if (RT_SUCCESS(rc)) 2836 2840 { 2837 int rc2;2838 2841 PHDADRIVER pDrv; 2839 2842 RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node) 2840 2843 { 2844 int rc2; 2841 2845 switch (strmCfg.enmDir) 2842 2846 { … … 2873 2877 else 2874 2878 LogFunc(("[SD%RU8]: (Re-)Opening stream failed with rc=%Rrc\n", pStream->u8SD, rc)); 2875 2879 } 2880 2881 if (RT_SUCCESS(rcSem)) 2876 2882 hdaRegWriteSDUnlock(pStream); 2877 }2878 2883 2879 2884 return VINF_SUCCESS; /* Never return failure. */ … … 2933 2938 * XXX 2934 2939 * 2935 * @return bool Returns @true if write is allowed, @false if not. 2940 * @return VBox status code. ALL THE CALLERS IGNORES THIS. DUH. 2941 * 2936 2942 * @param pThis Pointer to HDA state. 2937 * @param iReg Register to write .2938 * @param u32Value Value to write .2943 * @param iReg Register to write (logging only). 2944 * @param u32Value Value to write (logging only). 2939 2945 */ 2940 2946 DECLINLINE(int) hdaRegWriteSDLock(PHDASTATE pThis, PHDASTREAM pStream, uint32_t iReg, uint32_t u32Value) 2941 2947 { 2942 AssertPtr Return(pThis, VERR_INVALID_POINTER);2943 AssertPtr Return(pStream, VERR_INVALID_POINTER);2948 AssertPtr(pThis); /* don't bother returning errors */ 2949 AssertPtr(pStream); 2944 2950 2945 2951 #ifdef VBOX_STRICT … … 2958 2964 #endif 2959 2965 2966 /** @todo r=bird: Why on EARTH are we using mutexes? USE CRITICAL SECTIONS!! */ 2960 2967 return RTSemMutexRequest(pStream->State.hMtx, RT_INDEFINITE_WAIT); 2961 2968 } … … 4472 4479 */ 4473 4480 uint32_t offReg = GCPhysAddr - pThis->MMIOBaseAddr; 4474 int idxRegDsc = hdaRegLookup( pThis,offReg); /* Register descriptor index. */4481 int idxRegDsc = hdaRegLookup(offReg); /* Register descriptor index. */ 4475 4482 #ifdef LOG_ENABLED 4476 4483 unsigned const cbLog = cb; … … 4589 4596 */ 4590 4597 uint32_t offReg = GCPhysAddr - pThis->MMIOBaseAddr; 4591 int idxRegDsc = hdaRegLookup( pThis,offReg);4598 int idxRegDsc = hdaRegLookup(offReg); 4592 4599 uint32_t idxRegMem = idxRegDsc != -1 ? g_aHdaRegMap[idxRegDsc].mem_idx : UINT32_MAX; 4593 4600 uint64_t u64Value; … … 4636 4643 * shifting out input values. 4637 4644 */ 4638 if (idxRegDsc == -1 && (idxRegDsc = hdaRegLookupWithin( pThis,offReg)) != -1)4645 if (idxRegDsc == -1 && (idxRegDsc = hdaRegLookupWithin(offReg)) != -1) 4639 4646 { 4640 4647 uint32_t const cbBefore = offReg - g_aHdaRegMap[idxRegDsc].offset; Assert(cbBefore > 0 && cbBefore < 4); … … 4683 4690 u64Value >>= cbReg * 8; 4684 4691 if (idxRegDsc == -1) 4685 idxRegDsc = hdaRegLookup( pThis,offReg);4692 idxRegDsc = hdaRegLookup(offReg); 4686 4693 else 4687 4694 {
Note:
See TracChangeset
for help on using the changeset viewer.