VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/tstVMStructRC.cpp@ 100725

Last change on this file since 100725 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 Id Revision
File size: 3.2 KB
Line 
1/* $Id: tstVMStructRC.cpp 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * tstVMMStructRC - Generate structure member and size checks from the
4 * RC perspective.
5 *
6 * This is built using the VBOXRC template but linked into a host
7 * ring-3 executable, rather hacky.
8 */
9
10/*
11 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
12 *
13 * This file is part of VirtualBox base platform packages, as
14 * available from https://www.virtualbox.org.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation, in version 3 of the
19 * License.
20 *
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see <https://www.gnu.org/licenses>.
28 *
29 * SPDX-License-Identifier: GPL-3.0-only
30 */
31
32
33/*
34 * Sanity checks.
35 */
36#ifndef IN_RC
37# error Incorrect template!
38#endif
39#if defined(IN_RING3) || defined(IN_RING0)
40# error Incorrect template!
41#endif
42
43#include <VBox/types.h>
44#include <iprt/assert.h>
45AssertCompileSize(uint8_t, 1);
46AssertCompileSize(uint16_t, 2);
47AssertCompileSize(uint32_t, 4);
48AssertCompileSize(uint64_t, 8);
49AssertCompileSize(RTRCPTR, 4);
50#ifdef VBOX_WITH_64_BITS_GUESTS
51AssertCompileSize(RTGCPTR, 8);
52#else
53AssertCompileSize(RTGCPTR, 4);
54#endif
55AssertCompileSize(RTGCPHYS, 8);
56AssertCompileSize(RTHCPHYS, 8);
57
58
59/*********************************************************************************************************************************
60* Header Files *
61*********************************************************************************************************************************/
62#define IN_TSTVMSTRUCT 1
63#define IN_TSTVMSTRUCTGC 1
64#include <VBox/vmm/cfgm.h>
65#include <VBox/vmm/cpum.h>
66#include <VBox/vmm/mm.h>
67#include <VBox/vmm/pgm.h>
68#include <VBox/vmm/selm.h>
69#include <VBox/vmm/vmm.h>
70#include <VBox/vmm/stam.h>
71#include "PDMInternal.h"
72#include <VBox/vmm/pdm.h>
73#include "CFGMInternal.h"
74#include "CPUMInternal.h"
75#include "MMInternal.h"
76#include "PGMInternal.h"
77#include "SELMInternal.h"
78#include "TMInternal.h"
79#include "IOMInternal.h"
80#include "HMInternal.h"
81#include "APICInternal.h"
82#include "PATMInternal.h"
83#include "VMMInternal.h"
84#include "DBGFInternal.h"
85#include "GIMInternal.h"
86#include "STAMInternal.h"
87#include "CSAMInternal.h"
88#include "EMInternal.h"
89#include "IEMInternal.h"
90#include "NEMInternal.h"
91#include <VBox/vmm/vm.h>
92#include <VBox/vmm/hm_vmx.h>
93#include <VBox/param.h>
94#include <iprt/x86.h>
95#include <iprt/assert.h>
96#include <iprt/stream.h>
97
98
99int main()
100{
101#define GEN_CHECK_SIZE(s) RTPrintf(" CHECK_SIZE(%s, %u);\n", #s, (unsigned)sizeof(s))
102#define GEN_CHECK_OFF(s, m) RTPrintf(" CHECK_OFF(%s, %u, %s);\n", #s, (unsigned)RT_OFFSETOF(s, m), #m)
103#define GEN_CHECK_OFF_DOT(s, m) RTPrintf(" CHECK_OFF(%s, %u, %s);\n", #s, (unsigned)RT_OFFSETOF(s, m), #m)
104#include "tstVMStruct.h"
105 return (0);
106}
107
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