1 | # $Id: Makefile.kmk 41677 2012-06-13 09:32:02Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VMM testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2012 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 | # Target lists.
|
---|
23 | #
|
---|
24 | PROGRAMS += tstVMStructSize tstAsmStructs
|
---|
25 | ifdef VBOX_WITH_RAW_MODE
|
---|
26 | PROGRAMS += tstVMStructRC tstAsmStructsRC
|
---|
27 | endif
|
---|
28 | if !defined(VBOX_ONLY_EXTPACKS) \
|
---|
29 | && ( defined(VBOX_WITH_DTRACE_R3) \
|
---|
30 | || defined(VBOX_WITH_DTRACE_R0) \
|
---|
31 | || defined(VBOX_WITH_DTRACE_RC))
|
---|
32 | PROGRAMS += tstVMStructDTrace
|
---|
33 | INSTALLS += VMMLibDTraceStructTest
|
---|
34 | endif
|
---|
35 | ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
36 | PROGRAMS += tstGlobalConfig tstInstrEmul
|
---|
37 | ifdef VBOX_WITH_RAW_MODE
|
---|
38 | PROGRAMS += tstVMM tstVMM-HwAccm
|
---|
39 | ifneq ($(KBUILD_TARGET),win)
|
---|
40 | PROGRAMS += tstVMMFork
|
---|
41 | endif
|
---|
42 | endif
|
---|
43 | ifdef VBOX_WITH_TESTCASES
|
---|
44 | PROGRAMS += \
|
---|
45 | tstCFGM \
|
---|
46 | tstCompressionBenchmark \
|
---|
47 | tstIEMCheckMc \
|
---|
48 | tstMMHyperHeap \
|
---|
49 | tstSSM \
|
---|
50 | tstVMMR0CallHost-1 \
|
---|
51 | tstVMMR0CallHost-2 \
|
---|
52 | tstVMREQ
|
---|
53 | ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.x86 solaris.amd64 win.amd64 ) ## TODO: Fix the code.
|
---|
54 | PROGRAMS += tstX86-1
|
---|
55 | endif
|
---|
56 | ifneq ($(KBUILD_TARGET),l4)
|
---|
57 | PROGRAMS += tstAnimate
|
---|
58 | endif
|
---|
59 | ifdef VBOX_WITH_RAW_MODE
|
---|
60 | PROGRAMS += tstMicro
|
---|
61 | SYSMODS += tstMicroRC
|
---|
62 | endif
|
---|
63 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
64 | PROGRAMS += tstPDMAsyncCompletion
|
---|
65 | PROGRAMS += tstPDMAsyncCompletionStress
|
---|
66 | endif
|
---|
67 | endif # VBOX_WITH_TESTCASES
|
---|
68 | endif # !VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
69 |
|
---|
70 | # Where we put our temporary files (just for simplicity)
|
---|
71 | VBOX_VMM_TESTCASE_OUT_DIR := $(PATH_TARGET)/VMM
|
---|
72 | BLDDIRS += $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
73 |
|
---|
74 | #
|
---|
75 | # We setup two 'other' targets for executing the two structure & alignment
|
---|
76 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
77 | #
|
---|
78 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
79 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
80 | OTHERS += \
|
---|
81 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
82 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
83 | endif
|
---|
84 | endif
|
---|
85 |
|
---|
86 | # The normal testing pass.
|
---|
87 | TESTING += \
|
---|
88 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
89 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
90 | ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
91 | TESTING += \
|
---|
92 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run
|
---|
93 | endif
|
---|
94 |
|
---|
95 | OTHER_CLEAN += \
|
---|
96 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run \
|
---|
97 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run \
|
---|
98 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run \
|
---|
99 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.h \
|
---|
100 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o \
|
---|
101 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
102 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.o \
|
---|
103 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac.lst \
|
---|
104 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.h.dump \
|
---|
105 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h \
|
---|
106 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h \
|
---|
107 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
108 |
|
---|
109 | #
|
---|
110 | # Globals
|
---|
111 | #
|
---|
112 | VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
|
---|
113 |
|
---|
114 | #
|
---|
115 | # Targets
|
---|
116 | #
|
---|
117 | ifdef VBOX_WITH_RAW_MODE
|
---|
118 | tstVMStructRC_TEMPLATE = VBoxRcExe
|
---|
119 | tstVMStructRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
|
---|
120 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
|
---|
121 | tstVMStructRC_DEFS += \
|
---|
122 | VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
|
---|
123 | VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
|
---|
124 | endif
|
---|
125 | ifdef VBOX_WITH_R0_LOGGING
|
---|
126 | tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
127 | endif
|
---|
128 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
129 | tstVMStructRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
130 | endif
|
---|
131 | tstVMStructRC_SOURCES = tstVMStructRC.cpp
|
---|
132 | tstVMStructRC_INCS = \
|
---|
133 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
134 | $(VBOX_PATH_VMM_SRC)/PATM
|
---|
135 | endif
|
---|
136 |
|
---|
137 | tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
|
---|
138 | tstVMStructSize_DEFS = IN_VMM_R3 IN_DIS
|
---|
139 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
|
---|
140 | tstVMStructSize_DEFS += \
|
---|
141 | VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
|
---|
142 | VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
|
---|
143 | endif
|
---|
144 | ifdef VBOX_WITH_RAW_MODE
|
---|
145 | tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
|
---|
146 | endif
|
---|
147 | tstVMStructSize_INCS = \
|
---|
148 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
149 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
150 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
151 | tstVMStructSize_SOURCES = tstVMStructSize.cpp
|
---|
152 | ifdef VBOX_WITH_RAW_MODE
|
---|
153 | tstVMStructSize.cpp_DEPS= $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h
|
---|
154 | endif
|
---|
155 | ifdef VBOX_WITH_R0_LOGGING
|
---|
156 | tstVMStructSize_DEFS += VBOX_WITH_R0_LOGGING
|
---|
157 | endif
|
---|
158 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
159 | tstVMStructSize_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
160 | endif
|
---|
161 |
|
---|
162 | tstAsmStructs_TEMPLATE = VBOXR3AUTOTST
|
---|
163 | tstAsmStructs_DEFS = IN_VMM_R3 IN_DIS
|
---|
164 | ifdef VBOX_WITH_RAW_MODE
|
---|
165 | tstAsmStructs_DEFS += VBOX_WITH_RAW_MODE
|
---|
166 | endif
|
---|
167 | ifdef VBOX_WITH_R0_LOGGING
|
---|
168 | tstAsmStructs_DEFS += VBOX_WITH_R0_LOGGING
|
---|
169 | endif
|
---|
170 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
171 | tstAsmStructs_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
172 | endif
|
---|
173 | tstAsmStructs_INCS = \
|
---|
174 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
175 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
176 | tstAsmStructs_SOURCES = tstAsmStructs.cpp
|
---|
177 | tstAsmStructs.cpp_DEPS = $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
|
---|
178 |
|
---|
179 | ifdef VBOX_WITH_RAW_MODE
|
---|
180 | tstAsmStructsRC_TEMPLATE= VBoxRcExe
|
---|
181 | tstAsmStructsRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
|
---|
182 | ifdef VBOX_WITH_R0_LOGGING
|
---|
183 | tstAsmStructsRC_DEFS += VBOX_WITH_R0_LOGGING
|
---|
184 | endif
|
---|
185 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
186 | tstAsmStructsRC_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
187 | endif
|
---|
188 | tstAsmStructsRC_INCS = \
|
---|
189 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
190 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
191 | tstAsmStructsRC_SOURCES = tstAsmStructs.cpp
|
---|
192 | tstAsmStructs.cpp_DEPS += $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h
|
---|
193 | endif # VBOX_WITH_RAW_MODE
|
---|
194 |
|
---|
195 |
|
---|
196 | tstGlobalConfig_TEMPLATE= VBOXR3TSTEXE
|
---|
197 | tstGlobalConfig_SOURCES = tstGlobalConfig.cpp
|
---|
198 | tstGlobalConfig_LIBS = $(LIB_RUNTIME)
|
---|
199 |
|
---|
200 | tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE
|
---|
201 | tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp
|
---|
202 | tstIEMCheckMc_LIBS = $(LIB_RUNTIME)
|
---|
203 | ifneq ($(KBUILD_TARGET),win)
|
---|
204 | tstIEMCheckMc_CXXFLAGS = -Wno-unused-parameter
|
---|
205 | endif
|
---|
206 |
|
---|
207 | tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
|
---|
208 | tstMMHyperHeap_SOURCES = tstMMHyperHeap.cpp
|
---|
209 | tstMMHyperHeap_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
210 |
|
---|
211 | tstSSM_TEMPLATE = VBOXR3TSTEXE
|
---|
212 | tstSSM_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
213 | tstSSM_SOURCES = tstSSM.cpp
|
---|
214 | tstSSM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
215 |
|
---|
216 | tstInstrEmul_TEMPLATE = VBOXR3EXE
|
---|
217 | tstInstrEmul_SOURCES = tstInstrEmul.cpp ../VMMAll/EMAllA.asm
|
---|
218 | tstInstrEmul_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
219 |
|
---|
220 | tstCFGM_TEMPLATE = VBOXR3TSTEXE
|
---|
221 | tstCFGM_SOURCES = tstCFGM.cpp
|
---|
222 | tstCFGM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
223 |
|
---|
224 | tstCompressionBenchmark_TEMPLATE = VBOXR3TSTEXE
|
---|
225 | tstCompressionBenchmark_SOURCES = tstCompressionBenchmark.cpp
|
---|
226 |
|
---|
227 | tstVMMR0CallHost-1_TEMPLATE = VBOXR3TSTEXE
|
---|
228 | tstVMMR0CallHost-1_DEFS = VMM_R0_NO_SWITCH_STACK
|
---|
229 | tstVMMR0CallHost-1_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
230 | tstVMMR0CallHost-1_SOURCES = \
|
---|
231 | tstVMMR0CallHost-1.cpp
|
---|
232 | tstVMMR0CallHost-1_SOURCES.amd64 = \
|
---|
233 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-amd64.asm
|
---|
234 | tstVMMR0CallHost-1_SOURCES.x86 = \
|
---|
235 | $(VBOX_PATH_VMM_SRC)/VMMR0/VMMR0JmpA-x86.asm
|
---|
236 |
|
---|
237 | tstVMMR0CallHost-2_EXTENDS = tstVMMR0CallHost-1
|
---|
238 | tstVMMR0CallHost-2_DEFS = VMM_R0_SWITCH_STACK
|
---|
239 |
|
---|
240 | tstVMREQ_TEMPLATE = VBOXR3EXE
|
---|
241 | tstVMREQ_SOURCES = tstVMREQ.cpp
|
---|
242 | tstVMREQ_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
243 |
|
---|
244 | tstAnimate_TEMPLATE = VBOXR3EXE
|
---|
245 | tstAnimate_SOURCES = tstAnimate.cpp
|
---|
246 | tstAnimate_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
247 |
|
---|
248 | tstX86-1_TEMPLATE = VBOXR3TSTEXE
|
---|
249 | tstX86-1_SOURCES = tstX86-1.cpp tstX86-1A.asm
|
---|
250 | tstX86-1_LIBS = $(LIB_RUNTIME)
|
---|
251 |
|
---|
252 | ifdef VBOX_WITH_RAW_MODE
|
---|
253 |
|
---|
254 | tstVMM_TEMPLATE = VBOXR3EXE
|
---|
255 | tstVMM_SOURCES = tstVMM.cpp
|
---|
256 | tstVMM_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
257 |
|
---|
258 | tstVMM-HwAccm_TEMPLATE = VBOXR3EXE
|
---|
259 | tstVMM-HwAccm_SOURCES = tstVMM-HwAccm.cpp
|
---|
260 | tstVMM-HwAccm_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
261 |
|
---|
262 | tstVMMFork_TEMPLATE = VBOXR3EXE
|
---|
263 | tstVMMFork_SOURCES = tstVMMFork.cpp
|
---|
264 | tstVMMFork_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
265 |
|
---|
266 | tstMicro_TEMPLATE = VBOXR3EXE
|
---|
267 | tstMicro_SOURCES = tstMicro.cpp
|
---|
268 | tstMicro_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
269 |
|
---|
270 | tstMicroRC_TEMPLATE = VBoxRc
|
---|
271 | tstMicroRC_SOURCES = tstMicroRC.cpp tstMicroRCA.asm
|
---|
272 | tstMicroRC_DEFS =
|
---|
273 | tstMicroRC_INCS = $(VBOX_PATH_VMM_SRC)/testcase
|
---|
274 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
275 | tstMicroRC_LDFLAGS = -Entry:tstMicroRC
|
---|
276 | endif
|
---|
277 | tstMicroRC_SYSSUFF = .gc
|
---|
278 | tstMicroRC_LIBS = \
|
---|
279 | $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
|
---|
280 | $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
|
---|
281 | ifeq ($(filter-out pe lx,$(VBOX_LDR_FMT32)),)
|
---|
282 | tstMicroRC_LIBS += \
|
---|
283 | $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
|
---|
284 | $(LIB_VMMGC)
|
---|
285 | endif
|
---|
286 | tstMicroRC_SOURCES.win = tstMicroRC.def
|
---|
287 |
|
---|
288 | endif # VBOX_WITH_RAW_MODE
|
---|
289 |
|
---|
290 | ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
|
---|
291 | tstPDMAsyncCompletion_TEMPLATE = VBOXR3EXE
|
---|
292 | tstPDMAsyncCompletion_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
293 | tstPDMAsyncCompletion_SOURCES = tstPDMAsyncCompletion.cpp
|
---|
294 | tstPDMAsyncCompletion_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
295 |
|
---|
296 | tstPDMAsyncCompletionStress_TEMPLATE = VBOXR3EXE
|
---|
297 | tstPDMAsyncCompletionStress_INCS = $(VBOX_PATH_VMM_SRC)/include
|
---|
298 | tstPDMAsyncCompletionStress_SOURCES = tstPDMAsyncCompletionStress.cpp
|
---|
299 | tstPDMAsyncCompletionStress_LIBS = $(LIB_VMM) $(LIB_REM) $(LIB_RUNTIME)
|
---|
300 | endif
|
---|
301 |
|
---|
302 |
|
---|
303 | #
|
---|
304 | # Generate VM structure tests.
|
---|
305 | #
|
---|
306 | if !defined(VBOX_ONLY_EXTPACKS) \
|
---|
307 | && ( defined(VBOX_WITH_DTRACE_R3) \
|
---|
308 | || defined(VBOX_WITH_DTRACE_R0) \
|
---|
309 | || defined(VBOX_WITH_DTRACE_RC))
|
---|
310 | tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
|
---|
311 | tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS
|
---|
312 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
|
---|
313 | tstVMStructDTrace_DEFS += \
|
---|
314 | VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
|
---|
315 | VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
|
---|
316 | endif
|
---|
317 | ifdef VBOX_WITH_RAW_MODE
|
---|
318 | tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
|
---|
319 | endif
|
---|
320 | tstVMStructDTrace_INCS = \
|
---|
321 | $(VBOX_PATH_VMM_SRC)/include \
|
---|
322 | $(VBOX_PATH_VMM_SRC)/PATM \
|
---|
323 | $(VBOX_VMM_TESTCASE_OUT_DIR)
|
---|
324 | tstVMStructDTrace_SOURCES = tstVMStructDTrace.cpp
|
---|
325 | ifdef VBOX_WITH_R0_LOGGING
|
---|
326 | tstVMStructDTrace_DEFS += VBOX_WITH_R0_LOGGING
|
---|
327 | endif
|
---|
328 | ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
329 | tstVMStructDTrace_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
|
---|
330 | endif
|
---|
331 |
|
---|
332 |
|
---|
333 | VMMLibDTraceStructTest_INST = $(VBOX_INST_DTRACE_TST)$(KBUILD_TARGET_ARCH)/
|
---|
334 | VMMLibDTraceStructTest_SOURCES = \
|
---|
335 | $(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d
|
---|
336 |
|
---|
337 | $$(tstVMStructDTrace_0_OUTDIR)/vbox-vm-struct-test.d: \
|
---|
338 | $$(tstVMStructDTrace_1_STAGE_TARGET) | $$(dir $$@)
|
---|
339 | $(QUIET)$(RM) -f $@
|
---|
340 | $< > $@
|
---|
341 |
|
---|
342 | endif
|
---|
343 |
|
---|
344 |
|
---|
345 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
346 |
|
---|
347 |
|
---|
348 | #
|
---|
349 | # Run rule for tstInstrEmul.
|
---|
350 | #
|
---|
351 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstInstrEmul.run: $$(tstInstrEmul_1_STAGE_TARGET) | $$(dir $$@)
|
---|
352 | $(QUIET)$(RM) -f $@
|
---|
353 | $(QUIET)$(REDIRECT) -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
|
---|
354 | $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
|
---|
355 | -- \
|
---|
356 | $(tstInstrEmul_1_STAGE_TARGET)
|
---|
357 | $(QUIET)$(APPEND) "$@" "done"
|
---|
358 |
|
---|
359 |
|
---|
360 | #
|
---|
361 | # Some handcrafted support targets for tstAsmStructs.
|
---|
362 | #
|
---|
363 |
|
---|
364 | ifeq ($(KBUILD_HOST),win)
|
---|
365 | ifndef TOOL_MINGW32
|
---|
366 | include $(KBUILD_PATH)/tools/MINGW32.kmk
|
---|
367 | endif
|
---|
368 | VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p
|
---|
369 | else
|
---|
370 | VBOX_NM ?= nm -p
|
---|
371 | endif
|
---|
372 |
|
---|
373 | MY_ASA_ASM_STUFF = \
|
---|
374 | $(addprefix -D, \
|
---|
375 | $(DEFS) \
|
---|
376 | $(DEFS.$(KBUILD_TYPE)) \
|
---|
377 | $(DEFS.$(KBUILD_TARGET)) \
|
---|
378 | IN_RING3 $(ARCH_BITS_DEFS) \
|
---|
379 | $(DEFS.$(KBUILD_TARGET_ARCH)) \
|
---|
380 | $(DEFS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
381 | $(if $(VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI),VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI,) \
|
---|
382 | ) \
|
---|
383 | -f $(if $(eq $(KBUILD_TARGET),darwin),macho,elf) \
|
---|
384 | $(foreach inc,$(INCS) $(VBOX_PATH_VMM_SRC)/testcase $(VBOX_PATH_VMM_SRC)/include $(VBOX_VMM_TESTCASE_OUT_DIR)\
|
---|
385 | ,-I$(inc)/)
|
---|
386 |
|
---|
387 | # 1a. make a header file which makes all the structures+members globals.
|
---|
388 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac: \
|
---|
389 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
390 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed \
|
---|
391 | $(DEPTH)/include/iprt/asmdefs.mac \
|
---|
392 | $(DEPTH)/include/VBox/vmm/cpum.mac \
|
---|
393 | $(DEPTH)/include/VBox/vmm/vm.mac \
|
---|
394 | $(DEPTH)/include/VBox/sup.mac \
|
---|
395 | $(DEPTH)/include/iprt/x86.mac \
|
---|
396 | $(VBOX_PATH_VMM_SRC)/include/CPUMInternal.mac \
|
---|
397 | $(VBOX_PATH_VMM_SRC)/include/TRPMInternal.mac \
|
---|
398 | $(VBOX_PATH_VMM_SRC)/include/HWACCMInternal.mac \
|
---|
399 | $(VBOX_PATH_VMM_SRC)/include/VMMInternal.mac \
|
---|
400 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
401 | $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) \
|
---|
402 | | $$(dir $$@)
|
---|
403 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
404 | ifndef DONT_USE_YASM
|
---|
405 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
406 | $(SED) -f $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm-lst.sed --output $@ $@.lst
|
---|
407 | else
|
---|
408 | $(QUIET)$(TOOL_NASM_AS) -g $(MY_ASA_ASM_STUFF) -o $@.o -l $@.lst $<
|
---|
409 | $(VBOX_NM) $@.o | $(SED) \
|
---|
410 | -e '/[0-9a-fA-F][0-9a-fA-F]* [^a] /d' \
|
---|
411 | -e 's/[0-9a-fA-F][0-9a-fA-F]* a \([^ ]*\)/global \1/' \
|
---|
412 | > $@
|
---|
413 | endif
|
---|
414 |
|
---|
415 | # 1b. make an elf/macho object containing the offsets.
|
---|
416 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o: \
|
---|
417 | $(VBOX_PATH_VMM_SRC)/testcase/tstAsmStructsAsm.asm \
|
---|
418 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.mac \
|
---|
419 | $(VBOX_PATH_VMM_SRC)/testcase/Makefile.kmk \
|
---|
420 | | $$(dir $$@)
|
---|
421 | $(call MSG_COMPILE,tstAsmStructsasm,$<,$@,AS)
|
---|
422 | ifndef DONT_USE_YASM
|
---|
423 | $(QUIET)$(TOOL_YASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
424 | else
|
---|
425 | $(QUIET)$(TOOL_NASM_AS) $(MY_ASA_ASM_STUFF) -DDO_GLOBALS -o $@ $<
|
---|
426 | endif
|
---|
427 |
|
---|
428 | # 2. use nm and sed to transform this into the header we want.
|
---|
429 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsAsm.o
|
---|
430 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
431 | $(QUIET)$(RM) -f $@ $@.dump $@.tmp
|
---|
432 | $(QUIET)$(REDIRECT) -wo $@.dump -- $(VBOX_NM) $<
|
---|
433 | $(QUIET)$(SED) \
|
---|
434 | -e '/STAMPROFILEADV/d' \
|
---|
435 | \
|
---|
436 | -e '/00[0-9a-fA-F]* [aA] [^_.]*\./!d' \
|
---|
437 | -e 's/\(00[0-9a-fA-F]*\) [aA] \([^.]*\)\.\(.*$$\)/ CHECK_OFF(\2, 0x0\1, \3);/' \
|
---|
438 | --output $@.tmp $@.dump
|
---|
439 | $(QUIET)$(SED) \
|
---|
440 | -e '/VM_size$$/d' \
|
---|
441 | -e '/VMCPU_size$$/d' \
|
---|
442 | -e '/VMMCPU_size$$/d' \
|
---|
443 | -e '/SUPDRVTRACERUSRCTX32_size$$/d' \
|
---|
444 | \
|
---|
445 | -e '/00[0-9a-fA-F]* [aA] [^_.]*_size$$/!d' \
|
---|
446 | -e 's/\(00[0-9a-fA-F]*\) [aA] \([^_.]*\)_size/ CHECK_SIZE(\2, 0x0\1);/' \
|
---|
447 | --append $@.tmp $@.dump
|
---|
448 | $(QUIET)$(MV) -f $@.tmp $@
|
---|
449 | $(QUIET)$(RM) -f $@.dump
|
---|
450 |
|
---|
451 | ifdef VBOX_WITH_RAW_MODE
|
---|
452 | # 3. transform the HC header into a RC one by omitting some HC only structures.
|
---|
453 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsRC.h: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructsHC.h
|
---|
454 | $(call MSG_GENERATE,tstVMStructSize,$@,$<)
|
---|
455 | $(QUIET)$(SED) -e '/VMMSWITCHERDEF/d' --output $@ $^
|
---|
456 | endif
|
---|
457 |
|
---|
458 | # 4. run it.
|
---|
459 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run: \
|
---|
460 | $$(tstAsmStructs_1_STAGE_TARGET) \
|
---|
461 | $(if-expr defined(VBOX_WITH_RAW_MODE),$$(tstAsmStructsRC_1_STAGE_TARGET),)
|
---|
462 | $(QUIET)$(RM) -f $@
|
---|
463 | $(tstAsmStructs_1_STAGE_TARGET)
|
---|
464 | ifdef VBOX_WITH_RAW_MODE
|
---|
465 | $(tstAsmStructsRC_1_STAGE_TARGET)
|
---|
466 | endif
|
---|
467 | $(QUIET)$(APPEND) "$@" "done"
|
---|
468 |
|
---|
469 |
|
---|
470 |
|
---|
471 | #
|
---|
472 | # Run rule for tstVMStructSize.
|
---|
473 | #
|
---|
474 |
|
---|
475 | ifdef VBOX_WITH_RAW_MODE
|
---|
476 | # 1. Manually dump selected structures and members.
|
---|
477 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructRC.h: $$(tstVMStructRC_1_STAGE_TARGET) | $$(dir $$@)
|
---|
478 | $(call MSG_GENERATE,tstVMStructSize,$@)
|
---|
479 | $(QUIET)$(REDIRECT) -wo $@ -- $<
|
---|
480 | endif # VBOX_WITH_RAW_MODE
|
---|
481 |
|
---|
482 | # 2. run it.
|
---|
483 | $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run: $$(tstVMStructSize_1_STAGE_TARGET) | $$(dir $$@)
|
---|
484 | $(QUIET)$(RM) -f $@
|
---|
485 | $<
|
---|
486 | $(QUIET)$(APPEND) "$@" "done"
|
---|
487 |
|
---|
488 | # alias for the two struct tests.
|
---|
489 | run-struct-tests: $(VBOX_VMM_TESTCASE_OUT_DIR)/tstAsmStructs.run $(VBOX_VMM_TESTCASE_OUT_DIR)/tstVMStructSize.run
|
---|
490 |
|
---|