1 | /* $Id: uvm.h 13782 2008-11-04 12:16:30Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * GVM - The Global VM Data.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2007 Sun Microsystems, Inc.
|
---|
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 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | *
|
---|
26 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
27 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
28 | * additional information or have any questions.
|
---|
29 | */
|
---|
30 |
|
---|
31 |
|
---|
32 | #ifndef ___VBox_uvm_h
|
---|
33 | #define ___VBox_uvm_h
|
---|
34 |
|
---|
35 |
|
---|
36 | #include <VBox/types.h>
|
---|
37 |
|
---|
38 | /* Forward decl. */
|
---|
39 | struct UVM;
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * Per virtual CPU ring-3 (user mode) data.
|
---|
43 | */
|
---|
44 | typedef struct UVMCPU
|
---|
45 | {
|
---|
46 | struct UVM *pUVM;
|
---|
47 | RTCPUID idCPU;
|
---|
48 |
|
---|
49 | /** The VM internal data. */
|
---|
50 | struct
|
---|
51 | {
|
---|
52 | #ifdef ___VMInternal_h
|
---|
53 | struct VMINTUSERPERVMCPU s;
|
---|
54 | #endif
|
---|
55 | uint8_t padding[768];
|
---|
56 | } vm;
|
---|
57 | } UVMCPU, *PUVMCPU;
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * The ring-3 (user mode) VM structure.
|
---|
61 | *
|
---|
62 | * This structure is similar to VM and GVM except that it resides in swappable
|
---|
63 | * user memory. The main purpose is to assist bootstrapping, where it allows us
|
---|
64 | * to start EMT much earlier and gives PDMLdr somewhere to put it's VMMR0 data.
|
---|
65 | * It is also a nice place to put big things that are user mode only.
|
---|
66 | */
|
---|
67 | typedef struct UVM
|
---|
68 | {
|
---|
69 | /** Magic / eye-catcher (UVM_MAGIC). */
|
---|
70 | uint32_t u32Magic;
|
---|
71 | uint32_t uReserved; /**< alignment */
|
---|
72 | /** The ring-3 mapping of the shared VM structure. */
|
---|
73 | PVM pVM;
|
---|
74 | /** Pointer to the next VM.
|
---|
75 | * We keep a per process list of VM for the event that a process could
|
---|
76 | * contain more than one VM.
|
---|
77 | * @todo move this into vm.s!
|
---|
78 | */
|
---|
79 | struct UVM *pNext;
|
---|
80 |
|
---|
81 | /** The VM internal data. */
|
---|
82 | struct
|
---|
83 | {
|
---|
84 | #ifdef ___VMInternal_h
|
---|
85 | struct VMINTUSERPERVM s;
|
---|
86 | #endif
|
---|
87 | uint8_t padding[768];
|
---|
88 | } vm;
|
---|
89 |
|
---|
90 | /** The MM data. */
|
---|
91 | struct
|
---|
92 | {
|
---|
93 | #ifdef ___MMInternal_h
|
---|
94 | struct MMUSERPERVM s;
|
---|
95 | #endif
|
---|
96 | uint8_t padding[32];
|
---|
97 | } mm;
|
---|
98 |
|
---|
99 | /** The PDM data. */
|
---|
100 | struct
|
---|
101 | {
|
---|
102 | #ifdef ___PDMInternal_h
|
---|
103 | struct PDMUSERPERVM s;
|
---|
104 | #endif
|
---|
105 | uint8_t padding[32];
|
---|
106 | } pdm;
|
---|
107 |
|
---|
108 | /** The STAM data. */
|
---|
109 | struct
|
---|
110 | {
|
---|
111 | #ifdef ___STAMInternal_h
|
---|
112 | struct STAMUSERPERVM s;
|
---|
113 | #endif
|
---|
114 | uint8_t padding[256];
|
---|
115 | } stam;
|
---|
116 |
|
---|
117 | /* Per virtual CPU data. */
|
---|
118 | UVMCPU aCpu[1];
|
---|
119 | } UVM;
|
---|
120 |
|
---|
121 | /** The UVM::u32Magic value (Brad Mehldau). */
|
---|
122 | #define UVM_MAGIC 0x19700823
|
---|
123 |
|
---|
124 | #endif
|
---|
125 |
|
---|