1 | # $Id: Makefile.kmk 94413 2022-03-31 12:20:53Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VMM testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2022 Oracle Corporation
|
---|
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
|
---|
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.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | #
|
---|
22 | # Include sub-makefiles.
|
---|
23 | #
|
---|
24 | if 0 # Not ready for general consumption yet.
|
---|
25 | include $(PATH_SUB_CURRENT)/Instructions/Makefile.kmk
|
---|
26 | endif
|
---|
27 |
|
---|
28 | #
|
---|
29 | # Target lists.
|
---|
30 | #
|
---|
31 | PROGRAMS += tstVMStructSize tstAsmStructs
|
---|
32 | ifdef VBOX_WITH_RAW_MODE
|
---|
33 | PROGRAMS += tstVMStructRC tstAsmStructsRC
|
---|
34 | endif
|
---|
35 | if !defined(VBOX_ONLY_EXTPACKS) \
|
---|
36 | && ( defined(VBOX_WITH_DTRACE_R3) \
|
---|
37 | || defined(VBOX_WITH_DTRACE_R0) \
|
---|
38 | || defined(VBOX_WITH_DTRACE_RC))
|
---|
39 | PROGRAMS += tstVMStructDTrace
|
---|
40 | INSTALLS += VMMLibDTraceStructTest
|
---|
41 | endif
|
---|
42 | ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
43 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
44 | PROGRAMS += tstGlobalConfigHardened
|
---|
45 | DLL += tstGlobalConfig
|
---|
46 | else
|
---|
47 | PROGRAMS += tstGlobalConfig
|
---|
48 | endif
|
---|
49 |
|
---|
50 | ifdef VBOX_WITH_RAW_MODE
|
---|
51 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
52 | PROGRAMS += tstVMMHardened
|
---|
53 | DLLS += tstVMM
|
---|
54 | else
|
---|
55 | PROGRAMS += tstVMM tstVMM-HM
|
---|
56 | endif
|
---|
57 | ifneq ($(KBUILD_TARGET),win)
|
---|
58 | PROGRAMS += tstVMMFork
|
---|
59 | endif
|
---|
60 | endif
|
---|
61 | ifdef VBOX_WITH_TESTCASES
|
---|
62 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
63 | PROGRAMS += tstCFGMHardened tstVMREQHardened tstAnimateHardened
|
---|
64 | DLLS += tstCFGM tstVMREQ tstAnimate
|
---|
65 | else
|
---|
66 | PROGRAMS += tstCFGM tstVMREQ tstAnimate
|
---|
67 | endif
|
---|
68 | PROGRAMS += \
|
---|
69 | tstCompressionBenchmark \
|
---|
70 | tstIEMCheckMc \
|
---|
71 | tstIEMAImpl \
|
---|
72 | tstPDMQueue \
|
---|
73 | tstSSM
|
---|
74 | PROGRAMS.amd64 += tstIEMAImplAsm
|
---|
75 |
|
---|
76 | if1of ($(KBUILD_TARGET_ARCH),amd64 x86)
|
---|
77 | PROGRAMS += \
|
---|
78 | tstVMMR0CallHost-1 \
|
---|
79 | tstX86-FpuSaveRestore
|
---|
80 | ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.x86 solaris.amd64 win.amd64 ) ## TODO: Fix the code.
|
---|
81 | PROGRAMS += tstX86-1
|
---|
82 | endif
|
---|
83 | endif
|
---|
84 | ifdef VBOX_WITH_RAW_MODE
|
---|
85 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
86 | PROGRAMS += tstMicroHardened
|
---|
87 | DLLS += tstMicro
|
---|
88 | else
|
---|
89 | PROGRAMS += tstMicro
|
---|
90 | endif
|
---|
91 | SYSMODS += tstMicroRC
|
---|
92 | endif
|
---|
93 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
94 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
95 | PROGRAMS += tstPDMAsyncCompletionHardened tstPDMAsyncCompletionStressHardened
|
---|
96 | DLLS += tstPDMAsyncCompletion tstPDMAsyncCompletionStress
|
---|
97 | else
|
---|
98 | PROGRAMS += tstPDMAsyncCompletion tstPDMAsyncCompletionStress
|
---|
99 | endif
|
---|
100 | endif
|
---|
101 | endif # VBOX_WITH_TESTCASES
|
---|
102 | endif # !VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
103 |
|
---|
104 | # Where we put our temporary files (just for simplicity)
|
---|
105 | VBOX_VMM_TESTCASE_OUT_DIR := $(PATH_TARGET)/VMM
|
---|
106 | BLDDIRS += $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
107 |
|
---|
108 | #
|
---|
109 | # We setup two 'other' targets for executing the two structure & alignment
|
---|
110 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
111 | #
|
---|
112 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
113 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
114 | OTHERS += \
|
---|
115 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
116 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
117 | endif
|
---|
118 | endif
|
---|
119 |
|
---|
120 | # The normal testing pass.
|
---|
121 | TESTING += \
|
---|
122 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
123 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
124 |
|
---|
125 | OTHER_CLEAN += \
|
---|
126 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
127 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run \
|
---|
128 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o \
|
---|
129 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep \
|
---|
130 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
131 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.o \
|
---|
132 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.lst \
|
---|
133 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h \
|
---|
134 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h \
|
---|
135 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
136 |
|
---|
137 | #
|
---|
138 | # Globals
|
---|
139 | #
|
---|
140 | VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
|
---|
141 |
|
---|
142 | #
|
---|
143 | # Targets
|
---|
144 | #
|
---|
145 | ifdef VBOX_WITH_RAW_MODE
|
---|
146 | tstVMStructRC_TEMPLATE = VBoxRcExe
|
---|
147 | tstVMStructRC_DEFS = VBOX_IN_VMM IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE $(VMM_COMMON_DEFS)
|
---|
148 | ifdef VBOX_WITH_R0_LOGGING
|
---|
149 | tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
150 | endif
|
---|
151 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
152 | tstVMStructRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
153 | endif
|
---|
154 | tstVMStructRC_SOURCES = tstVMStructRC.cpp
|
---|
155 | tstVMStructRC_INCS = \
|
---|
156 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
157 | $(VBOX_PATH_VMM_SRC)/PATM
|
---|
158 | endif
|
---|
159 |
|
---|
160 | tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
|
---|
161 | ifneq ($(KBUILD_TARGET),win)
|
---|
162 | tstVMStructSize_CXXFLAGS += $(VBOX_GCC_Wno-invalid-offsetof)
|
---|
163 | endif
|
---|
164 | tstVMStructSize_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
|
---|
165 | ifdef VBOX_WITH_RAW_MODE
|
---|
166 | tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
|
---|
167 | endif
|
---|
168 | tstVMStructSize_INCS = \
|
---|
169 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
170 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
171 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
172 | tstVMStructSize_SOURCES = tstVMStructSize.cpp
|
---|
173 | ifdef VBOX_WITH_RAW_MODE
|
---|
174 | tstVMStructSize.cpp_DEPS= $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
175 | endif
|
---|
176 | ifdef VBOX_WITH_R0_LOGGING
|
---|
177 | tstVMStructSize_DEFS += VBOX_WITH_R0_LOGGING
|
---|
178 | endif
|
---|
179 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
180 | tstVMStructSize_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
181 | endif
|
---|
182 |
|
---|
183 | tstAsmStructs_TEMPLATE = VBOXR3AUTOTST
|
---|
184 | ifneq ($(KBUILD_TARGET),win)
|
---|
185 | tstAsmStructSize_CXXFLAGS += $(VBOX_GCC_Wno-invalid-offsetof)
|
---|
186 | endif
|
---|
187 | tstAsmStructs_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
|
---|
188 | ifdef VBOX_WITH_RAW_MODE
|
---|
189 | tstAsmStructs_DEFS += VBOX_WITH_RAW_MODE
|
---|
190 | endif
|
---|
191 | ifdef VBOX_WITH_R0_LOGGING
|
---|
192 | tstAsmStructs_DEFS += VBOX_WITH_R0_LOGGING
|
---|
193 | endif
|
---|
194 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
195 | tstAsmStructs_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
196 | endif
|
---|
197 | tstAsmStructs_INCS = \
|
---|
198 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
199 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
200 | tstAsmStructs_SOURCES = tstAsmStructs.cpp
|
---|
201 | tstAsmStructs.cpp_DEPS = $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
|
---|
202 |
|
---|
203 | ifdef VBOX_WITH_RAW_MODE
|
---|
204 | tstAsmStructsRC_TEMPLATE= VBoxRcExe
|
---|
205 | tstAsmStructsRC_DEFS = VBOX_IN_VMM IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE $(VMM_COMMON_DEFS)
|
---|
206 | ifdef VBOX_WITH_R0_LOGGING
|
---|
207 | tstAsmStructsRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
208 | endif
|
---|
209 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
210 | tstAsmStructsRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
211 | endif
|
---|
212 | tstAsmStructsRC_INCS = \
|
---|
213 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
214 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
215 | tstAsmStructsRC_SOURCES = tstAsmStructs.cpp
|
---|
216 | tstAsmStructs.cpp_DEPS += $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h
|
---|
217 | endif # VBOX_WITH_RAW_MODE
|
---|
218 |
|
---|
219 |
|
---|
220 | #
|
---|
221 | # Global config tool.
|
---|
222 | #
|
---|
223 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
224 | tstGlobalConfigHardened_TEMPLATE = VBoxR3HardenedTstExe
|
---|
225 | tstGlobalConfigHardened_NAME = tstGlobalConfig
|
---|
226 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
227 | tstGlobalConfigHardened_DEFS = PROGRAM_NAME_STR="tstGlobalConfig"
|
---|
228 | else
|
---|
229 | tstGlobalConfigHardened_DEFS = PROGRAM_NAME_STR=\"tstGlobalConfig\"
|
---|
230 | endif
|
---|
231 | tstGlobalConfigHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
|
---|
232 | tstGlobalConfig_TEMPLATE = VBoxR3HardenedTstDll
|
---|
233 | else
|
---|
234 | tstGlobalConfig_TEMPLATE = VBOXR3TSTEXE
|
---|
235 | endif
|
---|
236 | tstGlobalConfig_SOURCES = tstGlobalConfig.cpp
|
---|
237 | tstGlobalConfig_LIBS = $(LIB_RUNTIME)
|
---|
238 |
|
---|
239 |
|
---|
240 | #
|
---|
241 | # Testcase for checking the C (IEMAllAImplC.cpp) and assembly (IEMAllAImpl.asm)
|
---|
242 | # instruction emulation helpers.
|
---|
243 | #
|
---|
244 | # Note! The IN_TSTVMSTRUCT define is for avoiding IEMInstructionStatisticsTmpl.h.
|
---|
245 | #
|
---|
246 | tstIEMAImpl_TEMPLATE = VBOXR3TSTEXE
|
---|
247 | tstIEMAImpl_DEFS = $(VMM_COMMON_DEFS) IEM_WITHOUT_ASSEMBLY IN_TSTVMSTRUCT
|
---|
248 | tstIEMAImpl_INCS = ../include .
|
---|
249 | tstIEMAImpl_CLEAN = \
|
---|
250 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataInt.cpp \
|
---|
251 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataInt-Amd.cpp \
|
---|
252 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataInt-Intel.cpp \
|
---|
253 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuLdSt.cpp \
|
---|
254 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuLdSt-Amd.cpp \
|
---|
255 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuLdSt-Intel.cpp \
|
---|
256 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuBinary1.cpp \
|
---|
257 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuBinary1-Amd.cpp \
|
---|
258 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuBinary1-Intel.cpp \
|
---|
259 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuBinary2.cpp
|
---|
260 | tstIEMAImpl_SOURCES = \
|
---|
261 | tstIEMAImpl.cpp \
|
---|
262 | ../VMMAll/IEMAllAImplC.cpp \
|
---|
263 | $(tstIEMAImpl_CLEAN)
|
---|
264 | $(call KB_FN_DO_PASS0_ON_TARGET,tstIEMAImpl)
|
---|
265 |
|
---|
266 | # This variant mainly for generating data.
|
---|
267 | tstIEMAImplAsm_TEMPLATE = VBOXR3TSTEXE
|
---|
268 | tstIEMAImplAsm_DEFS = $(VMM_COMMON_DEFS) IEM_WITH_ASSEMBLY IN_TSTVMSTRUCT TSTIEMAIMPL_WITH_GENERATOR
|
---|
269 | tstIEMAImplAsm_INCS = ../include .
|
---|
270 | tstIEMAImplAsm_SOURCES = \
|
---|
271 | tstIEMAImpl.cpp \
|
---|
272 | ../VMMAll/IEMAllAImpl.asm \
|
---|
273 | ../VMMAll/IEMAllAImplC.cpp \
|
---|
274 | $(tstIEMAImpl_CLEAN)
|
---|
275 |
|
---|
276 | ## @param 1 The sub-name of the file in question.
|
---|
277 | define def_tstIEMAImplData_adjust
|
---|
278 | $$(tstIEMAImpl_0_OUTDIR)/tstIEMAImplData$(1).cpp: \
|
---|
279 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImplData$(1).cpp \
|
---|
280 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImplData.sh \
|
---|
281 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImpl.h \
|
---|
282 | | $$(tstIEMAImpl_0_OUTDIR)/
|
---|
283 | $$(ASH) "$$(tstIEMAImpl_DEFPATH)/tstIEMAImplData.sh" \
|
---|
284 | "$$(CP_EXT)" \
|
---|
285 | "$$(MV_EXT)" \
|
---|
286 | "$$(SED_EXT)" \
|
---|
287 | "$$(APPEND_EXT)" \
|
---|
288 | "$$(tstIEMAImpl_0_OUTDIR)" \
|
---|
289 | "$$(tstIEMAImpl_DEFPATH)" \
|
---|
290 | "$(1)"
|
---|
291 | endef
|
---|
292 | $(evalcall2 def_tstIEMAImplData_adjust,Int)
|
---|
293 | $(evalcall2 def_tstIEMAImplData_adjust,Int-Amd)
|
---|
294 | $(evalcall2 def_tstIEMAImplData_adjust,Int-Intel)
|
---|
295 | $(evalcall2 def_tstIEMAImplData_adjust,FpuLdSt)
|
---|
296 | $(evalcall2 def_tstIEMAImplData_adjust,FpuLdSt-Amd)
|
---|
297 | $(evalcall2 def_tstIEMAImplData_adjust,FpuLdSt-Intel)
|
---|
298 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary1)
|
---|
299 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary1-Amd)
|
---|
300 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary1-Intel)
|
---|
301 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary2)
|
---|
302 |
|
---|
303 |
|
---|
304 | #
|
---|
305 | # Testcase for checking the repurposing of the IEM instruction code.
|
---|
306 | #
|
---|
307 | tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
|
---|
308 | tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
|
---|
309 | tstIEMCheckMc_DEFS = $(VMM_COMMON_DEFS)
|
---|
310 | tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
|
---|
311 | ifeq ($(KBUILD_TARGET),win)
|
---|
312 | tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -wd4189 # local variable is initialized but not used.
|
---|
313 | else
|
---|
314 | tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -Wno-unused-value -Wno-unused-variable
|
---|
315 | endif
|
---|
316 |
|
---|
317 | #
|
---|
318 | # Saved state manager testcase.
|
---|
319 | #
|
---|
320 | tstSSM_TEMPLATE = VBOXR3TSTEXE
|
---|
321 | tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
322 | tstSSM_DEFS = $(VMM_COMMON_DEFS)
|
---|
323 | tstSSM_SOURCES = tstSSM.cpp
|
---|
324 | tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
325 |
|
---|
326 | #
|
---|
327 | # VMM configuration manager tests.
|
---|
328 | #
|
---|
329 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
330 | tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
|
---|
331 | tstCFGMHardened_NAME = tstCFGM
|
---|
332 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
333 | tstCFGMHardened_DEFS = PROGRAM_NAME_STR="tstCFGM"
|
---|
334 | else
|
---|
335 | tstCFGMHardened_DEFS = PROGRAM_NAME_STR=\"tstCFGM\"
|
---|
336 | endif
|
---|
337 | tstCFGMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
|
---|
338 | tstCFGM_TEMPLATE = VBoxR3HardenedTstDll
|
---|
339 | else
|
---|
340 | tstCFGM_TEMPLATE = VBOXR3TSTEXE
|
---|
341 | endif
|
---|
342 | tstCFGM_DEFS = $(VMM_COMMON_DEFS)
|
---|
343 | tstCFGM_SOURCES = tstCFGM.cpp
|
---|
344 | tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
345 |
|
---|
346 | #
|
---|
347 | # Comparing some compression algorithms considered for SSM usage.
|
---|
348 | #
|
---|
349 | tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
|
---|
350 | tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
|
---|
351 |
|
---|
352 | #
|
---|
353 | # Two testcases for checking the ring-0 setjmp/longjmp code.
|
---|
354 | #
|
---|
355 | tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
|
---|
356 | tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
357 | tstVMMR0CallHost-1_SOURCES = \
|
---|
358 | tstVMMR0CallHost-1.cpp
|
---|
359 | tstVMMR0CallHost-1_SOURCES.amd64 = \
|
---|
360 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
|
---|
361 | tstVMMR0CallHost-1_SOURCES.x86 = \
|
---|
362 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
|
---|
363 |
|
---|
364 |
|
---|
365 | #
|
---|
366 | # For testing the VM request queue code.
|
---|
367 | #
|
---|
368 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
369 | tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
370 | tstVMREQHardened_NAME = tstVMREQ
|
---|
371 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
372 | tstVMREQHardened_DEFS = PROGRAM_NAME_STR="tstVMREQ"
|
---|
373 | else
|
---|
374 | tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
|
---|
375 | endif
|
---|
376 | tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
377 | tstVMREQ_TEMPLATE = VBOXR3
|
---|
378 | else
|
---|
379 | tstVMREQ_TEMPLATE = VBOXR3EXE
|
---|
380 | endif
|
---|
381 | tstVMREQ_DEFS = $(VMM_COMMON_DEFS)
|
---|
382 | tstVMREQ_SOURCES = tstVMREQ.cpp
|
---|
383 | tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
384 |
|
---|
385 | #
|
---|
386 | # Tool for reanimate things like OS/2 dumps.
|
---|
387 | #
|
---|
388 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
389 | tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
390 | tstAnimateHardened_NAME = tstAnimate
|
---|
391 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
392 | tstAnimateHardened_DEFS = PROGRAM_NAME_STR="tstAnimate"
|
---|
393 | else
|
---|
394 | tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
|
---|
395 | endif
|
---|
396 | tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
397 | tstAnimate_TEMPLATE = VBOXR3
|
---|
398 | else
|
---|
399 | tstAnimate_TEMPLATE = VBOXR3EXE
|
---|
400 | endif
|
---|
401 | tstAnimate_DEFS = $(VMM_COMMON_DEFS)
|
---|
402 | tstAnimate_SOURCES = tstAnimate.cpp
|
---|
403 | tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
404 |
|
---|
405 | tstX86-1_TEMPLATE = VBOXR3TSTEXE
|
---|
406 | tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
|
---|
407 | tstX86-1_LIBS = $(LIB_RUNTIME)
|
---|
408 | tstX86-1_LDFLAGS.linux = $(VBOX_GCC_no-pie)
|
---|
409 |
|
---|
410 | tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
|
---|
411 | tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
|
---|
412 | tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
|
---|
413 |
|
---|
414 | ifdef VBOX_WITH_RAW_MODE
|
---|
415 |
|
---|
416 | #
|
---|
417 | # Raw-mode VMM testcase.
|
---|
418 | #
|
---|
419 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
420 | tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
421 | tstVMMHardened_NAME = tstVMM
|
---|
422 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
423 | tstVMMHardened_DEFS = PROGRAM_NAME_STR="tstVMM"
|
---|
424 | else
|
---|
425 | tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
|
---|
426 | endif
|
---|
427 | tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
428 | tstVMM_TEMPLATE = VBOXR3
|
---|
429 | else
|
---|
430 | tstVMM_TEMPLATE = VBOXR3EXE
|
---|
431 | endif
|
---|
432 | tstVMM_SOURCES = tstVMM.cpp
|
---|
433 | tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
434 |
|
---|
435 | #
|
---|
436 | # HM VMM testcase.
|
---|
437 | #
|
---|
438 | tstVMM-HM_TEMPLATE = VBOXR3EXE
|
---|
439 | tstVMM-HM_SOURCES = tstVMM-HM.cpp
|
---|
440 | tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
441 |
|
---|
442 | #
|
---|
443 | # VMM host process fork test case (memory ++).
|
---|
444 | #
|
---|
445 | tstVMMFork_TEMPLATE = VBOXR3EXE
|
---|
446 | tstVMMFork_SOURCES = tstVMMFork.cpp
|
---|
447 | tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
448 |
|
---|
449 | #
|
---|
450 | # Raw-mode micro benchmark.
|
---|
451 | #
|
---|
452 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
453 | tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
454 | tstMicroHardened_NAME = tstMicro
|
---|
455 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
456 | tstMicroHardened_DEFS = PROGRAM_NAME_STR="tstMicro"
|
---|
457 | else
|
---|
458 | tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
|
---|
459 | endif
|
---|
460 | tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
461 | tstMicro_TEMPLATE = VBOXR3
|
---|
462 | else
|
---|
463 | tstMicro_TEMPLATE = VBOXR3EXE
|
---|
464 | endif
|
---|
465 | tstMicro_SOURCES = tstMicro.cpp
|
---|
466 | tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
467 | tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
|
---|
468 |
|
---|
469 | tstMicroRC_TEMPLATE = VBoxRc
|
---|
470 | tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
|
---|
471 | tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
|
---|
472 | tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
|
---|
473 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
474 | tstMicroRC_LDFLAGS = -Entry:tstMicroRC
|
---|
475 | endif
|
---|
476 | tstMicroRC_SYSSUFF = .gc
|
---|
477 | tstMicroRC_LIBS = \
|
---|
478 | $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
|
---|
479 | $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
|
---|
480 | ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
|
---|
481 | tstMicroRC_LIBS += \
|
---|
482 | $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
|
---|
483 | $(LIB_VMMRC)
|
---|
484 | endif
|
---|
485 | tstMicroRC_SOURCES.win = tstMicroRC.def
|
---|
486 |
|
---|
487 | endif # VBOX_WITH_RAW_MODE
|
---|
488 |
|
---|
489 |
|
---|
490 | if !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
|
---|
491 | #
|
---|
492 | # Special NEM host testcase.
|
---|
493 | #
|
---|
494 | if ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "darwin.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
|
---|
495 | || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "linux.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
|
---|
496 | || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "win.amd64" && defined(VBOX_WITH_NATIVE_NEM))
|
---|
497 | PROGRAMS += NemRawBench-1
|
---|
498 | NemRawBench-1_TEMPLATE = VBoxR3Static
|
---|
499 | NemRawBench-1_SOURCES = NemRawBench-1.cpp
|
---|
500 | NemRawBench-1_BLD_TYPE = release
|
---|
501 | NemRawBench-1_INCS.win = \
|
---|
502 | $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
|
---|
503 | $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
|
---|
504 | NemRawBench-1_CXXFLAGS.darwin = \
|
---|
505 | -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform//Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
|
---|
506 | #NemRawBench-1_LDFLAGS.darwin = \
|
---|
507 | # -F/System/Library/Frameworks \
|
---|
508 | # -framework Hypervisor
|
---|
509 | NemRawBench-1_LDFLAGS.darwin = \
|
---|
510 | /System/Library/Frameworks/Hypervisor.framework/Hypervisor
|
---|
511 | endif
|
---|
512 | endif
|
---|
513 |
|
---|
514 | #
|
---|
515 | # PDM Queue tests.
|
---|
516 | #
|
---|
517 | tstPDMQueue_TEMPLATE := VBOXR3EXE
|
---|
518 | tstPDMQueue_DEFS = $(VMM_COMMON_DEFS)
|
---|
519 | tstPDMQueue_SOURCES := tstPDMQueue.cpp
|
---|
520 | tstPDMQueue_LIBS := $(LIB_VMM) $(LIB_RUNTIME)
|
---|
521 |
|
---|
522 |
|
---|
523 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
524 | #
|
---|
525 | # PDM asynchronous completation test.
|
---|
526 | #
|
---|
527 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
528 | tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
529 | tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
|
---|
530 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
531 | tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletion"
|
---|
532 | else
|
---|
533 | tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
|
---|
534 | endif
|
---|
535 | tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
536 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3
|
---|
537 | else
|
---|
538 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
|
---|
539 | endif
|
---|
540 | tstPDMAsyncCompletion_DEFS = $(VMM_COMMON_DEFS)
|
---|
541 | tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
542 | tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
|
---|
543 | tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
544 |
|
---|
545 | #
|
---|
546 | # PDM asynchronous completation stress test.
|
---|
547 | #
|
---|
548 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
549 | tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
550 | tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
|
---|
551 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
552 | tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletionStress"
|
---|
553 | else
|
---|
554 | tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
|
---|
555 | endif
|
---|
556 | tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
557 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
|
---|
558 | else
|
---|
559 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
|
---|
560 | endif
|
---|
561 | tstPDMAsyncCompletionStress_DEFS = $(VMM_COMMON_DEFS)
|
---|
562 | tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
563 | tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
|
---|
564 | tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
565 | endif
|
---|
566 |
|
---|
567 | ifndef VBOX_ONLY_EXTPACKS
|
---|
568 | PROGRAMS += tstSSM-2
|
---|
569 | tstSSM-2_TEMPLATE = VBOXR3TSTEXE
|
---|
570 | tstSSM-2_DEFS = IN_VMM_STATIC
|
---|
571 | tstSSM-2_SOURCES = tstSSM-2.cpp
|
---|
572 | tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
|
---|
573 | endif
|
---|
574 |
|
---|
575 | #
|
---|
576 | # Generate VM structure tests.
|
---|
577 | #
|
---|
578 | if !defined(VBOX_ONLY_EXTPACKS) \
|
---|
579 | && ( defined(VBOX_WITH_DTRACE_R3) \
|
---|
580 | || defined(VBOX_WITH_DTRACE_R0) \
|
---|
581 | || defined(VBOX_WITH_DTRACE_RC))
|
---|
582 | tstVMStructDTrace_TEMPLATE = VBOXR3AUTOTST
|
---|
583 | tstVMStructDTrace_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
|
---|
584 | ifdef VBOX_WITH_RAW_MODE
|
---|
585 | tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
|
---|
586 | endif
|
---|
587 | tstVMStructDTrace_INCS = \
|
---|
588 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
589 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
590 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
591 | tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
|
---|
592 | ifdef VBOX_WITH_R0_LOGGING
|
---|
593 | tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
|
---|
594 | endif
|
---|
595 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
596 | tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
597 | endif
|
---|
598 |
|
---|
599 |
|
---|
600 | VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
|
---|
601 | VMMLibDTraceStructTest_SOURCES = \
|
---|
602 | $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
|
---|
603 | VMMLibDTraceStructTest_CLEAN = \
|
---|
604 | $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
|
---|
605 |
|
---|
606 | $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
|
---|
607 | $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
|
---|
608 | $(QUIET)$(RM) -f $@
|
---|
609 | $< > $@
|
---|
610 |
|
---|
611 | endif
|
---|
612 |
|
---|
613 |
|
---|
614 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
615 |
|
---|
616 |
|
---|
617 | #
|
---|
618 | # Some handcrafted support targets for tstAsmStructs.
|
---|
619 | #
|
---|
620 | MY_ASA_ASM_STUFF = \
|
---|
621 | $(addprefix -D, \
|
---|
622 | $(DEFS) \
|
---|
623 | $(DEFS.$(KBUILD_TYPE)) \
|
---|
624 | $(DEFS.$(KBUILD_TARGET)) \
|
---|
625 | IN_RING3 $(ARCH_BITS_DEFS) \
|
---|
626 | $(DEFS.$(KBUILD_TARGET_ARCH)) \
|
---|
627 | $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
628 | $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
|
---|
629 | $(VMM_COMMON_DEFS) \
|
---|
630 | ) \
|
---|
631 | -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
|
---|
632 | $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
|
---|
633 | ,-I$(inc)/)
|
---|
634 |
|
---|
635 | # 1a. make a header file which makes all the structures+members globals.
|
---|
636 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
|
---|
637 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
638 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
|
---|
639 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
640 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
641 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
642 | $(DEPTH)/include/VBox/vmm/gvm.mac \
|
---|
643 | $(DEPTH)/include/VBox/sup.mac \
|
---|
644 | $(DEPTH)/include/iprt/x86.mac \
|
---|
645 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
646 | $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
|
---|
647 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
648 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
649 | $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
|
---|
650 | | $$(dir $$@)
|
---|
651 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
652 | ifndef DONT_USE_YASM
|
---|
653 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
|
---|
654 | $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ [email protected]
|
---|
655 | else
|
---|
656 | $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o [email protected] -l [email protected] $<
|
---|
657 | $(VBOX_NM) [email protected] | $(SED) \
|
---|
658 | -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
|
---|
659 | -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
|
---|
660 | > $@
|
---|
661 | endif
|
---|
662 |
|
---|
663 | # 1b. make an elf/macho object containing the offsets.
|
---|
664 | includedep $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
|
---|
665 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
|
---|
666 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
667 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
668 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
669 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
670 | $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
|
---|
671 | $(DEPTH)/include/VBox/vmm/stam.mac \
|
---|
672 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
673 | $(DEPTH)/include/VBox/sup.mac \
|
---|
674 | $(DEPTH)/include/iprt/x86.mac \
|
---|
675 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
676 | $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
|
---|
677 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
678 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
679 | $$(if $$(eq $$(tstAsmStructsAsmDep_STUFF),$$(MY_ASA_ASM_STUFF)),,FORCE) \
|
---|
680 | | $$(dir $$@)
|
---|
681 | $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
|
---|
682 | ifndef DONT_USE_YASM
|
---|
683 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
684 | else
|
---|
685 | $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
686 | endif
|
---|
687 | %$(QUIET2)$(RM) -f -- $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
|
---|
688 | %$(QUIET2)$(APPEND) '$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep' 'tstAsmStructsAsmDep_STUFF=$(MY_ASA_ASM_STUFF)'
|
---|
689 |
|
---|
690 | # 2. use nm and sed to transform this into the header we want.
|
---|
691 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
|
---|
692 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
693 | $(QUIET)$(RM) -f $@ [email protected] [email protected]
|
---|
694 | $(QUIET)$(REDIRECT) -wo [email protected] -- $(VBOX_NM) $<
|
---|
695 | $(QUIET)$(SED) \
|
---|
696 | -e '/STAMPROFILEADV/d' \
|
---|
697 | \
|
---|
698 | -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*\./!d' \
|
---|
699 | -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\3, 0x0\2, \4);/' \
|
---|
700 | --output [email protected] [email protected]
|
---|
701 | $(QUIET)$(SED) \
|
---|
702 | -e '/VM_size$$/d' \
|
---|
703 | -e '/VMCPU_size$$/d' \
|
---|
704 | -e '/VMMCPU_size$$/d' \
|
---|
705 | -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
|
---|
706 | -e '/HMCPU_size$$/d' \
|
---|
707 | \
|
---|
708 | -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*_size$$/!d' \
|
---|
709 | -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^_.]*\)_size/ CHECK_SIZE(\3, 0x0\2);/' \
|
---|
710 | --append [email protected] [email protected]
|
---|
711 | $(QUIET)$(MV) -f [email protected] $@
|
---|
712 | $(QUIET)$(RM) -f [email protected]
|
---|
713 |
|
---|
714 | # 3. run it.
|
---|
715 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
|
---|
716 | $$(tstAsmStructs_1_STAGE_TARGET) \
|
---|
717 | $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
|
---|
718 | $(QUIET)$(RM) -f $@
|
---|
719 | $(tstAsmStructs_1_STAGE_TARGET)
|
---|
720 | ifdef VBOX_WITH_RAW_MODE
|
---|
721 | $(tstAsmStructsRC_1_STAGE_TARGET)
|
---|
722 | endif
|
---|
723 | $(QUIET)$(APPEND) "$@" "done"
|
---|
724 |
|
---|
725 |
|
---|
726 |
|
---|
727 | #
|
---|
728 | # Run rule for tstVMStructSize.
|
---|
729 | #
|
---|
730 |
|
---|
731 | ifdef VBOX_WITH_RAW_MODE
|
---|
732 | # 1. Manually dump selected structures and members.
|
---|
733 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
|
---|
734 | $(call MSG_GENERATE,tstVMStructSize,$@)
|
---|
735 | $(QUIET)$(REDIRECT) -wo $@ -- $<
|
---|
736 | endif # VBOX_WITH_RAW_MODE
|
---|
737 |
|
---|
738 | # 2. run it.
|
---|
739 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
|
---|
740 | $(QUIET)$(RM) -f $@
|
---|
741 | $<
|
---|
742 | $(QUIET)$(APPEND) "$@" "done"
|
---|
743 |
|
---|
744 | # alias for the two struct tests.
|
---|
745 | run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
746 |
|
---|