GMMR0Internal.h revision 209c11e4b5dbb310116c99a42d773163928e002b
/* $Id$ */
/** @file
* GMM - The Global Memory Manager, Internal Header.
*/
/*
* Copyright (C) 2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___GMMR0Internal_h
#define ___GMMR0Internal_h
/**
* The allocation sizes.
*/
typedef struct GMMVMSIZES
{
/** The number of pages of base memory.
* This is the sum of RAM, ROMs and handy pages. */
/** The number of pages for the shadow pool. (Can be sequeezed for memory.) */
/** The number of pages for fixed allocations like MMIO2 and the hyper heap. */
} GMMVMSIZES;
/** Pointer to a GMMVMSIZES. */
typedef GMMVMSIZES *PGMMVMSIZES;
/**
* Shared region descriptor
*/
typedef struct GMMSHAREDREGIONDESC
{
/** Region base address. */
/** Region size. */
/** Alignment. */
/** Pointer to physical page address array. */
/** Pointer to a GMMSHAREDREGIONDESC. */
typedef GMMSHAREDREGIONDESC *PGMMSHAREDREGIONDESC;
/**
* Shared module registration info (global)
*/
typedef struct GMMSHAREDMODULE
{
/* Tree node. */
/** Shared module size. */
/** Number of included region descriptors */
/** Number of users (VMs). */
/** Align. */
/** Module name */
/** Module version */
/** Shared region descriptor(s). */
/** Pointer to a GMMSHAREDMODULE. */
typedef GMMSHAREDMODULE *PGMMSHAREDMODULE;
/**
* Shared module registration info (per VM)
*/
typedef struct GMMSHAREDMODULEPERVM
{
/* Tree node. */
/* Pointer to global shared module info. */
/* Set if another VM registered a different shared module at the same base address. */
bool fCollision;
/** Align at 8 byte boundary */
bool abAlignment[7];
/** Number of regions in the aRegions array. */
unsigned cRegions;
/** Shared region descriptor(s). */
/** Pointer to a GMMSHAREDMODULEPERVM. */
typedef GMMSHAREDMODULEPERVM *PGMMSHAREDMODULEPERVM;
/**
* The per-VM GMM data.
*/
typedef struct GMMPERVM
{
/** The reservations. */
/** The actual allocations.
* This includes both private and shared page allocations. */
/** The current number of private pages. */
/** The current number of shared pages. */
/** The current over-comitment policy. */
/** The VM priority for arbitrating VMs in low and out of memory situation.
* Like which VMs to start sequeezing first. */
/** The current number of ballooned pages. */
/** The max number of pages that can be ballooned. */
/** The number of pages we've currently requested the guest to give us.
* This is 0 if no pages currently requested. */
/** The number of pages the guest has given us in response to the request.
* This is not reset on request completed and may be used in later decisions. */
/** The number of pages we've currently requested the guest to take back. */
/** Shared module tree (per-vm). */
/** Whether ballooning is enabled or not. */
bool fBallooningEnabled;
/** Whether shared paging is enabled or not. */
bool fSharedPagingEnabled;
/** Whether the VM is allowed to allocate memory or not.
* This is used when the reservation update request fails or when the VM has
bool fMayAllocate;
} GMMPERVM;
/** Pointer to the per-VM GMM data. */
#endif