VirtualBox

Changeset 14742 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 27, 2008 8:49:11 PM (16 years ago)
Author:
vboxsync
Message:

finally fixed timner starvation for real, also REM improvments
by putting external events check into right places and reverted
PIT DRAM refresh rate frequency code to correct one

File:
1 edited

Legend:

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

    r14707 r14742  
    7575 * Define this to flip the 15usec refresh bit on every read.
    7676 * If not defined, it will be flipped correctly. */
    77 #define FAKE_REFRESH_CLOCK
     77/* #define FAKE_REFRESH_CLOCK */
    7878#ifdef DOXYGEN_RUNNING
    7979# define FAKE_REFRESH_CLOCK
     
    648648        /* bit 5 - mirrors timer 2 output condition. */
    649649        const int fOut = pit_get_out(pThis, 2, u64Now);
    650         /* bit 4 - toggled every with each (DRAM?) refresh request, every 15.085 µs. */
     650        /* bit 4 - toggled with each (DRAM?) refresh request, every 15085 µs.
     651                   our timer resolution is around 100-1000 µs, thus we can just flip
     652                   on every increase of quotient by 1
     653         */
    651654#ifdef FAKE_REFRESH_CLOCK
    652655        pThis->dummy_refresh_clock ^= 1;
    653656        const int fRefresh = pThis->dummy_refresh_clock;
    654657#else
    655         /* To make refresh info statistically correct */
    656         const int freq = 15085;
    657         const int fRefresh = ((u64Now % freq ) > (freq / 2)) ? 1 : 0;
     658        const int fRefresh = (u64Now / 15085 ) & 1;
    658659#endif
    659660        /* bit 2,3 NMI / parity status stuff. */
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