Changeset 82310 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 1, 2019 1:28:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r82295 r82310 3566 3566 static int ichac97R3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream) 3567 3567 { 3568 RT_NOREF(pDevIns);3569 P AC97BMREGS pRegs = &pStream->Regs;3570 3571 SSMR3PutU32(pSSM, pRegs->bdbar);3572 SSMR3PutU8( pSSM, pRegs->civ);3573 SSMR3PutU8( pSSM, pRegs->lvi);3574 SSMR3PutU16(pSSM, pRegs->sr);3575 SSMR3PutU16(pSSM, pRegs->picb);3576 SSMR3PutU8( pSSM, pRegs->piv);3577 SSMR3PutU8( pSSM, pRegs->cr);3578 SSMR3PutS32(pSSM, pRegs->bd_valid);3579 SSMR3PutU32(pSSM, pRegs->bd.addr);3580 SSMR3PutU32(pSSM, pRegs->bd.ctl_len);3568 PAC97BMREGS pRegs = &pStream->Regs; 3569 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3570 3571 pHlp->pfnSSMPutU32(pSSM, pRegs->bdbar); 3572 pHlp->pfnSSMPutU8( pSSM, pRegs->civ); 3573 pHlp->pfnSSMPutU8( pSSM, pRegs->lvi); 3574 pHlp->pfnSSMPutU16(pSSM, pRegs->sr); 3575 pHlp->pfnSSMPutU16(pSSM, pRegs->picb); 3576 pHlp->pfnSSMPutU8( pSSM, pRegs->piv); 3577 pHlp->pfnSSMPutU8( pSSM, pRegs->cr); 3578 pHlp->pfnSSMPutS32(pSSM, pRegs->bd_valid); 3579 pHlp->pfnSSMPutU32(pSSM, pRegs->bd.addr); 3580 pHlp->pfnSSMPutU32(pSSM, pRegs->bd.ctl_len); 3581 3581 3582 3582 return VINF_SUCCESS; … … 3588 3588 static DECLCALLBACK(int) ichac97R3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 3589 3589 { 3590 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 3590 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 3591 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3591 3592 3592 3593 LogFlowFuncEnter(); 3593 3594 3594 SSMR3PutU32(pSSM, pThis->glob_cnt);3595 SSMR3PutU32(pSSM, pThis->glob_sta);3596 SSMR3PutU32(pSSM, pThis->cas);3595 pHlp->pfnSSMPutU32(pSSM, pThis->glob_cnt); 3596 pHlp->pfnSSMPutU32(pSSM, pThis->glob_sta); 3597 pHlp->pfnSSMPutU32(pSSM, pThis->cas); 3597 3598 3598 3599 /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */ … … 3604 3605 } 3605 3606 3606 SSMR3PutMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));3607 pHlp->pfnSSMPutMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data)); 3607 3608 3608 3609 uint8_t active[AC97SOUNDSOURCE_END_INDEX]; … … 3612 3613 active[AC97SOUNDSOURCE_MC_INDEX] = ichac97R3StreamIsEnabled(pThis, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX]) ? 1 : 0; 3613 3614 3614 SSMR3PutMem(pSSM, active, sizeof(active));3615 pHlp->pfnSSMPutMem(pSSM, active, sizeof(active)); 3615 3616 3616 3617 LogFlowFuncLeaveRC(VINF_SUCCESS); … … 3625 3626 * @param pStream AC'97 stream to load. 3626 3627 */ 3627 static int ichac97R3LoadStream(PSSMHANDLE pSSM, PAC97STREAM pStream) 3628 { 3629 PAC97BMREGS pRegs = &pStream->Regs; 3630 3631 SSMR3GetU32(pSSM, &pRegs->bdbar); 3632 SSMR3GetU8( pSSM, &pRegs->civ); 3633 SSMR3GetU8( pSSM, &pRegs->lvi); 3634 SSMR3GetU16(pSSM, &pRegs->sr); 3635 SSMR3GetU16(pSSM, &pRegs->picb); 3636 SSMR3GetU8( pSSM, &pRegs->piv); 3637 SSMR3GetU8( pSSM, &pRegs->cr); 3638 SSMR3GetS32(pSSM, &pRegs->bd_valid); 3639 SSMR3GetU32(pSSM, &pRegs->bd.addr); 3640 return SSMR3GetU32(pSSM, &pRegs->bd.ctl_len); 3628 static int ichac97R3LoadStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream) 3629 { 3630 PAC97BMREGS pRegs = &pStream->Regs; 3631 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3632 3633 pHlp->pfnSSMGetU32(pSSM, &pRegs->bdbar); 3634 pHlp->pfnSSMGetU8( pSSM, &pRegs->civ); 3635 pHlp->pfnSSMGetU8( pSSM, &pRegs->lvi); 3636 pHlp->pfnSSMGetU16(pSSM, &pRegs->sr); 3637 pHlp->pfnSSMGetU16(pSSM, &pRegs->picb); 3638 pHlp->pfnSSMGetU8( pSSM, &pRegs->piv); 3639 pHlp->pfnSSMGetU8( pSSM, &pRegs->cr); 3640 pHlp->pfnSSMGetS32(pSSM, &pRegs->bd_valid); 3641 pHlp->pfnSSMGetU32(pSSM, &pRegs->bd.addr); 3642 return pHlp->pfnSSMGetU32(pSSM, &pRegs->bd.ctl_len); 3641 3643 } 3642 3644 … … 3646 3648 static DECLCALLBACK(int) ichac97R3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 3647 3649 { 3648 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 3650 PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE); 3651 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3649 3652 3650 3653 LogRel2(("ichac97LoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass)); … … 3653 3656 Assert(uPass == SSM_PASS_FINAL); NOREF(uPass); 3654 3657 3655 SSMR3GetU32(pSSM, &pThis->glob_cnt);3656 SSMR3GetU32(pSSM, &pThis->glob_sta);3657 SSMR3GetU32(pSSM, &pThis->cas);3658 pHlp->pfnSSMGetU32(pSSM, &pThis->glob_cnt); 3659 pHlp->pfnSSMGetU32(pSSM, &pThis->glob_sta); 3660 pHlp->pfnSSMGetU32(pSSM, &pThis->cas); 3658 3661 3659 3662 /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */ … … 3661 3664 for (unsigned i = 0; i < AC97_MAX_STREAMS; i++) 3662 3665 { 3663 int rc2 = ichac97R3LoadStream(p SSM, &pThis->aStreams[i]);3666 int rc2 = ichac97R3LoadStream(pDevIns, pSSM, &pThis->aStreams[i]); 3664 3667 AssertRCReturn(rc2, rc2); 3665 3668 } 3666 3669 3667 SSMR3GetMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));3670 pHlp->pfnSSMGetMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data)); 3668 3671 3669 3672 /** @todo r=andy Stream IDs are hardcoded to certain streams. */ 3670 3673 uint8_t uaStrmsActive[AC97SOUNDSOURCE_END_INDEX]; 3671 int rc2 = SSMR3GetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive));3674 int rc2 = pHlp->pfnSSMGetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive)); 3672 3675 AssertRCReturn(rc2, rc2); 3673 3676
Note:
See TracChangeset
for help on using the changeset viewer.