VirtualBox

Changeset 6188 in vbox


Ignore:
Timestamp:
Dec 27, 2007 3:29:12 PM (17 years ago)
Author:
vboxsync
Message:

Set interrupt if states changed

Location:
trunk/src/VBox/Devices/Serial
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r6131 r6188  
    146146    int                             thr_ipending;
    147147    int                             irq;
     148    bool                            msr_changed;
    148149
    149150    bool                            fGCEnabled;
     
    182183    } else if (s->thr_ipending && (s->ier & UART_IER_THRI)) {
    183184        s->iir = UART_IIR_THRI;
     185    } else if (s->msr_changed && (s->ier & UART_IER_RLSI)) {
     186        s->iir = UART_IIR_RLSI;
    184187    } else {
    185188        s->iir = UART_IIR_NO_INT;
     
    281284        {
    282285            int break_enable;
    283             s->lcr = val;
    284             serial_update_parameters(s);
     286            if (s->lcr != val)
     287            {
     288                s->lcr = val;
     289                serial_update_parameters(s);
     290            }
    285291            break_enable = (val >> 6) & 1;
    286292            if (break_enable != s->last_break_enable) {
     
    375381            /* Reset delta bits. */
    376382            s->msr &= ~UART_MSR_ANY_DELTA;
     383            s->msr_changed = false;
     384            serial_update_irq(s);
    377385        }
    378386        break;
     
    425433    SerialState *pData = PDMICHARPORT_2_SERIALSTATE(pInterface);
    426434    uint8_t newMsr = 0;
     435
     436    Log(("%s: pInterface=%p newStatusLines=%u\n", __FUNCTION__, pInterface, newStatusLines));
    427437
    428438    PDMCritSectEnter(&pData->CritSect, VERR_PERMISSION_DENIED);
     
    449459
    450460    pData->msr = newMsr;
     461    pData->msr_changed = true;
    451462    serial_update_irq(pData);
    452463
     
    713724     */
    714725    if (!CFGMR3AreValuesValid(pCfgHandle, "IRQ\0IOBase\0"))
     726    {
     727        AssertMsgFailed(("serialConstruct Invalid configuration values\n"));
    715728        return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
     729    }
    716730
    717731    rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &pData->fGCEnabled);
     
    749763        return rc;
    750764
    751 /** @todo r=bird: Check for VERR_CFGM_VALUE_NOT_FOUND and provide sensible defaults.
    752  * Also do AssertMsgFailed(("Configuration error:....)) in the failure cases of CFGMR3Query*()
    753  * and CFGR3AreValuesValid() like we're doing in the other devices.  */
    754765    rc = CFGMR3QueryU8 (pCfgHandle, "IRQ", &irq_lvl);
    755     if (VBOX_FAILURE (rc))
    756         return rc;
     766    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     767    {
     768        /* Provide sensible defaults. */
     769        if (iInstance == 0)
     770            irq_lvl = 4;
     771        else if (iInstance == 1)
     772            irq_lvl = 3;
     773    }
     774    else if (VBOX_FAILURE(rc))
     775        return PDMDEV_SET_ERROR(pDevIns, rc,
     776                                N_("Configuration error: Failed to get the \"IRQ\" value"));
    757777
    758778    rc = CFGMR3QueryU16 (pCfgHandle, "IOBase", &io_base);
    759     if (VBOX_FAILURE (rc))
    760         return rc;
     779    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     780    {
     781        if (iInstance == 0)
     782            io_base = 0x3f8;
     783        else if (iInstance == 1)
     784            io_base = 0x2f8;
     785    }
     786    else if (VBOX_FAILURE(rc))
     787        return PDMDEV_SET_ERROR(pDevIns, rc,
     788                                N_("Configuration error: Failed to get the \"IOBase\" value"));
    761789
    762790    Log(("serialConstruct instance %d iobase=%04x irq=%d\n", iInstance, io_base, irq_lvl));
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r6187 r6188  
    620620                /* The status lines have changed. Notify the device. */
    621621                DWORD dwNewStatusLinesState = 0;
    622                 uint8_t uNewStatusLinesState = 0;
     622                uint32_t uNewStatusLinesState = 0;
    623623
    624624                /* Get the new state */
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