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