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