1 | /* $Id: gvm.h 69107 2017-10-17 10:53:48Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * GVM - The Global VM Data.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2007-2017 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 | * 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 |
|
---|
27 |
|
---|
28 | #ifndef ___VBox_vmm_gvm_h
|
---|
29 | #define ___VBox_vmm_gvm_h
|
---|
30 |
|
---|
31 | #include <VBox/types.h>
|
---|
32 | #include <iprt/thread.h>
|
---|
33 |
|
---|
34 |
|
---|
35 | /** @defgroup grp_gvmcpu GVMCPU - The Global VMCPU Data
|
---|
36 | * @ingroup grp_vmm
|
---|
37 | * @{
|
---|
38 | */
|
---|
39 |
|
---|
40 | typedef struct GVMCPU
|
---|
41 | {
|
---|
42 | /** VCPU id (0 - (pVM->cCpus - 1). */
|
---|
43 | VMCPUID idCpu;
|
---|
44 |
|
---|
45 | /** Handle to the EMT thread. */
|
---|
46 | RTNATIVETHREAD hEMT;
|
---|
47 |
|
---|
48 | /** The GVMM per vcpu data. */
|
---|
49 | union
|
---|
50 | {
|
---|
51 | #ifdef ___GVMMR0Internal_h
|
---|
52 | struct GVMMPERVCPU s;
|
---|
53 | #endif
|
---|
54 | uint8_t padding[64];
|
---|
55 | } gvmm;
|
---|
56 | } GVMCPU;
|
---|
57 | /** Pointer to the GVMCPU data. */
|
---|
58 | typedef GVMCPU *PGVMCPU;
|
---|
59 |
|
---|
60 | /** @} */
|
---|
61 |
|
---|
62 | /** @defgroup grp_gvm GVM - The Global VM Data
|
---|
63 | * @ingroup grp_vmm
|
---|
64 | * @{
|
---|
65 | */
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * The Global VM Data.
|
---|
69 | *
|
---|
70 | * This is a ring-0 only structure where we put items we don't need to
|
---|
71 | * share with ring-3 or GC, like for instance various RTR0MEMOBJ handles.
|
---|
72 | *
|
---|
73 | * Unlike VM, there are no special alignment restrictions here. The
|
---|
74 | * paddings are checked by compile time assertions.
|
---|
75 | */
|
---|
76 | typedef struct GVM
|
---|
77 | {
|
---|
78 | /** Magic / eye-catcher (GVM_MAGIC). */
|
---|
79 | uint32_t u32Magic;
|
---|
80 | /** The global VM handle for this VM. */
|
---|
81 | uint32_t hSelf;
|
---|
82 | /** The ring-0 mapping of the VM structure. */
|
---|
83 | PVM pVM;
|
---|
84 | /** The support driver session the VM is associated with. */
|
---|
85 | PSUPDRVSESSION pSession;
|
---|
86 | /** Number of Virtual CPUs, i.e. how many entries there are in aCpus.
|
---|
87 | * Same same as VM::cCpus. */
|
---|
88 | uint32_t cCpus;
|
---|
89 | uint32_t padding;
|
---|
90 |
|
---|
91 | /** The GVMM per vm data. */
|
---|
92 | union
|
---|
93 | {
|
---|
94 | #ifdef ___GVMMR0Internal_h
|
---|
95 | struct GVMMPERVM s;
|
---|
96 | #endif
|
---|
97 | uint8_t padding[256];
|
---|
98 | } gvmm;
|
---|
99 |
|
---|
100 | /** The GMM per vm data. */
|
---|
101 | union
|
---|
102 | {
|
---|
103 | #ifdef ___GMMR0Internal_h
|
---|
104 | struct GMMPERVM s;
|
---|
105 | #endif
|
---|
106 | uint8_t padding[512];
|
---|
107 | } gmm;
|
---|
108 |
|
---|
109 | /** The RAWPCIVM per vm data. */
|
---|
110 | union
|
---|
111 | {
|
---|
112 | #ifdef ___VBox_rawpci_h
|
---|
113 | struct RAWPCIPERVM s;
|
---|
114 | #endif
|
---|
115 | uint8_t padding[64];
|
---|
116 | } rawpci;
|
---|
117 |
|
---|
118 |
|
---|
119 | /** GVMCPU array for the configured number of virtual CPUs. */
|
---|
120 | GVMCPU aCpus[1];
|
---|
121 | } GVM;
|
---|
122 |
|
---|
123 | /** The GVM::u32Magic value (Wayne Shorter). */
|
---|
124 | #define GVM_MAGIC 0x19330825
|
---|
125 |
|
---|
126 | /** @} */
|
---|
127 |
|
---|
128 | #endif
|
---|
129 |
|
---|