GMMR0Internal.h revision 1dc25926f76c463686b66fb6adec583eef0717ad
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/* $Id$ */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/** @file
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * GMM - The Global Memory Manager, Internal Header.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/*
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * Copyright (C) 2007 InnoTek Systemberatung GmbH
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync *
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * available from http://www.virtualbox.org. This file is free software;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * you can redistribute it and/or modify it under the terms of the GNU
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * General Public License as published by the Free Software Foundation,
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync *
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#ifndef ___GMMR0Internal_h
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#define ___GMMR0Internal_h
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#include <VBox/gmm.h>
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/**
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * The allocation sizes.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef struct GMMVMSIZES
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The number of pages of base memory.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * This is the sum of RAM, ROMs and handy pages. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint64_t cBasePages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The number of pages for the shadow pool. (Can be sequeezed for memory.) */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint32_t cShadowPages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The number of pages for fixed allocations like MMIO2 and the hyper heap. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint32_t cFixedPages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync} GMMVMSIZES;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef GMMVMSIZES *PGMMVMSIZES;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/**
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * The per-VM GMM data.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef struct GMMPERVM
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The reservations. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync GMMVMSIZES Reserved;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The actual allocations. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync GMMVMSIZES Allocated;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The current number of private pages. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint64_t cPrivatePages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The current number of shared pages. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint64_t cSharedPages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The current number of ballooned pages. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint64_t cBalloonedPages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The max number of pages that can be ballooned. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint64_t cMaxBalloonedPages;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The current over-comitment policy. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync GMMOCPOLICY enmPolicy;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** The VM priority for arbitrating VMs in an out-of-memory situation. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync GMMPRIORITY enmPriority;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync /** Whether the VM is allowed to allocate memory or not.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * This is used when the reservation update request fails or when the VM has
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * been told to suspend/save/die in an out-of-memory case. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync bool fMayAllocate;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync} GMMPERVM;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/** Pointer to the per-VM GMM data. */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef GMMPERVM *PGMMPERVM;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#endif
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync