Changeset 37190 in vbox
- Timestamp:
- May 24, 2011 3:23:48 AM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r37185 r37190 32 32 #define CODECNODE_F0_PARAM_LENGTH 0x14 33 33 #define CODECNODE_F02_PARAM_LENGTH 16 34 34 35 typedef struct CODECCOMMONNODE 35 36 { … … 1835 1836 } 1836 1837 1837 int codecLoadState(CODECState *pCodecState, PSSMHANDLE pSSMHandle) 1838 { 1839 int rc = SSMR3GetMem (pSSMHandle, pCodecState->pNodes, sizeof(CODECNODE) * pCodecState->cTotalNodes); 1838 static DECLCALLBACK(int)codecLoadV1(PCODECState pCodecState, PSSMHANDLE pSSMHandle, size_t cbOffset) 1839 { 1840 size_t cbRawNodesV1 = (sizeof(CODECNODE) + cbOffset) * pCodecState->cTotalNodes; 1841 uint8_t *pu8RawNodesV1 = (uint8_t *)RTMemAlloc(cbRawNodesV1); 1842 uint8_t *pu8NodeV1 = NULL; 1843 int idxNode = 0; 1844 if (!pu8RawNodesV1) 1845 return VERR_NO_MEMORY; 1846 int rc = SSMR3GetMem (pSSMHandle, pu8RawNodesV1, cbRawNodesV1); 1847 1848 if (RT_FAILURE(rc)) 1849 { 1850 RTMemFree(pu8RawNodesV1); 1851 AssertRCReturn(rc, rc); 1852 } 1853 pu8NodeV1 = &pu8RawNodesV1[0]; 1854 for (idxNode = 0; idxNode < pCodecState->cTotalNodes; ++idxNode) 1855 { 1856 pCodecState->pNodes[idxNode].node.id = pu8NodeV1[0]; 1857 memcpy(pCodecState->pNodes[idxNode].node.au32F00_param, 1858 pu8NodeV1 + RT_OFFSETOF(CODECCOMMONNODE, au32F00_param), 1859 sizeof(CODECNODE) - RT_OFFSETOF(CODECCOMMONNODE,au32F00_param)); 1860 pu8NodeV1 += sizeof(CODECNODE) + cbOffset; 1861 } 1862 1863 RTMemFree(pu8RawNodesV1); 1864 return rc; 1865 } 1866 1867 int codecLoadState(CODECState *pCodecState, PSSMHANDLE pSSMHandle, uint32_t uVersion) 1868 { 1869 int rc; 1870 if (uVersion == 1) 1871 { 1872 #if RT_ARCH_X86 1873 if (SSMR3HandleHostBits(pSSMHandle) == 32) 1874 rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long)); 1875 else 1876 rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint64_t)); 1877 #else 1878 if (SSMR3HandleHostBits(pSSMHandle) == 64) 1879 rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long)); 1880 else 1881 rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint32_t)); 1882 #endif 1883 } 1884 else 1885 rc = SSMR3GetMem (pSSMHandle, pCodecState->pNodes, sizeof(CODECNODE) * pCodecState->cTotalNodes); 1840 1886 if (codecIsDacNode(pCodecState, pCodecState->u8DacLineOut)) 1841 1887 codecToAudVolume(&pCodecState->pNodes[pCodecState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME); -
trunk/src/VBox/Devices/Audio/DevCodec.h
r36691 r37190 527 527 int codecDestruct(CODECState *pCodecState); 528 528 int codecSaveState(CODECState *pCodecState, PSSMHANDLE pSSMHandle); 529 int codecLoadState(CODECState *pCodecState, PSSMHANDLE pSSMHandle );529 int codecLoadState(CODECState *pCodecState, PSSMHANDLE pSSMHandle, uint32_t uVersion); 530 530 int codecOpenVoice(CODECState *pCodecState, ENMSOUNDSOURCE enmSoundSource, audsettings_t *pAudioSettings); 531 532 #define HDA_SSM_VERSION 2 531 533 532 534 # ifdef VBOX_WITH_HDA_CODEC_EMU -
trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
r37185 r37190 53 53 #endif 54 54 55 #define HDA_SSM_VERSION 256 55 PDMBOTHCBDECL(int) hdaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb); 57 56 PDMBOTHCBDECL(int) hdaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb); … … 1996 1995 PCIINTELHDLinkState *pThis = PDMINS_2_DATA(pDevIns, PCIINTELHDLinkState *); 1997 1996 /* Load Codec nodes states */ 1998 if (uVersion <HDA_SSM_VERSION)1997 if (uVersion > HDA_SSM_VERSION) 1999 1998 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 2000 1999 Assert (uPass == SSM_PASS_FINAL); NOREF(uPass); 2001 2000 2002 codecLoadState(&pThis->hda.Codec, pSSMHandle );2001 codecLoadState(&pThis->hda.Codec, pSSMHandle, uVersion); 2003 2002 /* Load MMIO registers */ 2004 2003 SSMR3GetMem (pSSMHandle, pThis->hda.au32Regs, sizeof (pThis->hda.au32Regs));
Note:
See TracChangeset
for help on using the changeset viewer.