Changeset 33881 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Nov 9, 2010 8:08:18 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67529
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
r33880 r33881 433 433 DECLCALLBACK(int)hdaRegWriteRIRBSTS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value); 434 434 DECLCALLBACK(int)hdaRegWriteIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value); 435 DECLCALLBACK(int)hdaRegReadIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value); 435 436 DECLCALLBACK(int)hdaRegWriteSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value); 436 437 DECLCALLBACK(int)hdaRegReadSDCTL(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value); … … 506 507 { 0x00060, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, hdaRegReadU32 , hdaRegWriteU32 , "IC" , "Immediate Command" }, 507 508 { 0x00064, 0x00004, 0x00000000, 0xFFFFFFFF, hdaRegReadU32 , hdaRegWriteUnimplemented, "IR" , "Immediate Response" }, 508 { 0x00068, 0x00004, 0x00000002, 0x00000002, hdaRegRead U16, hdaRegWriteIRS , "IRS" , "Immediate Command Status" },509 { 0x00068, 0x00004, 0x00000002, 0x00000002, hdaRegReadIRS , hdaRegWriteIRS , "IRS" , "Immediate Command Status" }, 509 510 { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, hdaRegReadU32 , hdaRegWriteBase , "DPLBASE" , "DMA Position Lower Base" }, 510 511 { 0x00074, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, hdaRegReadU32 , hdaRegWriteBase , "DPUBASE" , "DMA Position Upper Base" }, … … 1057 1058 } 1058 1059 1060 DECLCALLBACK(int)hdaRegReadIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t *pu32Value) 1061 { 1062 int rc = VINF_SUCCESS; 1063 /* regarding 3.4.3 we should mark IRS as busy in case CORB is active */ 1064 if ( CORBWP(pState) != CORBRP(pState) 1065 || HDA_REG_FLAG_VALUE(pState, CORBCTL, DMA)) 1066 IRS(pState) = HDA_REG_FIELD_FLAG_MASK(IRS, ICB); /* busy */ 1067 1068 rc = hdaRegReadU32(pState, offset, index, pu32Value); 1069 return rc; 1070 } 1071 1059 1072 DECLCALLBACK(int)hdaRegWriteIRS(INTELHDLinkState* pState, uint32_t offset, uint32_t index, uint32_t u32Value) 1060 1073 { … … 1062 1075 uint64_t resp; 1063 1076 PFNCODECVERBPROCESSOR pfn = (PFNCODECVERBPROCESSOR)NULL; 1077 /* 1078 * if guest set ICB bit of IRS register HDA should process verb in IC register and 1079 * writes response in IR register and set IRV (valid in case of success) bit of IRS register. 1080 */ 1064 1081 if ( u32Value & HDA_REG_FIELD_FLAG_MASK(IRS, ICB) 1065 1082 && !IRS_ICB(pState)) 1066 1083 { 1067 1084 uint32_t cmd = IC(pState); 1085 if (CORBWP(pState) != CORBRP(pState)) 1086 { 1087 /* 1088 * 3.4.3 defines behaviour of immediate Command status register. 1089 */ 1090 LogRel(("hda: guest has tried process immediate verb (%x) with active CORB\n", cmd)); 1091 return rc; 1092 } 1068 1093 IRS(pState) = HDA_REG_FIELD_FLAG_MASK(IRS, ICB); /* busy */ 1069 1094 Log(("hda: IC:%x\n", cmd)); … … 1076 1101 IR(pState) = (uint32_t)resp; 1077 1102 Log(("hda: IR:%x\n", IR(pState))); 1078 IRS(pState) = HDA_REG_FIELD_FLAG_MASK(IRS, IRV); /* clear busy, result is ready */ 1103 IRS(pState) = HDA_REG_FIELD_FLAG_MASK(IRS, IRV); /* result is ready */ 1104 IRS(pState) &= ~HDA_REG_FIELD_FLAG_MASK(IRS, ICB); /* busy is clear */ 1079 1105 return rc; 1080 1106 } 1107 /* 1108 * when guest's read the response it should clean the IRV bit of the IRS register. 1109 */ 1081 1110 if ( u32Value & HDA_REG_FIELD_FLAG_MASK(IRS, IRV) 1082 1111 && IRS_IRV(pState)) 1083 IRS(pState) ^=HDA_REG_FIELD_FLAG_MASK(IRS, IRV);1112 IRS(pState) &= ~HDA_REG_FIELD_FLAG_MASK(IRS, IRV); 1084 1113 return rc; 1085 1114 }
Note:
See TracChangeset
for help on using the changeset viewer.