VirtualBox

source: vbox/trunk/include/VBox/param.h@ 22593

最後變更 在這個檔案從22593是 22593,由 vboxsync 提交於 16 年 前

By default you can't allocate much more than 1.5 GB in a 32 bits Windows process.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 5.6 KB
 
1/** @file
2 * VirtualBox Parameter Definitions. (VMM,+)
3 *
4 * param.mac is generated from this file by running 'kmk incs' in the root.
5 */
6
7/*
8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.alldomusa.eu.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 *
27 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
28 * Clara, CA 95054 USA or visit http://www.sun.com if you need
29 * additional information or have any questions.
30 */
31
32#ifndef ___VBox_param_h
33#define ___VBox_param_h
34
35#include <iprt/param.h>
36#include <iprt/cdefs.h>
37
38
39/** @defgroup grp_vbox_param VBox Parameter Definition
40 * @{
41 */
42
43/** The maximum number of pages that can be allocated and mapped
44 * by various MM, PGM and SUP APIs. */
45#define VBOX_MAX_ALLOC_PAGE_COUNT (128U * _1M / PAGE_SIZE)
46
47
48/** @defgroup grp_vbox_param_mm Memory Monitor Parameters
49 * @ingroup grp_vbox_param
50 * @{
51 */
52/** Initial address of Hypervisor Memory Area.
53 * MUST BE PAGE TABLE ALIGNED! */
54#define MM_HYPER_AREA_ADDRESS UINT32_C(0xa0000000)
55
56/** The max size of the hypervisor memory area. */
57#define MM_HYPER_AREA_MAX_SIZE (40U * _1M) /**< @todo Readjust when floating RAMRANGEs have been implemented. Used to be 20 * _1MB */
58
59/** Maximum number of bytes we can dynamically map into the hypervisor region.
60 * This must be a power of 2 number of pages!
61 */
62#define MM_HYPER_DYNAMIC_SIZE (16U * PAGE_SIZE)
63
64/** The minimum guest RAM size in bytes. */
65#define MM_RAM_MIN UINT32_C(0x00400000)
66/** The maximum guest RAM size in bytes. */
67#if HC_ARCH_BITS == 64
68# define MM_RAM_MAX UINT64_C(0x400000000)
69#else
70# define MM_RAM_MAX UINT64_C(0x0E0000000)
71#endif
72/** The minimum guest RAM size in MBs. */
73#define MM_RAM_MIN_IN_MB UINT32_C(4)
74/** The maximum guest RAM size in MBs. */
75#if HC_ARCH_BITS == 64
76# define MM_RAM_MAX_IN_MB UINT32_C(16384)
77#else
78# if RT_OS_WINDOWS
79/* By default you can't allocate much more than 1.5 GB in a 32 bits Windows process. */
80# define MM_RAM_MAX_IN_MB UINT32_C(1500)
81# else
82# define MM_RAM_MAX_IN_MB UINT32_C(3584)
83# endif
84#endif
85/** The default size of the below 4GB RAM hole. */
86#define MM_RAM_HOLE_SIZE_DEFAULT (512U * _1M)
87/** @} */
88
89
90/** @defgroup grp_vbox_param_pgm Page Manager Parameters
91 * @ingroup grp_vbox_param
92 * @{
93 */
94/** The number of handy pages.
95 * This should be a power of two. */
96#define PGM_HANDY_PAGES 128
97/** The threshold at which allocation of more handy pages is flagged. */
98#define PGM_HANDY_PAGES_SET_FF 32
99/** The threshold at which we will allocate more when in ring-3.
100 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
101 * PGM_HANDY_PAGES_MIN. */
102#define PGM_HANDY_PAGES_R3_ALLOC 8
103/** The threshold at which we will allocate more when in ring-0 or raw mode.
104 * The idea is that we should never go below this threshold while in ring-0 or
105 * raw mode because of PGM_HANDY_PAGES_RZ_TO_R3. However, should this happen and
106 * we are actually out of memory, we will have 8 page to get out of whatever
107 * code we're executing.
108 *
109 * This is must be smaller than both PGM_HANDY_PAGES_SET_FF and
110 * PGM_HANDY_PAGES_MIN. */
111#define PGM_HANDY_PAGES_RZ_ALLOC 8
112/** The threshold at which we force return to R3 ASAP.
113 * The idea is that this should be large enough to get out of any code and up to
114 * the main EM loop when we are out of memory.
115 * This must be less or equal to PGM_HANDY_PAGES_MIN. */
116#define PGM_HANDY_PAGES_RZ_TO_R3 24
117/** The minimum number of handy pages (after allocation).
118 * This must be greater or equal to PGM_HANDY_PAGES_SET_FF.
119 * Another name would be PGM_HANDY_PAGES_EXTRA_RESERVATION or _PARANOIA. :-) */
120#define PGM_HANDY_PAGES_MIN 32
121/** @} */
122
123
124/** @defgroup grp_vbox_param_vmm VMM Parameters
125 * @ingroup grp_vbox_param
126 * @{
127 */
128/** VMM stack size. */
129#ifdef RT_OS_DARWIN
130# define VMM_STACK_SIZE 16384U
131#else
132# define VMM_STACK_SIZE 8192U
133#endif
134/** Min number of Virtual CPUs. */
135#define VMM_MIN_CPU_COUNT 1
136/** Max number of Virtual CPUs. */
137#define VMM_MAX_CPU_COUNT 32
138
139/** @} */
140
141
142/** @defgroup grp_vbox_pci PCI Identifiers
143 * @{ */
144/** VirtualBox PCI vendor ID. */
145#define VBOX_PCI_VENDORID (0x80ee)
146
147/** @name VirtualBox graphics card identifiers
148 * @{ */
149#define VBOX_VENDORID VBOX_PCI_VENDORID /**< @todo wonderful choice of name! Please squeeze a _VGA_ or something in there, please. */
150#define VBOX_DEVICEID (0xbeef) /**< @todo ditto. */
151#define VBOX_VESA_VENDORID VBOX_PCI_VENDORID
152#define VBOX_VESA_DEVICEID (0xbeef)
153/** @} */
154
155/** @name VMMDev PCI card identifiers
156 * @{ */
157#define VMMDEV_VENDORID VBOX_PCI_VENDORID
158#define VMMDEV_DEVICEID (0xcafe)
159/** @} */
160
161/** @} */
162
163/** @} */
164
165#endif
166
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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