VirtualBox

Changeset 28012 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Apr 6, 2010 2:52:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59719
Message:

Use PGMR3QueryFreeMemory instead

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r27999 r28012  
    29922992
    29932993/**
    2994  * Return the total amount of ballooned pages for all VMs
     2994 * Return the total amount of free pages
    29952995 *
    29962996 * @returns VBox status code:
     
    29982998 * @param   pReq            The request packet.
    29992999 */
    3000 GMMR0DECL(int) GMMR0QueryTotalBalloonSizeReq(PVM pVM, PGMMBALLOONQUERYREQ pReq)
     3000GMMR0DECL(int) GMMR0QueryTotalFreePagesReq(PVM pVM, PGMMFREEQUERYREQ pReq)
    30013001{
    30023002    /*
     
    30053005    AssertPtrReturn(pVM, VERR_INVALID_POINTER);
    30063006    AssertPtrReturn(pReq, VERR_INVALID_POINTER);
    3007     AssertMsgReturn(pReq->Hdr.cbReq == sizeof(GMMBALLOONQUERYREQ),
    3008                     ("%#x < %#x\n", pReq->Hdr.cbReq, sizeof(GMMBALLOONQUERYREQ)),
     3007    AssertMsgReturn(pReq->Hdr.cbReq == sizeof(GMMFREEQUERYREQ),
     3008                    ("%#x < %#x\n", pReq->Hdr.cbReq, sizeof(GMMFREEQUERYREQ)),
    30093009                    VERR_INVALID_PARAMETER);
    30103010
     
    30143014    PGMM pGMM;
    30153015    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
    3016     pReq->cBalloonedPages = pGMM->cBalloonedPages;
     3016    pReq->cFreePages = (pGMM->cChunks << GMM_CHUNK_SHIFT) - pGMM->cAllocatedPages;
    30173017    GMM_CHECK_SANITY_UPON_LEAVING(pGMM);
    30183018
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r27999 r28012  
    910910            return GMMR0FreeLargePageReq(pVM, idCpu, (PGMMFREELARGEPAGEREQ)pReqHdr);
    911911
     912        case VMMR0_DO_GMM_QUERY_TOTAL_FREE_PAGES:
     913            if (u64Arg)
     914                return VERR_INVALID_PARAMETER;
     915            return GMMR0QueryTotalFreePagesReq(pVM, (PGMMFREEQUERYREQ)pReqHdr);
     916
    912917        case VMMR0_DO_GMM_BALLOONED_PAGES:
    913918            if (u64Arg)
    914919                return VERR_INVALID_PARAMETER;
    915920            return GMMR0BalloonedPagesReq(pVM, idCpu, (PGMMBALLOONEDPAGESREQ)pReqHdr);
    916 
    917         case VMMR0_DO_GMM_QUERY_TOTAL_BALLOON_SIZE:
    918             if (u64Arg)
    919                 return VERR_INVALID_PARAMETER;
    920             return GMMR0QueryTotalBalloonSizeReq(pVM, (PGMMBALLOONQUERYREQ)pReqHdr);
    921921
    922922        case VMMR0_DO_GMM_MAP_UNMAP_CHUNK:
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette