1 | /* $Id: tstAsmStructs.cpp 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Testcase for checking offsets in the assembly structures shared with C/C++.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #include <VBox/vmm/cpum.h>
|
---|
33 | #include "CPUMInternal.h"
|
---|
34 | #define IPRT_WITHOUT_NAMED_UNIONS_AND_STRUCTS 1 /* For HMInternal */
|
---|
35 | #include "HMInternal.h"
|
---|
36 | #undef IPRT_WITHOUT_NAMED_UNIONS_AND_STRUCTS /* probably not necessary */
|
---|
37 | #include "VMMInternal.h"
|
---|
38 | #include <VBox/vmm/vm.h>
|
---|
39 | #define GVM_C_STYLE_STRUCTURES
|
---|
40 | #include <VBox/vmm/gvm.h>
|
---|
41 | #include <VBox/vmm/hm_vmx.h>
|
---|
42 |
|
---|
43 | #include "tstHelp.h"
|
---|
44 | #include <iprt/stream.h>
|
---|
45 |
|
---|
46 | /* Hack for validating nested HMCPU structures. */
|
---|
47 | typedef HMCPU::HMCPUVMX HMCPUVMX;
|
---|
48 | typedef HMCPU::HMCPUSVM HMCPUSVM;
|
---|
49 | typedef HMR0PERVCPU::HMR0CPUVMX HMR0CPUVMX;
|
---|
50 | typedef HMR0PERVCPU::HMR0CPUSVM HMR0CPUSVM;
|
---|
51 |
|
---|
52 | /* For sup.mac simplifications. */
|
---|
53 | #define SUPDRVTRACERUSRCTX32 SUPDRVTRACERUSRCTX
|
---|
54 | #define SUPDRVTRACERUSRCTX64 SUPDRVTRACERUSRCTX
|
---|
55 |
|
---|
56 |
|
---|
57 | int main()
|
---|
58 | {
|
---|
59 | int rc = 0;
|
---|
60 | RTPrintf("tstAsmStructs: TESTING\n");
|
---|
61 |
|
---|
62 | #ifdef IN_RING3
|
---|
63 | # include "tstAsmStructsHC.h"
|
---|
64 | #else
|
---|
65 | # include "tstAsmStructsRC.h"
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | if (rc)
|
---|
69 | RTPrintf("tstAsmStructs: FAILURE - %d errors \n", rc);
|
---|
70 | else
|
---|
71 | RTPrintf("tstAsmStructs: SUCCESS\n");
|
---|
72 | return rc;
|
---|
73 | }
|
---|
74 |
|
---|