VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/Makefile.kmk@ 102549

Last change on this file since 102549 was 102549, checked in by vboxsync, 14 months ago

VMM/IEM: Must truncate constant variable values according to the type size, since we're not getting any help from the C compiler here. bugref:10371

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