VirtualBox

Changeset 85103 in vbox


Ignore:
Timestamp:
Jul 8, 2020 8:39:21 AM (4 years ago)
Author:
vboxsync
Message:

Devices/Storage/DevBusLogic: Improve emulation to match real hardware, bugref:9763

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r84504 r85103  
    13181318    MbxIn.u.in.uHostAdapterStatus  = uHostAdapterStatus;
    13191319    MbxIn.u.in.uTargetDeviceStatus = uDeviceStatus;
     1320    MbxIn.u.in.uReserved           = 0;
    13201321    MbxIn.u.in.uCompletionCode     = uMailboxCompletionCode;
    13211322
     
    24352436        case BUSLOGIC_REGISTER_DATAIN:
    24362437        {
     2438            AssertCompileSize(pThis->LocalRam, 256);
     2439            AssertCompileSize(pThis->iReply, sizeof(uint8_t));
     2440            AssertCompileSize(pThis->cbReplyParametersLeft, sizeof(uint8_t));
     2441
    24372442            if (pThis->fUseLocalRam)
    24382443                *pu32 = pThis->LocalRam.u8View[pThis->iReply];
    24392444            else
    2440                 *pu32 = pThis->aReplyBuffer[pThis->iReply];
     2445            {
     2446                /*
     2447                 * Real adapters seem to pad the reply with zeroes and allow up to 255 bytes even
     2448                 * if the real reply is shorter.
     2449                 */
     2450                if (pThis->iReply >= sizeof(pThis->aReplyBuffer))
     2451                    *pu32 = 0;
     2452                else
     2453                    *pu32 = pThis->aReplyBuffer[pThis->iReply];
     2454            }
    24412455
    24422456            /* Careful about underflow - guest can read data register even if
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