GMM.cpp revision 5e0d5717f4742e9fc86690c4406e0af249336bbf
65fea56f17cd614bc8908264df980a62e1931468vboxsync * GMM - Global Memory Manager, ring-3 request wrappers.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
65fea56f17cd614bc8908264df980a62e1931468vboxsync * available from http://www.virtualbox.org. This file is free software;
65fea56f17cd614bc8908264df980a62e1931468vboxsync * you can redistribute it and/or modify it under the terms of the GNU
65fea56f17cd614bc8908264df980a62e1931468vboxsync * General Public License (GPL) as published by the Free Software
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
65fea56f17cd614bc8908264df980a62e1931468vboxsync * additional information or have any questions.
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*******************************************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync* Header Files *
65fea56f17cd614bc8908264df980a62e1931468vboxsync*******************************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @see GMMR0InitialReservation
65fea56f17cd614bc8908264df980a62e1931468vboxsyncGMMR3DECL(int) GMMR3InitialReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
65fea56f17cd614bc8908264df980a62e1931468vboxsync return VMMR3CallR0(pVM, VMMR0_DO_GMM_INITIAL_RESERVATION, 0, &Req.Hdr);
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @see GMMR0UpdateReservation
65fea56f17cd614bc8908264df980a62e1931468vboxsyncGMMR3DECL(int) GMMR3UpdateReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages)
65fea56f17cd614bc8908264df980a62e1931468vboxsync return VMMR3CallR0(pVM, VMMR0_DO_GMM_UPDATE_RESERVATION, 0, &Req.Hdr);
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Prepares a GMMR0AllocatePages request.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @returns VINF_SUCCESS or VERR_NO_TMP_MEMORY.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @param pVM Pointer to the shared VM structure.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @param[out] ppReq Where to store the pointer to the request packet.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @param cPages The number of pages that's to be allocated.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * @param enmAccount The account to charge.
65fea56f17cd614bc8908264df980a62e1931468vboxsyncGMMR3DECL(int) GMMR3AllocatePagesPrepare(PVM pVM, PGMMALLOCATEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount)
65fea56f17cd614bc8908264df980a62e1931468vboxsync uint32_t cb = RT_OFFSETOF(GMMALLOCATEPAGESREQ, aPages[cPages]);
65fea56f17cd614bc8908264df980a62e1931468vboxsync PGMMALLOCATEPAGESREQ pReq = (PGMMALLOCATEPAGESREQ)RTMemTmpAllocZ(cb);
if (!pReq)
return VERR_NO_TMP_MEMORY;
return VINF_SUCCESS;
#ifdef LOG_ENABLED
return rc;
void *pvChunk;
GMMR3DECL(int) GMMR3FreePagesPrepare(PVM pVM, PGMMFREEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount)
if (!pReq)
return VERR_NO_TMP_MEMORY;
return VINF_SUCCESS;
GMMR3DECL(void) GMMR3FreePagesRePrep(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cPages, GMMACCOUNT enmAccount)
if (!cActualPages)
return VINF_SUCCESS;
return rc;
while (iPage-- > 0)
GMMR3DECL(int) GMMR3BalloonedPages(PVM pVM, uint32_t cBalloonedPages, uint32_t cPagesToFree, PGMMFREEPAGEDESC paPages, bool fCompleted)
GMMR3DECL(int) GMMR3MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3)
return rc;