VirtualBox

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

Last change on this file since 75050 was 74725, checked in by vboxsync, 6 years ago

VMM/testcase: OSE build fix. bugref:9044

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