VirtualBox

Changeset 30061 in vbox


Ignore:
Timestamp:
Jun 7, 2010 9:34:15 AM (15 years ago)
Author:
vboxsync
Message:

Page fusion test api change

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuestLib.h

    r30040 r30061  
    560560VBGLR3DECL(int)     VbglR3CheckSharedModules(void);
    561561VBGLR3DECL(bool)    VbglR3PageSharingIsEnabled(void);
    562 VBGLR3DECL(int)     VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, bool *pfReadWrite);
     562VBGLR3DECL(int)     VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, uint64_t *puPageFlags);
    563563/** @} */
    564564
  • trunk/include/VBox/VMMDev.h

    r30040 r30061  
    11971197    /** Page address. */
    11981198    RTGCPTR                     GCPtrPage;
     1199    /** Page flags. */
     1200    uint64_t                    uPageFlags;
    11991201    /** Shared flag (out) */
    12001202    bool                        fShared;
    1201     /** Read/write flag (out) */
    1202     bool                        fReadWrite;
    12031203    /** Alignment */
    1204     bool                        fAlignment[2];
     1204    bool                        fAlignment[3];
    12051205} VMMDevPageIsSharedRequest;
    12061206
  • trunk/include/VBox/pgm.h

    r30050 r30061  
    570570VMMR3DECL(int)     PGMR3SharedModuleUnregister(PVM pVM, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule);
    571571VMMR3DECL(int)     PGMR3SharedModuleCheckAll(PVM pVM);
    572 VMMR3DECL(int)     PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, bool *pfReadWrite);
     572VMMR3DECL(int)     PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, uint64_t *puPageFlags);
    573573/** @} */
    574574
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibModule.cpp

    r30040 r30061  
    149149 * @returns true/false enabled/disabled
    150150 */
    151 VBGLR3DECL(int) VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, bool *pfReadWrite)
     151VBGLR3DECL(int) VbglR3PageIsShared(RTGCPTR pPage, bool *pfShared, uint64_t *puPageFlags)
    152152{
    153153#ifdef DEBUG
     
    160160    {
    161161        *pfShared    = Req.fShared;
    162         *pfReadWrite = Req.fReadWrite;
     162        *puPageFlags = Req.uPageFlags;
    163163    }
    164164    return rc;
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r30041 r30061  
    18471847
    18481848            if (pRequestHeader->size != sizeof(VMMDevPageIsSharedRequest))
    1849                 pRequestHeader->rc = VERR_INVALID_PARAMETER;
    1850             else
    1851                 pRequestHeader->rc = PGMR3SharedModuleGetPageState(PDMDevHlpGetVM(pDevIns), pReq->GCPtrPage, &pReq->fShared, &pReq->fReadWrite);
     1849            {
     1850                pRequestHeader->rc = VERR_INVALID_PARAMETER;
     1851            }
     1852            else
     1853            {
     1854                pRequestHeader->rc = PGMR3SharedModuleGetPageState(PDMDevHlpGetVM(pDevIns), pReq->GCPtrPage, &pReq->fShared, &pReq->uPageFlags);
     1855            }
    18521856# else
    18531857            pRequestHeader->rc = VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/VMM/PGMSharedPage.cpp

    r30041 r30061  
    184184 * @param   GCPtrPage           Page address
    185185 * @param   pfShared            Shared status (out)
    186  * @param   pfReadWrite         Read/write status (out)
    187  */
    188 VMMR3DECL(int) PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, bool *pfReadWrite)
     186 * @param   puPageFlags         Page flags (out)
     187 */
     188VMMR3DECL(int) PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, uint64_t *puPageFlags)
    189189{
    190190#if defined(VBOX_WITH_PAGE_SHARING) && defined(DEBUG)
     
    196196
    197197    int rc = PGMGstGetPage(VMMGetCpu(pVM), GCPtrPage, &fFlags, &GCPhys);
    198     if (rc == VINF_SUCCESS)
     198    switch (rc)
     199    {
     200    case VINF_SUCCESS:
    199201    {
    200202        PPGMPAGE pPage = pgmPhysGetPage(&pVM->pgm.s, GCPhys);
     
    202204        {
    203205            *pfShared    = PGM_PAGE_IS_SHARED(pPage);
    204             *pfReadWrite = !!(fFlags & X86_PTE_RW);
     206            *puPageFlags = fFlags;
    205207        }
    206208        else
    207209            rc = VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS;
     210        break;
     211    }
     212    case VERR_PAGE_NOT_PRESENT:
     213    case VERR_PAGE_TABLE_NOT_PRESENT:
     214    case VERR_PAGE_MAP_LEVEL4_NOT_PRESENT:
     215    case VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT:
     216        *pfShared = false;
     217        *puPageFlags = 0;
     218        rc = VINF_SUCCESS;
     219        break;
     220
     221    default:
     222        break;
    208223    }
    209224
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