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