VirtualBox

Changeset 82310 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Dec 1, 2019 1:28:15 AM (5 years ago)
Author:
vboxsync
Message:

DevIchAc97: SSMR3 -> devhlp. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r82295 r82310  
    35663566static int ichac97R3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PAC97STREAM pStream)
    35673567{
    3568     RT_NOREF(pDevIns);
    3569     PAC97BMREGS 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);
    35813581
    35823582    return VINF_SUCCESS;
     
    35883588static DECLCALLBACK(int) ichac97R3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    35893589{
    3590     PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE);
     3590    PAC97STATE    pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE);
     3591    PCPDMDEVHLPR3 pHlp  = pDevIns->pHlpR3;
    35913592
    35923593    LogFlowFuncEnter();
    35933594
    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);
    35973598
    35983599    /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */
     
    36043605    }
    36053606
    3606     SSMR3PutMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));
     3607    pHlp->pfnSSMPutMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));
    36073608
    36083609    uint8_t active[AC97SOUNDSOURCE_END_INDEX];
     
    36123613    active[AC97SOUNDSOURCE_MC_INDEX] = ichac97R3StreamIsEnabled(pThis, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX]) ? 1 : 0;
    36133614
    3614     SSMR3PutMem(pSSM, active, sizeof(active));
     3615    pHlp->pfnSSMPutMem(pSSM, active, sizeof(active));
    36153616
    36163617    LogFlowFuncLeaveRC(VINF_SUCCESS);
     
    36253626 * @param   pStream             AC'97 stream to load.
    36263627 */
    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);
     3628static 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);
    36413643}
    36423644
     
    36463648static DECLCALLBACK(int) ichac97R3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    36473649{
    3648     PAC97STATE pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE);
     3650    PAC97STATE    pThis = PDMDEVINS_2_DATA(pDevIns, PAC97STATE);
     3651    PCPDMDEVHLPR3 pHlp  = pDevIns->pHlpR3;
    36493652
    36503653    LogRel2(("ichac97LoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass));
     
    36533656    Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
    36543657
    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);
    36583661
    36593662    /** @todo r=andy For the next saved state version, add unique stream identifiers and a stream count. */
     
    36613664    for (unsigned i = 0; i < AC97_MAX_STREAMS; i++)
    36623665    {
    3663         int rc2 = ichac97R3LoadStream(pSSM, &pThis->aStreams[i]);
     3666        int rc2 = ichac97R3LoadStream(pDevIns, pSSM, &pThis->aStreams[i]);
    36643667        AssertRCReturn(rc2, rc2);
    36653668    }
    36663669
    3667     SSMR3GetMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));
     3670    pHlp->pfnSSMGetMem(pSSM, pThis->mixer_data, sizeof(pThis->mixer_data));
    36683671
    36693672    /** @todo r=andy Stream IDs are hardcoded to certain streams. */
    36703673    uint8_t uaStrmsActive[AC97SOUNDSOURCE_END_INDEX];
    3671     int rc2 = SSMR3GetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive));
     3674    int rc2 = pHlp->pfnSSMGetMem(pSSM, uaStrmsActive, sizeof(uaStrmsActive));
    36723675    AssertRCReturn(rc2, rc2);
    36733676
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette