VirtualBox

source: vbox/trunk/include/VBox/vmm/vmmr3vtable.h@ 99378

Last change on this file since 99378 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/** @file
2 * VM - The Virtual Machine Monitor, VTable ring-3 API.
3 */
4
5/*
6 * Copyright (C) 2022-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_vmm_vmmr3vtable_h
37#define VBOX_INCLUDED_vmm_vmmr3vtable_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <VBox/types.h>
43#include <VBox/vmm/cfgm.h>
44#include <VBox/vmm/cpum.h>
45#include <VBox/vmm/dbgf.h>
46#include <VBox/vmm/dbgfflowtrace.h>
47#include <VBox/vmm/em.h>
48#include <VBox/vmm/hm.h>
49#include <VBox/vmm/pdmapi.h>
50#include <VBox/vmm/pdmasynccompletion.h>
51#include <VBox/vmm/pdmcritsect.h>
52#include <VBox/vmm/pdmnetshaper.h>
53#include <VBox/vmm/pdmqueue.h>
54#include <VBox/vmm/pdmusb.h>
55#include <VBox/vmm/pdmthread.h>
56#include <VBox/vmm/pgm.h>
57#include <VBox/vmm/ssm.h>
58#include <VBox/vmm/stam.h>
59#include <VBox/vmm/tm.h>
60#include <VBox/vmm/vmm.h>
61#include <VBox/dbg.h>
62
63#include <iprt/stdarg.h>
64
65RT_C_DECLS_BEGIN
66
67/** @defgroup grp_vmm_vtable VMM Function Table
68 * @ingroup grp_vmm
69 * @{ */
70
71
72/** Magic and version for the VMM vtable. (Magic: Emmet Cohen) */
73#define VMMR3VTABLE_MAGIC_VERSION RT_MAKE_U64(0x19900525, 0x00030000)
74/** Compatibility mask: These bits must match - magic and major version. */
75#define VMMR3VTABLE_MAGIC_VERSION_MASK RT_MAKE_U64(0xffffffff, 0xffff0000)
76
77/** Checks if @a a_uTableMagicVersion can be used by code compiled
78 * against @a a_CompiledMagicVersion */
79#define VMMR3VTABLE_IS_COMPATIBLE_EX(a_uTableMagicVersion, a_CompiledMagicVersion) \
80 ( (a_uTableMagicVersion) >= (a_CompiledMagicVersion) /* table must be same or later version */ \
81 && ((a_uTableMagicVersion) & VMMR3VTABLE_MAGIC_VERSION_MASK) == ((a_CompiledMagicVersion) & VMMR3VTABLE_MAGIC_VERSION_MASK) )
82
83/** Checks if @a a_uTableMagicVersion can be used by this us. */
84#define VMMR3VTABLE_IS_COMPATIBLE(a_uTableMagicVersion) \
85 VMMR3VTABLE_IS_COMPATIBLE_EX(a_uTableMagicVersion, VMMR3VTABLE_MAGIC_VERSION)
86
87
88/**
89 * Function for getting the vtable of a VMM DLL/SO/DyLib.
90 *
91 * @returns the pointer to the vtable.
92 */
93typedef DECLCALLBACKTYPE(PCVMMR3VTABLE, FNVMMGETVTABLE,(void));
94/** Pointer to VMM vtable getter. */
95typedef FNVMMGETVTABLE *PFNVMMGETVTABLE;
96/** The name of the FNVMMGETVTABLE function. */
97#define VMMR3VTABLE_GETTER_NAME "VMMR3GetVTable"
98
99
100/**
101 * VTable for the ring-3 VMM API.
102 */
103typedef struct VMMR3VTABLE
104{
105 /** VMMR3VTABLE_MAGIC_VERSION. */
106 uint64_t uMagicVersion;
107 /** Flags (TBD). */
108 uint64_t fFlags;
109 /** The description of this VMM. */
110 const char *pszDescription;
111
112/** @def VTABLE_ENTRY
113 * Define a VTable entry for the given function. */
114#if defined(DOXYGEN_RUNNING) \
115 || (defined(__cplusplus) && (defined(__clang_major__) || RT_GNUC_PREREQ_EX(4, 8, /*non-gcc: */1) /* For 4.8+ we enable c++11 */))
116# define VTABLE_ENTRY(a_Api) /** @copydoc a_Api */ decltype(a_Api) *pfn ## a_Api;
117#elif defined(__GNUC__)
118# define VTABLE_ENTRY(a_Api) /** @copydoc a_Api */ typeof(a_Api) *pfn ## a_Api;
119#else
120# error "Unsupported compiler"
121#endif
122/** @def VTABLE_RESERVED
123 * Define a reserved VTable entry with the given name. */
124#define VTABLE_RESERVED(a_Name) DECLCALLBACKMEMBER(int, a_Name,(void));
125
126#include "vmmr3vtable-def.h"
127
128#undef VTABLE_ENTRY
129#undef VTABLE_RESERVED
130
131 /** VMMR3VTABLE_MAGIC_VERSION. */
132 uint64_t uMagicVersionEnd;
133} VMMR3VTABLE;
134
135/** @} */
136
137RT_C_DECLS_END
138
139#endif /* !VBOX_INCLUDED_vmm_vmmr3vtable_h */
140
Note: See TracBrowser for help on using the repository browser.

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