VirtualBox

Changeset 88536 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Apr 15, 2021 12:21:11 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143812
Message:

Devices/Serial/UartCore: Update the interrupt level everytime the internal interrupt state is updated to avoid the guest losing interrupts for an ISA serial device where the guest expects an edge triggered interrupt

File:
1 edited

Legend:

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

    r87773 r88536  
    315315    LogFlowFunc(("    uRegIirNew=%#x uRegIir=%#x\n", uRegIirNew, pThis->uRegIir));
    316316
    317     /* Change interrupt only if the interrupt status really changed from the previous value. */
    318317    if (uRegIirNew != (pThis->uRegIir & UART_REG_IIR_CHANGED_MASK))
    319     {
    320318        LogFlow(("    Interrupt source changed from %#x -> %#x (IRQ %d -> %d)\n",
    321319                 pThis->uRegIir, uRegIirNew,
    322320                 pThis->uRegIir == UART_REG_IIR_IP_NO_INT ? 0 : 1,
    323321                 uRegIirNew == UART_REG_IIR_IP_NO_INT ? 0 : 1));
    324         if (uRegIirNew == UART_REG_IIR_IP_NO_INT)
    325             pThisCC->pfnUartIrqReq(pDevIns, pThis, pThis->iLUN, 0);
    326         else
    327             pThisCC->pfnUartIrqReq(pDevIns, pThis, pThis->iLUN, 1);
    328     }
    329322    else
    330323        LogFlow(("    No change in interrupt source\n"));
     324
     325    /*
     326     * Set interrupt value accordingly. As this is an ISA device most guests
     327     * configure the IRQ as edge triggered instead of level triggered.
     328     * So this needs to be done everytime, even if the internal interrupt state
     329     * doesn't change in order to avoid the guest losing interrupts (reading one byte at
     330     * a time from the FIFO for instance which doesn't change the interrupt source).
     331     */
     332    if (uRegIirNew == UART_REG_IIR_IP_NO_INT)
     333        pThisCC->pfnUartIrqReq(pDevIns, pThis, pThis->iLUN, 0);
     334    else
     335        pThisCC->pfnUartIrqReq(pDevIns, pThis, pThis->iLUN, 1);
    331336
    332337    if (pThis->uRegFcr & UART_REG_FCR_FIFO_EN)
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