VirtualBox

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


Ignore:
Timestamp:
Oct 21, 2024 7:31:54 AM (6 weeks ago)
Author:
vboxsync
Message:

Devices/Serial/DevPL011: Small optimization, only update the IRQ state if it actually changes, bugref:10403

File:
1 edited

Legend:

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

    r106061 r106541  
    382382    /** The receive FIFO. */
    383383    PL011FIFO                       FifoRecv;
     384    /** The current state of the IRQ line. */
     385    bool                            fIrqAsserted;
    384386} DEVPL011;
    385387/** Pointer to the shared serial device state. */
     
    489491                 pThis, pThis->uRegIrqSts, pThis->uRegIrqMask));
    490492
     493    /* Only set the IRQ state if it actually changed. */
     494    bool fAssert = RT_BOOL(pThis->uRegIrqSts & ~pThis->uRegIrqMask);
    491495    RT_NOREF(pThisCC);
    492     if (pThis->uRegIrqSts & ~pThis->uRegIrqMask)
    493         PDMDevHlpISASetIrqNoWait(pDevIns, pThis->u16Irq, 1);
    494     else
    495         PDMDevHlpISASetIrqNoWait(pDevIns, pThis->u16Irq, 0);
     496    if (pThis->fIrqAsserted ^ fAssert)
     497    {
     498        PDMDevHlpISASetIrqNoWait(pDevIns, pThis->u16Irq, fAssert);
     499        pThis->fIrqAsserted = fAssert;
     500    }
    496501}
    497502
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