VirtualBox

Changeset 72587 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 17, 2018 5:44:13 PM (7 years ago)
Author:
vboxsync
Message:

DevATA: Moved the static variables (there will be two in play here, R3 + R0/RC) cBusy to the ATADevState structure. bugref:1960

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r70776 r72587  
    286286    RCPTRTYPE(uint8_t *)                pbIOBufferRC;
    287287
    288     RTRCPTR                             Aligmnent1; /**< Align the statistics at an 8-byte boundary. */
     288    /** Counter for number of busy status seen in GC/R0 in a row. */
     289    uint32_t                            cBusyStatusHack;
    289290
    290291    /*
     
    44524453        case 7: /* primary status */
    44534454        {
    4454             /* Counter for number of busy status seen in GC in a row. */
    4455             static unsigned cBusy = 0;
    4456 
    44574455            if (!s->pDrvMedia)
    44584456                val = 0;
     
    44714469            {
    44724470#ifdef IN_RING3
    4473                 cBusy = 0;
     4471                s->cBusyStatusHack = 0;
    44744472                ataR3LockLeave(pCtl);
    44754473
    4476 #ifndef RT_OS_WINDOWS
     4474# ifndef RT_OS_WINDOWS
    44774475                /*
    44784476                 * The thread might be stuck in an I/O operation
     
    44984496                    }
    44994497                }
    4500 #endif
     4498# endif
    45014499
    45024500                RTThreadYield();
     
    45104508                 * especially on SMP systems where we don't gain much by
    45114509                 * yielding the CPU to someone else. */
    4512                 if (++cBusy >= 20)
     4510                if (++s->cBusyStatusHack >= 20)
    45134511                {
    4514                     cBusy = 0;
     4512                    s->cBusyStatusHack = 0;
    45154513                    return VINF_IOM_R3_IOPORT_READ;
    45164514                }
     
    45184516            }
    45194517            else
    4520                 cBusy = 0;
     4518                s->cBusyStatusHack = 0;
    45214519            ataUnsetIRQ(s);
    45224520            break;
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