VirtualBox

Ignore:
Timestamp:
Apr 5, 2009 3:16:56 PM (16 years ago)
Author:
vboxsync
Message:

DevVGA: Count IOMMMIOMapMMIO2Page calls, fix signed/unsigned compare warning from uint16_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r18232 r18720  
    11981198        {
    11991199            /** @todo only allow read access (doesn't work now) */
     1200            STAM_COUNTER_INC(&s->StatMapPage);
    12001201            IOMMMIOMapMMIO2Page(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), GCPhys, s->GCPhysVRAM + addr, X86_PTE_RW|X86_PTE_P);
    12011202            /* Set as dirty as write accesses won't be noticed now. */
     
    13301331                && !vga_is_dirty(s, addr))
    13311332            {
     1333                STAM_COUNTER_INC(&s->StatMapPage);
    13321334                IOMMMIOMapMMIO2Page(PDMDevHlpGetVM(s->CTX_SUFF(pDevIns)), GCPhys, s->GCPhysVRAM + addr, X86_PTE_RW | X86_PTE_P);
    13331335                s->fRemappedVGA = true;
     
    13861388        if (((++s->cLatchAccesses) & s->uMaskLatchAccess) == s->uMaskLatchAccess)
    13871389        {
    1388             static uint32_t aMask[5]  = {0x3ff, 0x1ff, 0x7f, 0x3f, 0x1f};
    1389             static uint64_t aDelta[5] = {10000000, 5000000, 2500000, 1250000, 625000};
     1390            static uint32_t const s_aMask[5]  = {   0x3ff,   0x1ff,    0x7f,    0x3f,  0x1f};
     1391            static uint64_t const s_aDelta[5] = {10000000, 5000000, 2500000, 1250000, 625000};
    13901392            if (PDMDevHlpCanEmulateIoBlock(s->CTX_SUFF(pDevIns)))
    13911393            {
     
    13951397                * to the recompiler
    13961398                */
    1397                 if (u64CurTime - s->u64LastLatchedAccess < aDelta[s->iMask])
     1399                if (u64CurTime - s->u64LastLatchedAccess < s_aDelta[s->iMask])
    13981400                {
    13991401                    s->u64LastLatchedAccess = 0;
    1400                     s->iMask                = RT_MIN(s->iMask + 1, RT_ELEMENTS(aMask) - 1);
    1401                     s->uMaskLatchAccess     = aMask[s->iMask];
     1402                    s->iMask                = RT_MIN(s->iMask + 1U, RT_ELEMENTS(s_aMask) - 1U);
     1403                    s->uMaskLatchAccess     = s_aMask[s->iMask];
    14021404                    s->cLatchAccesses       = s->uMaskLatchAccess - 1;
    14031405                    return VINF_EM_RAW_EMULATE_IO_BLOCK;
     
    14051407                if (s->u64LastLatchedAccess)
    14061408                {
    1407                     Log2(("Reset mask (was %d) delta %RX64 (limit %x)\n", s->iMask, u64CurTime - s->u64LastLatchedAccess, aDelta[s->iMask]));
     1409                    Log2(("Reset mask (was %d) delta %RX64 (limit %x)\n", s->iMask, u64CurTime - s->u64LastLatchedAccess, s_aDelta[s->iMask]));
    14081410                    if (s->iMask)
    14091411                        s->iMask--;
    1410                     s->uMaskLatchAccess     = aMask[s->iMask];
     1412                    s->uMaskLatchAccess     = s_aMask[s->iMask];
    14111413                }
    14121414                s->u64LastLatchedAccess = u64CurTime;
     
    14161418                s->u64LastLatchedAccess = 0;
    14171419                s->iMask                = 0;
    1418                 s->uMaskLatchAccess     = aMask[s->iMask];
     1420                s->uMaskLatchAccess     = s_aMask[s->iMask];
    14191421                s->cLatchAccesses       = 0;
    14201422            }
     
    61856187    STAM_REG(pVM, &pThis->StatRZMemoryWrite,    STAMTYPE_PROFILE, "/Devices/VGA/RZ/MMIO-Write", STAMUNIT_TICKS_PER_CALL, "Profiling of the VGAGCMemoryWrite() body.");
    61866188    STAM_REG(pVM, &pThis->StatR3MemoryWrite,    STAMTYPE_PROFILE, "/Devices/VGA/R3/MMIO-Write", STAMUNIT_TICKS_PER_CALL, "Profiling of the VGAGCMemoryWrite() body.");
     6189    STAM_REG(pVM, &pThis->StatMapPage,          STAMTYPE_COUNTER, "/Devices/VGA/MapPageCalls",  STAMUNIT_OCCURENCES,     "Calls to IOMMMIOMapMMIO2Page.");
    61876190
    61886191    /* Init latched access mask. */
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