1 | # $Id: Makefile.kmk 94409 2022-03-31 10:42:18Z 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)/tstIEMAImplDataFpuBinary1.cpp \
|
---|
255 | $(tstIEMAImpl_0_OUTDIR)/tstIEMAImplDataFpuBinary2.cpp
|
---|
256 | tstIEMAImpl_SOURCES = \
|
---|
257 | tstIEMAImpl.cpp \
|
---|
258 | ../VMMAll/IEMAllAImplC.cpp \
|
---|
259 | $(tstIEMAImpl_CLEAN)
|
---|
260 | $(call KB_FN_DO_PASS0_ON_TARGET,tstIEMAImpl)
|
---|
261 |
|
---|
262 | # This variant mainly for generating data.
|
---|
263 | tstIEMAImplAsm_TEMPLATE = VBOXR3TSTEXE
|
---|
264 | tstIEMAImplAsm_DEFS = $(VMM_COMMON_DEFS) IEM_WITH_ASSEMBLY IN_TSTVMSTRUCT TSTIEMAIMPL_WITH_GENERATOR
|
---|
265 | tstIEMAImplAsm_INCS = ../include .
|
---|
266 | tstIEMAImplAsm_SOURCES = \
|
---|
267 | tstIEMAImpl.cpp \
|
---|
268 | ../VMMAll/IEMAllAImpl.asm \
|
---|
269 | ../VMMAll/IEMAllAImplC.cpp \
|
---|
270 | $(tstIEMAImpl_CLEAN)
|
---|
271 |
|
---|
272 | ## @param 1 The sub-name of the file in question.
|
---|
273 | define def_tstIEMAImplData_adjust
|
---|
274 | $$(tstIEMAImpl_0_OUTDIR)/tstIEMAImplData$(1).cpp: \
|
---|
275 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImplData$(1).cpp \
|
---|
276 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImplData.sh \
|
---|
277 | $$(tstIEMAImpl_DEFPATH)/tstIEMAImpl.h \
|
---|
278 | | $$(tstIEMAImpl_0_OUTDIR)/
|
---|
279 | $$(ASH) "$$(tstIEMAImpl_DEFPATH)/tstIEMAImplData.sh" \
|
---|
280 | "$$(CP_EXT)" \
|
---|
281 | "$$(MV_EXT)" \
|
---|
282 | "$$(SED_EXT)" \
|
---|
283 | "$$(tstIEMAImpl_0_OUTDIR)" \
|
---|
284 | "$$(tstIEMAImpl_DEFPATH)" \
|
---|
285 | "$(1)"
|
---|
286 | endef
|
---|
287 | $(evalcall2 def_tstIEMAImplData_adjust,Int)
|
---|
288 | $(evalcall2 def_tstIEMAImplData_adjust,Int-Amd)
|
---|
289 | $(evalcall2 def_tstIEMAImplData_adjust,Int-Intel)
|
---|
290 | $(evalcall2 def_tstIEMAImplData_adjust,FpuLdSt)
|
---|
291 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary1)
|
---|
292 | $(evalcall2 def_tstIEMAImplData_adjust,FpuBinary2)
|
---|
293 |
|
---|
294 |
|
---|
295 | #
|
---|
296 | # Testcase for checking the repurposing of the IEM instruction code.
|
---|
297 | #
|
---|
298 | tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
|
---|
299 | tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
|
---|
300 | tstIEMCheckMc_DEFS = $(VMM_COMMON_DEFS)
|
---|
301 | tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
|
---|
302 | ifeq ($(KBUILD_TARGET),win)
|
---|
303 | tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -wd4189 # local variable is initialized but not used.
|
---|
304 | else
|
---|
305 | tstIEMCheckMc_CXXFLAGS = $(VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS) -Wno-unused-value -Wno-unused-variable
|
---|
306 | endif
|
---|
307 |
|
---|
308 | #
|
---|
309 | # Saved state manager testcase.
|
---|
310 | #
|
---|
311 | tstSSM_TEMPLATE = VBOXR3TSTEXE
|
---|
312 | tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
313 | tstSSM_DEFS = $(VMM_COMMON_DEFS)
|
---|
314 | tstSSM_SOURCES = tstSSM.cpp
|
---|
315 | tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
316 |
|
---|
317 | #
|
---|
318 | # VMM configuration manager tests.
|
---|
319 | #
|
---|
320 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
321 | tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
|
---|
322 | tstCFGMHardened_NAME = tstCFGM
|
---|
323 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
324 | tstCFGMHardened_DEFS = PROGRAM_NAME_STR="tstCFGM"
|
---|
325 | else
|
---|
326 | tstCFGMHardened_DEFS = PROGRAM_NAME_STR=\"tstCFGM\"
|
---|
327 | endif
|
---|
328 | tstCFGMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
|
---|
329 | tstCFGM_TEMPLATE = VBoxR3HardenedTstDll
|
---|
330 | else
|
---|
331 | tstCFGM_TEMPLATE = VBOXR3TSTEXE
|
---|
332 | endif
|
---|
333 | tstCFGM_DEFS = $(VMM_COMMON_DEFS)
|
---|
334 | tstCFGM_SOURCES = tstCFGM.cpp
|
---|
335 | tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
336 |
|
---|
337 | #
|
---|
338 | # Comparing some compression algorithms considered for SSM usage.
|
---|
339 | #
|
---|
340 | tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
|
---|
341 | tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
|
---|
342 |
|
---|
343 | #
|
---|
344 | # Two testcases for checking the ring-0 setjmp/longjmp code.
|
---|
345 | #
|
---|
346 | tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
|
---|
347 | tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
348 | tstVMMR0CallHost-1_SOURCES = \
|
---|
349 | tstVMMR0CallHost-1.cpp
|
---|
350 | tstVMMR0CallHost-1_SOURCES.amd64 = \
|
---|
351 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
|
---|
352 | tstVMMR0CallHost-1_SOURCES.x86 = \
|
---|
353 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
|
---|
354 |
|
---|
355 |
|
---|
356 | #
|
---|
357 | # For testing the VM request queue code.
|
---|
358 | #
|
---|
359 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
360 | tstVMREQHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
361 | tstVMREQHardened_NAME = tstVMREQ
|
---|
362 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
363 | tstVMREQHardened_DEFS = PROGRAM_NAME_STR="tstVMREQ"
|
---|
364 | else
|
---|
365 | tstVMREQHardened_DEFS = PROGRAM_NAME_STR=\"tstVMREQ\"
|
---|
366 | endif
|
---|
367 | tstVMREQHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
368 | tstVMREQ_TEMPLATE = VBOXR3
|
---|
369 | else
|
---|
370 | tstVMREQ_TEMPLATE = VBOXR3EXE
|
---|
371 | endif
|
---|
372 | tstVMREQ_DEFS = $(VMM_COMMON_DEFS)
|
---|
373 | tstVMREQ_SOURCES = tstVMREQ.cpp
|
---|
374 | tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
375 |
|
---|
376 | #
|
---|
377 | # Tool for reanimate things like OS/2 dumps.
|
---|
378 | #
|
---|
379 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
380 | tstAnimateHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
381 | tstAnimateHardened_NAME = tstAnimate
|
---|
382 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
383 | tstAnimateHardened_DEFS = PROGRAM_NAME_STR="tstAnimate"
|
---|
384 | else
|
---|
385 | tstAnimateHardened_DEFS = PROGRAM_NAME_STR=\"tstAnimate\"
|
---|
386 | endif
|
---|
387 | tstAnimateHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
388 | tstAnimate_TEMPLATE = VBOXR3
|
---|
389 | else
|
---|
390 | tstAnimate_TEMPLATE = VBOXR3EXE
|
---|
391 | endif
|
---|
392 | tstAnimate_DEFS = $(VMM_COMMON_DEFS)
|
---|
393 | tstAnimate_SOURCES = tstAnimate.cpp
|
---|
394 | tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
395 |
|
---|
396 | tstX86-1_TEMPLATE = VBOXR3TSTEXE
|
---|
397 | tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
|
---|
398 | tstX86-1_LIBS = $(LIB_RUNTIME)
|
---|
399 | tstX86-1_LDFLAGS.linux = $(VBOX_GCC_no-pie)
|
---|
400 |
|
---|
401 | tstX86-FpuSaveRestore_TEMPLATE = VBOXR3TSTEXE
|
---|
402 | tstX86-FpuSaveRestore_SOURCES = tstX86-FpuSaveRestore.cpp tstX86-FpuSaveRestoreA.asm
|
---|
403 | tstX86-FpuSaveRestore_LIBS = $(LIB_RUNTIME)
|
---|
404 |
|
---|
405 | ifdef VBOX_WITH_RAW_MODE
|
---|
406 |
|
---|
407 | #
|
---|
408 | # Raw-mode VMM testcase.
|
---|
409 | #
|
---|
410 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
411 | tstVMMHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
412 | tstVMMHardened_NAME = tstVMM
|
---|
413 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
414 | tstVMMHardened_DEFS = PROGRAM_NAME_STR="tstVMM"
|
---|
415 | else
|
---|
416 | tstVMMHardened_DEFS = PROGRAM_NAME_STR=\"tstVMM\"
|
---|
417 | endif
|
---|
418 | tstVMMHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
419 | tstVMM_TEMPLATE = VBOXR3
|
---|
420 | else
|
---|
421 | tstVMM_TEMPLATE = VBOXR3EXE
|
---|
422 | endif
|
---|
423 | tstVMM_SOURCES = tstVMM.cpp
|
---|
424 | tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
425 |
|
---|
426 | #
|
---|
427 | # HM VMM testcase.
|
---|
428 | #
|
---|
429 | tstVMM-HM_TEMPLATE = VBOXR3EXE
|
---|
430 | tstVMM-HM_SOURCES = tstVMM-HM.cpp
|
---|
431 | tstVMM-HM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
432 |
|
---|
433 | #
|
---|
434 | # VMM host process fork test case (memory ++).
|
---|
435 | #
|
---|
436 | tstVMMFork_TEMPLATE = VBOXR3EXE
|
---|
437 | tstVMMFork_SOURCES = tstVMMFork.cpp
|
---|
438 | tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
439 |
|
---|
440 | #
|
---|
441 | # Raw-mode micro benchmark.
|
---|
442 | #
|
---|
443 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
444 | tstMicroHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
445 | tstMicroHardened_NAME = tstMicro
|
---|
446 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
447 | tstMicroHardened_DEFS = PROGRAM_NAME_STR="tstMicro"
|
---|
448 | else
|
---|
449 | tstMicroHardened_DEFS = PROGRAM_NAME_STR=\"tstMicro\"
|
---|
450 | endif
|
---|
451 | tstMicroHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
452 | tstMicro_TEMPLATE = VBOXR3
|
---|
453 | else
|
---|
454 | tstMicro_TEMPLATE = VBOXR3EXE
|
---|
455 | endif
|
---|
456 | tstMicro_SOURCES = tstMicro.cpp
|
---|
457 | tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
458 | tstMicro_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
|
---|
459 |
|
---|
460 | tstMicroRC_TEMPLATE = VBoxRc
|
---|
461 | tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
|
---|
462 | tstMicroRC_DEFS = $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,)
|
---|
463 | tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
|
---|
464 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
465 | tstMicroRC_LDFLAGS = -Entry:tstMicroRC
|
---|
466 | endif
|
---|
467 | tstMicroRC_SYSSUFF = .gc
|
---|
468 | tstMicroRC_LIBS = \
|
---|
469 | $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
|
---|
470 | $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
|
---|
471 | ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
|
---|
472 | tstMicroRC_LIBS += \
|
---|
473 | $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
|
---|
474 | $(LIB_VMMRC)
|
---|
475 | endif
|
---|
476 | tstMicroRC_SOURCES.win = tstMicroRC.def
|
---|
477 |
|
---|
478 | endif # VBOX_WITH_RAW_MODE
|
---|
479 |
|
---|
480 |
|
---|
481 | if !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
|
---|
482 | #
|
---|
483 | # Special NEM host testcase.
|
---|
484 | #
|
---|
485 | if ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "darwin.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
|
---|
486 | || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "linux.amd64" && (defined(VBOX_WITH_NATIVE_NEM) || "$(USERNAME)" == "bird")) \
|
---|
487 | || ("$(KBUILD_TARGET_ARCH).$(KBUILD_TARGET_ARCH)" == "win.amd64" && defined(VBOX_WITH_NATIVE_NEM))
|
---|
488 | PROGRAMS += NemRawBench-1
|
---|
489 | NemRawBench-1_TEMPLATE = VBoxR3Static
|
---|
490 | NemRawBench-1_SOURCES = NemRawBench-1.cpp
|
---|
491 | NemRawBench-1_BLD_TYPE = release
|
---|
492 | NemRawBench-1_INCS.win = \
|
---|
493 | $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
|
---|
494 | $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
|
---|
495 | NemRawBench-1_CXXFLAGS.darwin = \
|
---|
496 | -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform//Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
|
---|
497 | #NemRawBench-1_LDFLAGS.darwin = \
|
---|
498 | # -F/System/Library/Frameworks \
|
---|
499 | # -framework Hypervisor
|
---|
500 | NemRawBench-1_LDFLAGS.darwin = \
|
---|
501 | /System/Library/Frameworks/Hypervisor.framework/Hypervisor
|
---|
502 | endif
|
---|
503 | endif
|
---|
504 |
|
---|
505 | #
|
---|
506 | # PDM Queue tests.
|
---|
507 | #
|
---|
508 | tstPDMQueue_TEMPLATE := VBOXR3EXE
|
---|
509 | tstPDMQueue_DEFS = $(VMM_COMMON_DEFS)
|
---|
510 | tstPDMQueue_SOURCES := tstPDMQueue.cpp
|
---|
511 | tstPDMQueue_LIBS := $(LIB_VMM) $(LIB_RUNTIME)
|
---|
512 |
|
---|
513 |
|
---|
514 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
515 | #
|
---|
516 | # PDM asynchronous completation test.
|
---|
517 | #
|
---|
518 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
519 | tstPDMAsyncCompletionHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
520 | tstPDMAsyncCompletionHardened_NAME = tstPDMAsyncCompletion
|
---|
521 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
522 | tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletion"
|
---|
523 | else
|
---|
524 | tstPDMAsyncCompletionHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletion\"
|
---|
525 | endif
|
---|
526 | tstPDMAsyncCompletionHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
527 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3
|
---|
528 | else
|
---|
529 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
|
---|
530 | endif
|
---|
531 | tstPDMAsyncCompletion_DEFS = $(VMM_COMMON_DEFS)
|
---|
532 | tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
533 | tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
|
---|
534 | tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
535 |
|
---|
536 | #
|
---|
537 | # PDM asynchronous completation stress test.
|
---|
538 | #
|
---|
539 | if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
|
---|
540 | tstPDMAsyncCompletionStressHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
541 | tstPDMAsyncCompletionStressHardened_NAME = tstPDMAsyncCompletionStress
|
---|
542 | ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
|
---|
543 | tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR="tstPDMAsyncCompletionStress"
|
---|
544 | else
|
---|
545 | tstPDMAsyncCompletionStressHardened_DEFS = PROGRAM_NAME_STR=\"tstPDMAsyncCompletionStress\"
|
---|
546 | endif
|
---|
547 | tstPDMAsyncCompletionStressHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
|
---|
548 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3
|
---|
549 | else
|
---|
550 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
|
---|
551 | endif
|
---|
552 | tstPDMAsyncCompletionStress_DEFS = $(VMM_COMMON_DEFS)
|
---|
553 | tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
554 | tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
|
---|
555 | tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
556 | endif
|
---|
557 |
|
---|
558 | ifndef VBOX_ONLY_EXTPACKS
|
---|
559 | PROGRAMS += tstSSM-2
|
---|
560 | tstSSM-2_TEMPLATE = VBOXR3TSTEXE
|
---|
561 | tstSSM-2_DEFS = IN_VMM_STATIC
|
---|
562 | tstSSM-2_SOURCES = tstSSM-2.cpp
|
---|
563 | tstSSM-2_LIBS = $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB)
|
---|
564 | endif
|
---|
565 |
|
---|
566 | #
|
---|
567 | # Generate VM structure tests.
|
---|
568 | #
|
---|
569 | if !defined(VBOX_ONLY_EXTPACKS) \
|
---|
570 | && ( defined(VBOX_WITH_DTRACE_R3) \
|
---|
571 | || defined(VBOX_WITH_DTRACE_R0) \
|
---|
572 | || defined(VBOX_WITH_DTRACE_RC))
|
---|
573 | tstVMStructDTrace_TEMPLATE = VBOXR3AUTOTST
|
---|
574 | tstVMStructDTrace_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS $(VMM_COMMON_DEFS)
|
---|
575 | ifdef VBOX_WITH_RAW_MODE
|
---|
576 | tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
|
---|
577 | endif
|
---|
578 | tstVMStructDTrace_INCS = \
|
---|
579 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
580 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
581 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
582 | tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
|
---|
583 | ifdef VBOX_WITH_R0_LOGGING
|
---|
584 | tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
|
---|
585 | endif
|
---|
586 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
587 | tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
588 | endif
|
---|
589 |
|
---|
590 |
|
---|
591 | VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
|
---|
592 | VMMLibDTraceStructTest_SOURCES = \
|
---|
593 | $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
|
---|
594 | VMMLibDTraceStructTest_CLEAN = \
|
---|
595 | $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
|
---|
596 |
|
---|
597 | $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
|
---|
598 | $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
|
---|
599 | $(QUIET)$(RM) -f $@
|
---|
600 | $< > $@
|
---|
601 |
|
---|
602 | endif
|
---|
603 |
|
---|
604 |
|
---|
605 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
606 |
|
---|
607 |
|
---|
608 | #
|
---|
609 | # Some handcrafted support targets for tstAsmStructs.
|
---|
610 | #
|
---|
611 | MY_ASA_ASM_STUFF = \
|
---|
612 | $(addprefix -D, \
|
---|
613 | $(DEFS) \
|
---|
614 | $(DEFS.$(KBUILD_TYPE)) \
|
---|
615 | $(DEFS.$(KBUILD_TARGET)) \
|
---|
616 | IN_RING3 $(ARCH_BITS_DEFS) \
|
---|
617 | $(DEFS.$(KBUILD_TARGET_ARCH)) \
|
---|
618 | $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
619 | $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
|
---|
620 | $(VMM_COMMON_DEFS) \
|
---|
621 | ) \
|
---|
622 | -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
|
---|
623 | $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
|
---|
624 | ,-I$(inc)/)
|
---|
625 |
|
---|
626 | # 1a. make a header file which makes all the structures+members globals.
|
---|
627 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
|
---|
628 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
629 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
|
---|
630 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
631 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
632 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
633 | $(DEPTH)/include/VBox/vmm/gvm.mac \
|
---|
634 | $(DEPTH)/include/VBox/sup.mac \
|
---|
635 | $(DEPTH)/include/iprt/x86.mac \
|
---|
636 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
637 | $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
|
---|
638 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
639 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
640 | $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
|
---|
641 | | $$(dir $$@)
|
---|
642 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
643 | ifndef DONT_USE_YASM
|
---|
644 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
645 | $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
|
---|
646 | else
|
---|
647 | $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
648 | $(VBOX_NM) $@.o | $(SED) \
|
---|
649 | -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
|
---|
650 | -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
|
---|
651 | > $@
|
---|
652 | endif
|
---|
653 |
|
---|
654 | # 1b. make an elf/macho object containing the offsets.
|
---|
655 | includedep $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
|
---|
656 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
|
---|
657 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
658 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
659 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
660 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
661 | $(DEPTH)/include/VBox/vmm/hm_vmx.mac \
|
---|
662 | $(DEPTH)/include/VBox/vmm/stam.mac \
|
---|
663 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
664 | $(DEPTH)/include/VBox/sup.mac \
|
---|
665 | $(DEPTH)/include/iprt/x86.mac \
|
---|
666 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
667 | $(VBOX_PATH_VMM_SRC)/include/HMInternal.mac \
|
---|
668 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
669 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
670 | $$(if $$(eq $$(tstAsmStructsAsmDep_STUFF),$$(MY_ASA_ASM_STUFF)),,FORCE) \
|
---|
671 | | $$(dir $$@)
|
---|
672 | $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
|
---|
673 | ifndef DONT_USE_YASM
|
---|
674 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
675 | else
|
---|
676 | $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
677 | endif
|
---|
678 | %$(QUIET2)$(RM) -f -- $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep
|
---|
679 | %$(QUIET2)$(APPEND) '$(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o.dep' 'tstAsmStructsAsmDep_STUFF=$(MY_ASA_ASM_STUFF)'
|
---|
680 |
|
---|
681 | # 2. use nm and sed to transform this into the header we want.
|
---|
682 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
|
---|
683 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
684 | $(QUIET)$(RM) -f $@ $@.dump $@.tmp
|
---|
685 | $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
|
---|
686 | $(QUIET)$(SED) \
|
---|
687 | -e '/STAMPROFILEADV/d' \
|
---|
688 | \
|
---|
689 | -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*\./!d' \
|
---|
690 | -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\3, 0x0\2, \4);/' \
|
---|
691 | --output $@.tmp $@.dump
|
---|
692 | $(QUIET)$(SED) \
|
---|
693 | -e '/VM_size$$/d' \
|
---|
694 | -e '/VMCPU_size$$/d' \
|
---|
695 | -e '/VMMCPU_size$$/d' \
|
---|
696 | -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
|
---|
697 | -e '/HMCPU_size$$/d' \
|
---|
698 | \
|
---|
699 | -e '/^\(0x\)\{0,1\}00[0-9a-fA-F]* [aAnN] [^_.]*_size$$/!d' \
|
---|
700 | -e 's/^\(0x\)\{0,1\}\(00[0-9a-fA-F]*\) [aAnN] \([^_.]*\)_size/ CHECK_SIZE(\3, 0x0\2);/' \
|
---|
701 | --append $@.tmp $@.dump
|
---|
702 | $(QUIET)$(MV) -f $@.tmp $@
|
---|
703 | $(QUIET)$(RM) -f $@.dump
|
---|
704 |
|
---|
705 | # 3. run it.
|
---|
706 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
|
---|
707 | $$(tstAsmStructs_1_STAGE_TARGET) \
|
---|
708 | $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
|
---|
709 | $(QUIET)$(RM) -f $@
|
---|
710 | $(tstAsmStructs_1_STAGE_TARGET)
|
---|
711 | ifdef VBOX_WITH_RAW_MODE
|
---|
712 | $(tstAsmStructsRC_1_STAGE_TARGET)
|
---|
713 | endif
|
---|
714 | $(QUIET)$(APPEND) "$@" "done"
|
---|
715 |
|
---|
716 |
|
---|
717 |
|
---|
718 | #
|
---|
719 | # Run rule for tstVMStructSize.
|
---|
720 | #
|
---|
721 |
|
---|
722 | ifdef VBOX_WITH_RAW_MODE
|
---|
723 | # 1. Manually dump selected structures and members.
|
---|
724 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
|
---|
725 | $(call MSG_GENERATE,tstVMStructSize,$@)
|
---|
726 | $(QUIET)$(REDIRECT) -wo $@ -- $<
|
---|
727 | endif # VBOX_WITH_RAW_MODE
|
---|
728 |
|
---|
729 | # 2. run it.
|
---|
730 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
|
---|
731 | $(QUIET)$(RM) -f $@
|
---|
732 | $<
|
---|
733 | $(QUIET)$(APPEND) "$@" "done"
|
---|
734 |
|
---|
735 | # alias for the two struct tests.
|
---|
736 | run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
737 |
|
---|