VirtualBox

Changeset 26388 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 9, 2010 4:05:42 PM (15 years ago)
Author:
vboxsync
Message:

Convert physical page nr to physical page address

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r25141 r26388  
    641641            /* Copy manually as RTGCPHYS is always 64 bits */
    642642            for (uint32_t j=0;j<VMMDEV_MEMORY_BALLOON_CHUNK_PAGES;j++)
    643                 req->aPhysPage[j] = pPageDesc[j];
     643                req->aPhysPage[j] = pPageDesc[j] << PAGE_SHIFT; /* PFN_NUMBER is physical page nr, so shift left by 12 to get the physical address */
    644644
    645645            req->header.size = RT_OFFSETOF(VMMDevChangeMemBalloon, aPhysPage[VMMDEV_MEMORY_BALLOON_CHUNK_PAGES]);
     
    677677    {
    678678        /* deflate */
    679         for (uint32_t _i=pDevExt->MemBalloon.cBalloons;_i>u32BalloonSize;_i--)
     679        for (uint32_t _i = pDevExt->MemBalloon.cBalloons - 1; _i > u32BalloonSize; _i--)
    680680        {
    681681            uint32_t index = _i - 1;
     
    692692
    693693                /* Copy manually as RTGCPHYS is always 64 bits */
    694                 for (uint32_t j=0;j<VMMDEV_MEMORY_BALLOON_CHUNK_PAGES;j++)
    695                     req->aPhysPage[j] = pPageDesc[j];
     694                for (uint32_t j = 0; j < VMMDEV_MEMORY_BALLOON_CHUNK_PAGES; j++)
     695                    req->aPhysPage[j] = pPageDesc[j] << PAGE_SHIFT; /* PFN_NUMBER is physical page nr, so shift left by 12 to get the physical address */
    696696
    697697                req->header.size = RT_OFFSETOF(VMMDevChangeMemBalloon, aPhysPage[VMMDEV_MEMORY_BALLOON_CHUNK_PAGES]);
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