1 | /* $Id: tstVMStructRC.cpp 60542 2016-04-18 15:02:26Z 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-2016 Oracle Corporation
|
---|
12 | *
|
---|
13 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | * available from http://www.virtualbox.org. This file is free software;
|
---|
15 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | * General Public License (GPL) as published by the Free Software
|
---|
17 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
18 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
19 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 | */
|
---|
21 |
|
---|
22 |
|
---|
23 | /*
|
---|
24 | * Sanity checks.
|
---|
25 | */
|
---|
26 | #ifndef IN_RC
|
---|
27 | # error Incorrect template!
|
---|
28 | #endif
|
---|
29 | #if defined(IN_RING3) || defined(IN_RING0)
|
---|
30 | # error Incorrect template!
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <VBox/types.h>
|
---|
34 | #include <iprt/assert.h>
|
---|
35 | AssertCompileSize(uint8_t, 1);
|
---|
36 | AssertCompileSize(uint16_t, 2);
|
---|
37 | AssertCompileSize(uint32_t, 4);
|
---|
38 | AssertCompileSize(uint64_t, 8);
|
---|
39 | AssertCompileSize(RTRCPTR, 4);
|
---|
40 | #ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
41 | AssertCompileSize(RTGCPTR, 8);
|
---|
42 | #else
|
---|
43 | AssertCompileSize(RTGCPTR, 4);
|
---|
44 | #endif
|
---|
45 | AssertCompileSize(RTGCPHYS, 8);
|
---|
46 | AssertCompileSize(RTHCPHYS, 8);
|
---|
47 |
|
---|
48 |
|
---|
49 | /*********************************************************************************************************************************
|
---|
50 | * Header Files *
|
---|
51 | *********************************************************************************************************************************/
|
---|
52 | #define IN_TSTVMSTRUCTGC 1
|
---|
53 | #include <VBox/vmm/cfgm.h>
|
---|
54 | #include <VBox/vmm/cpum.h>
|
---|
55 | #include <VBox/vmm/mm.h>
|
---|
56 | #include <VBox/vmm/pgm.h>
|
---|
57 | #include <VBox/vmm/selm.h>
|
---|
58 | #include <VBox/vmm/trpm.h>
|
---|
59 | #include <VBox/vmm/vmm.h>
|
---|
60 | #include <VBox/vmm/stam.h>
|
---|
61 | #include "PDMInternal.h"
|
---|
62 | #include <VBox/vmm/pdm.h>
|
---|
63 | #include "CFGMInternal.h"
|
---|
64 | #include "CPUMInternal.h"
|
---|
65 | #include "MMInternal.h"
|
---|
66 | #include "PGMInternal.h"
|
---|
67 | #include "SELMInternal.h"
|
---|
68 | #include "TRPMInternal.h"
|
---|
69 | #include "TMInternal.h"
|
---|
70 | #include "IOMInternal.h"
|
---|
71 | #include "REMInternal.h"
|
---|
72 | #include "HMInternal.h"
|
---|
73 | #ifdef VBOX_WITH_NEW_APIC
|
---|
74 | # include "APICInternal.h"
|
---|
75 | #endif
|
---|
76 | #include "PATMInternal.h"
|
---|
77 | #include "VMMInternal.h"
|
---|
78 | #include "DBGFInternal.h"
|
---|
79 | #include "GIMInternal.h"
|
---|
80 | #include "STAMInternal.h"
|
---|
81 | #include "CSAMInternal.h"
|
---|
82 | #include "EMInternal.h"
|
---|
83 | #include "IEMInternal.h"
|
---|
84 | #include "REMInternal.h"
|
---|
85 | #include <VBox/vmm/vm.h>
|
---|
86 | #include <VBox/vmm/hm_vmx.h>
|
---|
87 | #include <VBox/param.h>
|
---|
88 | #include <iprt/x86.h>
|
---|
89 | #include <iprt/assert.h>
|
---|
90 |
|
---|
91 | /* we don't use iprt here because we're pretending to be in GC! */
|
---|
92 | #include <stdio.h>
|
---|
93 |
|
---|
94 |
|
---|
95 | int main()
|
---|
96 | {
|
---|
97 | #define GEN_CHECK_SIZE(s) printf(" CHECK_SIZE(%s, %u);\n", #s, (unsigned)sizeof(s))
|
---|
98 | #define GEN_CHECK_OFF(s, m) printf(" CHECK_OFF(%s, %u, %s);\n", #s, (unsigned)RT_OFFSETOF(s, m), #m)
|
---|
99 | #define GEN_CHECK_OFF_DOT(s, m) printf(" CHECK_OFF(%s, %u, %s);\n", #s, (unsigned)RT_OFFSETOF(s, m), #m)
|
---|
100 | #include "tstVMStruct.h"
|
---|
101 | return (0);
|
---|
102 | }
|
---|
103 |
|
---|