VirtualBox

Changeset 71763 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 9, 2018 10:47:02 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121865
Message:

DevSB16: Moved functions around a little to get a more usual grouping.

File:
1 edited

Legend:

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

    r71762 r71763  
    18651865#endif /* !VBOX_WITH_AUDIO_SB16_CALLBACKS */
    18661866
    1867 static void sb16Save(PSSMHANDLE pSSM, PSB16STATE pThis)
     1867
     1868/**
     1869 * @callback_method_impl{FNSSMDEVLIVEEXEC}
     1870 */
     1871static DECLCALLBACK(int) sb16LiveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass)
     1872{
     1873    RT_NOREF(uPass);
     1874    PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE);
     1875
     1876    SSMR3PutS32(pSSM, pThis->irqCfg);
     1877    SSMR3PutS32(pSSM, pThis->dmaCfg);
     1878    SSMR3PutS32(pSSM, pThis->hdmaCfg);
     1879    SSMR3PutS32(pSSM, pThis->portCfg);
     1880    SSMR3PutS32(pSSM, pThis->verCfg);
     1881    return VINF_SSM_DONT_CALL_AGAIN;
     1882}
     1883
     1884/**
     1885 * Worker for sb16SaveExec.
     1886 */
     1887static int sb16Save(PSSMHANDLE pSSM, PSB16STATE pThis)
    18681888{
    18691889    SSMR3PutS32(pSSM, pThis->irq);
     
    19031923    SSMR3PutS32(pSSM, pThis->csp_reg83w);
    19041924
    1905     SSMR3PutMem(pSSM, pThis->in2_data, sizeof (pThis->in2_data));
    1906     SSMR3PutMem(pSSM, pThis->out_data, sizeof (pThis->out_data));
     1925    SSMR3PutMem(pSSM, pThis->in2_data, sizeof(pThis->in2_data));
     1926    SSMR3PutMem(pSSM, pThis->out_data, sizeof(pThis->out_data));
    19071927    SSMR3PutU8 (pSSM, pThis->test_reg);
    19081928    SSMR3PutU8 (pSSM, pThis->last_read_byte);
     
    19151935
    19161936    SSMR3PutS32(pSSM, pThis->mixer_nreg);
    1917     SSMR3PutMem(pSSM, pThis->mixer_regs, 256);
    1918 
    1919 }
    1920 
     1937    return SSMR3PutMem(pSSM, pThis->mixer_regs, 256);
     1938}
     1939
     1940/**
     1941 * @callback_method_impl{FNSSMDEVSAVEEXEC}
     1942 */
     1943static DECLCALLBACK(int) sb16SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
     1944{
     1945    PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE);
     1946
     1947    sb16LiveExec(pDevIns, pSSM, 0);
     1948    return sb16Save(pSSM, pThis);
     1949}
     1950
     1951/**
     1952 * Worker for sb16LoadExec.
     1953 */
    19211954static int sb16Load(PSSMHANDLE pSSM, PSB16STATE pThis)
    19221955{
     
    20222055}
    20232056
    2024 static DECLCALLBACK(int) sb16LiveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass)
    2025 {
    2026     RT_NOREF(uPass);
    2027     PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE);
    2028 
    2029     SSMR3PutS32(pSSM, pThis->irqCfg);
    2030     SSMR3PutS32(pSSM, pThis->dmaCfg);
    2031     SSMR3PutS32(pSSM, pThis->hdmaCfg);
    2032     SSMR3PutS32(pSSM, pThis->portCfg);
    2033     SSMR3PutS32(pSSM, pThis->verCfg);
    2034     return VINF_SSM_DONT_CALL_AGAIN;
    2035 }
    2036 
    2037 static DECLCALLBACK(int) sb16SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    2038 {
    2039     PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE);
    2040 
    2041     sb16LiveExec(pDevIns, pSSM, 0);
    2042     sb16Save(pSSM, pThis);
    2043     return VINF_SUCCESS;
    2044 }
    2045 
     2057/**
     2058 * @callback_method_impl{FNSSMDEVLOADEXEC}
     2059 */
    20462060static DECLCALLBACK(int) sb16LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    20472061{
     
    20852099        return VINF_SUCCESS;
    20862100
    2087     sb16Load(pSSM, pThis);
    2088     return VINF_SUCCESS;
     2101    return sb16Load(pSSM, pThis);
    20892102}
    20902103
Note: See TracChangeset for help on using the changeset viewer.

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