VirtualBox

source: vbox/trunk/include/VBox/uvm.h@ 22922

Last change on this file since 22922 was 22922, checked in by vboxsync, 16 years ago

VBox/uvm.h: major mess up! The per component data was declared as structs instead of unions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1/* $Id: uvm.h 22922 2009-09-10 21:55:22Z vboxsync $ */
2/** @file
3 * GVM - The Global VM Data. (VMM)
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.215389.xyz. 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#include <VBox/types.h>
36#include <iprt/assert.h>
37
38
39/**
40 * Per virtual CPU ring-3 (user mode) data.
41 */
42typedef struct UVMCPU
43{
44 /** Pointer to the UVM structure. */
45 PUVM pUVM;
46 /** Pointer to the VM structure. */
47 PVM pVM;
48 /** Pointer to the VMCPU structure. */
49 PVMCPU pVCpu;
50 /** The virtual CPU ID. */
51 RTCPUID idCpu;
52
53 /** The VM internal data. */
54 union
55 {
56#ifdef ___VMInternal_h
57 struct VMINTUSERPERVMCPU s;
58#endif
59 uint8_t padding[768];
60 } vm;
61} UVMCPU;
62AssertCompileMemberAlignment(UVMCPU, vm, 8);
63
64
65/**
66 * The ring-3 (user mode) VM structure.
67 *
68 * This structure is similar to VM and GVM except that it resides in swappable
69 * user memory. The main purpose is to assist bootstrapping, where it allows us
70 * to start EMT much earlier and gives PDMLdr somewhere to put it's VMMR0 data.
71 * It is also a nice place to put big things that are user mode only.
72 */
73typedef struct UVM
74{
75 /** Magic / eye-catcher (UVM_MAGIC). */
76 uint32_t u32Magic;
77 /** The number of virtual CPUs. */
78 uint32_t cCpus;
79 /** The ring-3 mapping of the shared VM structure. */
80 PVM pVM;
81 /** Pointer to the next VM.
82 * We keep a per process list of VM for the event that a process could
83 * contain more than one VM.
84 * @todo move this into vm.s!
85 */
86 struct UVM *pNext;
87
88 /** The VM internal data. */
89 union
90 {
91#ifdef ___VMInternal_h
92 struct VMINTUSERPERVM s;
93#endif
94 uint8_t padding[768];
95 } vm;
96
97 /** The MM data. */
98 union
99 {
100#ifdef ___MMInternal_h
101 struct MMUSERPERVM s;
102#endif
103 uint8_t padding[32];
104 } mm;
105
106 /** The PDM data. */
107 union
108 {
109#ifdef ___PDMInternal_h
110 struct PDMUSERPERVM s;
111#endif
112 uint8_t padding[32];
113 } pdm;
114
115 /** The STAM data. */
116 union
117 {
118#ifdef ___STAMInternal_h
119 struct STAMUSERPERVM s;
120#endif
121 uint8_t padding[256];
122 } stam;
123
124 /** Per virtual CPU data. */
125 UVMCPU aCpus[1];
126} UVM;
127AssertCompileMemberAlignment(UVM, vm, 8);
128AssertCompileMemberAlignment(UVM, mm, 8);
129AssertCompileMemberAlignment(UVM, pdm, 8);
130AssertCompileMemberAlignment(UVM, stam, 8);
131AssertCompileMemberAlignment(UVM, aCpus[0], 8);
132AssertCompileMemberAlignment(UVM, aCpus[1], 8);
133
134/** The UVM::u32Magic value (Brad Mehldau). */
135#define UVM_MAGIC 0x19700823
136
137#endif
138
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