VirtualBox

Ignore:
Timestamp:
Apr 30, 2021 1:38:01 PM (4 years ago)
Author:
vboxsync
Message:

Audio/SB16: Do some sanity checking for hardware CFGM values. bugref:9890

File:
1 edited

Legend:

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

    r88800 r88807  
    31283128    if (RT_FAILURE(rc))
    31293129        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Failed to get the \"IRQ\" value"));
     3130    /* Sanity-check supported SB16 IRQs. */
     3131    if (    2 != pStream->HwCfgDefault.uIrq
     3132        &&  5 != pStream->HwCfgDefault.uIrq
     3133        &&  7 != pStream->HwCfgDefault.uIrq
     3134        && 10 != pStream->HwCfgDefault.uIrq)
     3135        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Invalid \"IRQ\" value."));
    31303136    pStream->HwCfgRuntime.uIrq  = pStream->HwCfgDefault.uIrq;
    31313137
     
    31333139    if (RT_FAILURE(rc))
    31343140        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Failed to get the \"DMA\" value"));
     3141    if (    0 != pStream->HwCfgDefault.uDmaChanLow
     3142        &&  1 != pStream->HwCfgDefault.uDmaChanLow
     3143        &&  3 != pStream->HwCfgDefault.uDmaChanLow)
     3144        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Invalid \"DMA\" value."));
    31353145    pStream->HwCfgRuntime.uDmaChanLow  = pStream->HwCfgDefault.uDmaChanLow;
    31363146
     
    31383148    if (RT_FAILURE(rc))
    31393149        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Failed to get the \"DMA16\" value"));
     3150    if (    5 != pStream->HwCfgDefault.uDmaChanHigh
     3151        &&  6 != pStream->HwCfgDefault.uDmaChanHigh
     3152        &&  7 != pStream->HwCfgDefault.uDmaChanHigh)
     3153        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Invalid \"DMA16\" value."));
    31403154    pStream->HwCfgRuntime.uDmaChanHigh = pStream->HwCfgDefault.uDmaChanHigh;
    31413155
     
    31433157    if (RT_FAILURE(rc))
    31443158        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Failed to get the \"Port\" value"));
     3159    /* Sanity-check supported SB16 ports. */
     3160    if (   0x220 != pStream->HwCfgDefault.uPort
     3161        && 0x240 != pStream->HwCfgDefault.uPort
     3162        && 0x260 != pStream->HwCfgDefault.uPort
     3163        && 0x280 != pStream->HwCfgDefault.uPort)
     3164        return PDMDEV_SET_ERROR(pDevIns, rc, N_("SB16 configuration error: Invalid \"Port\" value. Did you specify it as a hex value (e.g. 0x220)?"));
    31453165    pStream->HwCfgRuntime.uPort = pStream->HwCfgDefault.uPort;
    31463166
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