VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h@ 28964

Last change on this file since 28964 was 28806, checked in by vboxsync, 15 years ago

Page sharing updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1/* $Id: GMMR0Internal.h 28806 2010-04-27 09:58:07Z vboxsync $ */
2/** @file
3 * GMM - The Global Memory Manager, Internal Header.
4 */
5
6/*
7 * Copyright (C) 2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___GMMR0Internal_h
19#define ___GMMR0Internal_h
20
21#include <VBox/gmm.h>
22#include <iprt/avl.h>
23
24/**
25 * The allocation sizes.
26 */
27typedef struct GMMVMSIZES
28{
29 /** The number of pages of base memory.
30 * This is the sum of RAM, ROMs and handy pages. */
31 uint64_t cBasePages;
32 /** The number of pages for the shadow pool. (Can be sequeezed for memory.) */
33 uint32_t cShadowPages;
34 /** The number of pages for fixed allocations like MMIO2 and the hyper heap. */
35 uint32_t cFixedPages;
36} GMMVMSIZES;
37typedef GMMVMSIZES *PGMMVMSIZES;
38
39
40/**
41 * Shared module registration info
42 */
43typedef struct GMMSHAREDMODULE
44{
45 /* Tree node. */
46 AVLGCPTRNODECORE Core;
47 /** Shared module size. */
48 uint32_t cbModule;
49 /** Number of included region descriptors */
50 uint32_t cRegions;
51 /** Module name */
52 char szName[GMM_SHARED_MODULE_MAX_NAME_STRING];
53 /** Module version */
54 char szVersion[GMM_SHARED_MODULE_MAX_VERSION_STRING];
55 /** Shared region descriptor(s). */
56 VMMDEVSHAREDREGIONDESC aRegions[1];
57} GMMSHAREDMODULE;
58/** Pointer to a GMMMODULE. */
59typedef GMMSHAREDMODULE *PGMMSHAREDMODULE;
60
61/**
62 * The per-VM GMM data.
63 */
64typedef struct GMMPERVM
65{
66 /** The reservations. */
67 GMMVMSIZES Reserved;
68 /** The actual allocations.
69 * This includes both private and shared page allocations. */
70 GMMVMSIZES Allocated;
71
72 /** The current number of private pages. */
73 uint64_t cPrivatePages;
74 /** The current number of shared pages. */
75 uint64_t cSharedPages;
76 /** The current over-comitment policy. */
77 GMMOCPOLICY enmPolicy;
78 /** The VM priority for arbitrating VMs in low and out of memory situation.
79 * Like which VMs to start sequeezing first. */
80 GMMPRIORITY enmPriority;
81
82 /** The current number of ballooned pages. */
83 uint64_t cBalloonedPages;
84 /** The max number of pages that can be ballooned. */
85 uint64_t cMaxBalloonedPages;
86 /** The number of pages we've currently requested the guest to give us.
87 * This is 0 if no pages currently requested. */
88 uint64_t cReqBalloonedPages;
89 /** The number of pages the guest has given us in response to the request.
90 * This is not reset on request completed and may be used in later decisions. */
91 uint64_t cReqActuallyBalloonedPages;
92 /** The number of pages we've currently requested the guest to take back. */
93 uint64_t cReqDeflatePages;
94
95 /** Whether ballooning is enabled or not. */
96 bool fBallooningEnabled;
97
98 /** Whether shared paging is enabled or not. */
99 bool fSharedPagingEnabled;
100
101 /** Whether the VM is allowed to allocate memory or not.
102 * This is used when the reservation update request fails or when the VM has
103 * been told to suspend/save/die in an out-of-memory case. */
104 bool fMayAllocate;
105} GMMPERVM;
106/** Pointer to the per-VM GMM data. */
107typedef GMMPERVM *PGMMPERVM;
108
109#endif
110
Note: See TracBrowser for help on using the repository browser.

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