VirtualBox

Changeset 17485 in vbox


Ignore:
Timestamp:
Mar 6, 2009 4:13:27 PM (16 years ago)
Author:
vboxsync
Message:

Fixes to pgmPhysWriteHandler and PGMPhysGCPhys2R3Ptr (new phys code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r17465 r17485  
    11741174    int rc = pgmPhysGetPageAndRangeEx(&pVM->pgm.s, GCPhys, &pPage, &pRam);
    11751175    if (RT_SUCCESS(rc))
    1176         rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, (void **)&pR3Ptr);
     1176        rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, (void **)pR3Ptr);
    11771177
    11781178    pgmUnlock(pVM);
     
    19361936                pVirtPhys = (PPGMPHYS2VIRTHANDLER)RTAvlroGCPhysGetBestFit(&pVM->pgm.s.CTX_SUFF(pTrees)->PhysToVirtHandlers,
    19371937                                                                          GCPhys, true /* fAbove */);
    1938                 if (pVirtPhys)
     1938                if (    pVirtPhys
     1939                    &&  (pVirtPhys->Core.Key >> PAGE_SHIFT) == (GCPhys >> PAGE_SHIFT))
    19391940                {
    19401941                    /* ASSUME that pVirtPhys only covers one page. */
    19411942                    Assert((pVirtPhys->Core.Key >> PAGE_SHIFT) == (pVirtPhys->Core.KeyLast >> PAGE_SHIFT));
    1942                     pVirt = (PPGMVIRTHANDLER)((uintptr_t)pVirtPhys + pVirtPhys->offVirtHandler);
    1943                     iVirtPage = pVirtPhys - &pVirt->aPhysToVirt[0]; Assert(iVirtPage == 0);
    1944                     offVirtLast = pVirtPhys->Core.KeyLast & PAGE_OFFSET_MASK - (GCPhys & PAGE_OFFSET_MASK);
     1943                    Assert(pVirtPhys->Core.Key > GCPhys);
     1944
     1945                    pVirt       = (PPGMVIRTHANDLER)((uintptr_t)pVirtPhys + pVirtPhys->offVirtHandler);
     1946                    iVirtPage   = pVirtPhys - &pVirt->aPhysToVirt[0]; Assert(iVirtPage == 0);
     1947                    offVirt     = (pVirtPhys->Core.Key     & PAGE_OFFSET_MASK) - (GCPhys & PAGE_OFFSET_MASK);
     1948                    offVirtLast = (pVirtPhys->Core.KeyLast & PAGE_OFFSET_MASK) - (GCPhys & PAGE_OFFSET_MASK);
    19451949                }
    19461950                else
    19471951                {
    1948                     pVirt     = NULL;
    1949                     fMoreVirt = false;
    1950                     offVirt   = offVirtLast = PAGE_SIZE;
     1952                    pVirt       = NULL;
     1953                    fMoreVirt   = false;
     1954                    offVirt     = offVirtLast = PAGE_SIZE;
    19511955                }
    19521956            }
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