VirtualBox

Changeset 60440 in vbox


Ignore:
Timestamp:
Apr 11, 2016 7:23:37 PM (8 years ago)
Author:
vboxsync
Message:

VMMDevTesting: Adjusted the CMD and DATA expectations to handle pure 16-bit CPU emulations too.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VMMDevTesting.h

    r60096 r60440  
    6363/** The high nanosecond timestamp - 4 RO.  Read this after the low one!  */
    6464#define VMMDEV_TESTING_IOPORT_TS_HIGH   (VMMDEV_TESTING_IOPORT_BASE + 2)
    65 /** Command register usually used for preparing the data register - 4 WO. */
     65/** Command register usually used for preparing the data register - 4/2 WO. */
    6666#define VMMDEV_TESTING_IOPORT_CMD       (VMMDEV_TESTING_IOPORT_BASE + 3)
    6767/** Data register which use depends on the current command - 1s, 4 WO. */
     
    9292/** Print string, sending a string including newline. (RTTestPrintf) */
    9393#define VMMDEV_TESTING_CMD_PRINT        UINT32_C(0xcab1e008)
     94
     95/** The magic part of the command. */
     96#define VMMDEV_TESTING_CMD_MAGIC        UINT32_C(0xcab1e000)
     97/** The magic part of the command. */
     98#define VMMDEV_TESTING_CMD_MAGIC_MASK   UINT32_C(0xffffff00)
     99/** The magic high word automatically supplied to 16-bit CMD writes. */
     100#define VMMDEV_TESTING_CMD_MAGIC_HI_WORD UINT32_C(0xcab10000)
    94101/** @} */
    95102
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp

    r60096 r60440  
    240240
    241241        /*
    242          * The command port (DWORD write only).
     242         * The command port (DWORD and WORD write only).
     243         * (We have to allow WORD writes for 286, 186 and 8086 execution modes.)
    243244         */
    244245        case VMMDEV_TESTING_IOPORT_CMD:
     246            if (cb == 2)
     247            {
     248                u32 |= VMMDEV_TESTING_CMD_MAGIC_HI_WORD;
     249                cb = 4;
     250            }
    245251            if (cb == 4)
    246252            {
     
    324330                case VMMDEV_TESTING_CMD_TERM:
    325331                case VMMDEV_TESTING_CMD_SUB_DONE:
     332                    if (cb == 2)
     333                    {
     334                        if (off == 0)
     335                        {
     336                            pThis->TestingData.Error.c = u32;
     337                            pThis->offTestingData = 2;
     338                            break;
     339                        }
     340                        if (off == 2)
     341                        {
     342                            u32 <<= 16;
     343                            u32  |= pThis->TestingData.Error.c & UINT16_MAX;
     344                            cb    = 4;
     345                            off   = 0;
     346                        }
     347                        else
     348                            break;
     349                    }
     350
    326351                    if (   off == 0
    327352                        && cb  == 4)
     
    372397                        return VINF_SUCCESS;
    373398                    }
     399                    if (cb == 2)
     400                    {
     401                        if (off == 0)
     402                            pThis->TestingData.Value.u64Value.Words.w0 = (uint16_t)u32;
     403                        else if (off == 2)
     404                            pThis->TestingData.Value.u64Value.Words.w1 = (uint16_t)u32;
     405                        else if (off == 4)
     406                            pThis->TestingData.Value.u64Value.Words.w2 = (uint16_t)u32;
     407                        else if (off == 6)
     408                            pThis->TestingData.Value.u64Value.Words.w3 = (uint16_t)u32;
     409                        else if (off == 8)
     410                            pThis->TestingData.Value.u32Unit = (uint16_t)u32;
     411                        else if (off == 10)
     412                            pThis->TestingData.Value.u32Unit = u32 << 16;
     413                        else
     414                            break;
     415                        pThis->offTestingData = off + 2;
     416                        return VINF_SUCCESS;
     417                    }
     418
    374419                    if (   off >= 12
    375420                        && cb  == 1
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