VirtualBox

Changeset 71821 in vbox for trunk


Ignore:
Timestamp:
Apr 11, 2018 12:06:34 PM (7 years ago)
Author:
vboxsync
Message:

DevPit: Increased paranoia level a little.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r71809 r71821  
    659659        return VERR_IOM_IOPORT_UNUSED;
    660660    }
     661    RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia */
    661662
    662663    PPITSTATE   pThis = PDMINS_2_DATA(pDevIns, PPITSTATE);
     
    760761         *  . . . . . . . *  BCD/Binary mode: 0 = 16-bit binary, 1 = four-digit BCD
    761762         */
    762         unsigned channel = u32 >> 6;
     763        unsigned channel = (u32 >> 6) & 0x3;
     764        RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia */
    763765        if (channel == 3)
    764766        {
     
    768770            {
    769771                PPITCHANNEL pChan = &pThis->channels[channel];
    770                 if (u32 & (2 << channel)) {
     772                if (u32 & (2 << channel))
     773                {
    771774                    if (!(u32 & 0x20))
    772775                        pit_latch_count(pChan);
     
    777780                        PTMTIMER pTimer = pChan->CTX_SUFF(pPit)->channels[0].CTX_SUFF(pTimer);
    778781                        pChan->status = (pit_get_out1(pChan, TMTimerGet(pTimer)) << 7)
    779                             | (pChan->rw_mode << 4)
    780                             | (pChan->mode << 1)
    781                             | pChan->bcd;
     782                                      | (pChan->rw_mode << 4)
     783                                      | (pChan->mode << 1)
     784                                      | pChan->bcd;
    782785                        pChan->status_latched = 1;
    783786                    }
     
    820823         * Port 40-42h - Channel Data Ports.
    821824         */
     825        RT_UNTRUSTED_VALIDATED_FENCE(); /* paranoia */
    822826        PPITCHANNEL pChan = &pThis->channels[uPort];
    823827        DEVPIT_LOCK_BOTH_RETURN(pThis, VINF_IOM_R3_IOPORT_WRITE);
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