VirtualBox

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

Last change on this file since 73510 was 73348, checked in by vboxsync, 6 years ago

DBGF,DBGC,GIMHv: Added some basic windows bug check formatting (DBGFR3FormatBugCheck). Extended DBGFEventGenericWithArgs and DBGFEVENT to hold up to 6 64-bit arguments, so that we can pass all the bug check arguments to the debugger.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 31.6 KB
Line 
1# $Id: Makefile.kmk 73348 2018-07-25 09:25:45Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
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# Include our Config.kmk if kmk is invoked from a parent directory.
22ifndef VBOX_VMM_CONFIG_KMK_INCLUDED
23 include $(PATH_SUB_CURRENT)/Config.kmk
24endif
25
26# Include sub-makefiles.
27ifndef VBOX_ONLY_EXTPACKS
28 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
29endif
30include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
31
32
33# Fail on unsupported hosts.
34ifeq ($(KBUILD_TARGET_ARCH),x86)
35 ifeq ($(KBUILD_TARGET),darwin)
36 $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit support.)
37 else ifeq ($(KBUILD_TARGET),solaris)
38 $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit support.)
39 endif
40endif
41
42
43#
44# The VMM DLL.
45#
46ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
47 DLLS += VBoxVMM
48endif
49VBoxVMM_TEMPLATE = VBoxR3DllNoPic
50VBoxVMM_SONAME.linux = VBoxVMM.so
51
52VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
53## @todo eliminate IN_GMM_R3
54ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
55 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
56endif
57ifdef VBOX_WITH_VUSB
58 VBoxVMM_DEFS += VBOX_WITH_USB
59endif
60ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
61 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
62endif
63ifdef VBOX_WITH_NETSHAPER
64 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
65endif
66ifdef VBOX_WITH_RAW_MODE
67 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
68endif
69ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
70 VBoxVMM_DEFS += VMM_R0_SWITCH_STACK
71endif
72if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird"
73 VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
74endif
75VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
76
77VBoxVMM_INCS = \
78 include \
79 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
80 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
81VBoxVMM_ASINCS = .
82
83VBoxVMM_SOURCES = \
84 VBoxVMM.d \
85 VMMR3/APIC.cpp \
86 VMMR3/CFGM.cpp \
87 VMMR3/CPUM.cpp \
88 VMMR3/CPUMR3CpuId.cpp \
89 VMMR3/CPUMR3Db.cpp \
90 VMMR3/CPUMDbg.cpp \
91 VMMR3/DBGF.cpp \
92 VMMR3/DBGFAddr.cpp \
93 VMMR3/DBGFAddrSpace.cpp \
94 VMMR3/DBGFBp.cpp \
95 VMMR3/DBGFR3BugCheck.cpp \
96 VMMR3/DBGFCoreWrite.cpp \
97 VMMR3/DBGFCpu.cpp \
98 VMMR3/DBGFDisas.cpp \
99 VMMR3/DBGFInfo.cpp \
100 VMMR3/DBGFLog.cpp \
101 VMMR3/DBGFMem.cpp \
102 VMMR3/DBGFR3ModInMem.cpp \
103 VMMR3/DBGFOS.cpp \
104 VMMR3/DBGFR3PlugIn.cpp \
105 VMMR3/DBGFReg.cpp \
106 VMMR3/DBGFStack.cpp \
107 VMMR3/DBGFR3Flow.cpp \
108 VMMR3/DBGFR3Trace.cpp \
109 VMMR3/DBGFR3Type.cpp \
110 VMMR3/EM.cpp \
111 VMMR3/EMR3Dbg.cpp \
112 $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
113 VMMR3/EMHM.cpp \
114 VMMR3/EMR3Nem.cpp \
115 VMMR3/FTM.cpp \
116 VMMR3/GIM.cpp \
117 VMMR3/GIMHv.cpp \
118 VMMR3/GIMKvm.cpp \
119 VMMR3/GIMMinimal.cpp \
120 VMMR3/IEMR3.cpp \
121 VMMR3/IOM.cpp \
122 VMMR3/GMM.cpp \
123 VMMR3/MM.cpp \
124 VMMR3/MMHeap.cpp \
125 VMMR3/MMHyper.cpp \
126 VMMR3/MMPagePool.cpp \
127 VMMR3/MMUkHeap.cpp \
128 VMMR3/NEMR3.cpp \
129 VMMR3/PDM.cpp \
130 VMMR3/PDMBlkCache.cpp \
131 VMMR3/PDMDevice.cpp \
132 VMMR3/PDMDevHlp.cpp \
133 VMMR3/PDMDevMiscHlp.cpp \
134 VMMR3/PDMDriver.cpp \
135 VMMR3/PDMLdr.cpp \
136 VMMR3/PDMCritSect.cpp \
137 VMMR3/PDMQueue.cpp \
138 VMMR3/PDMThread.cpp \
139 VMMR3/PGM.cpp \
140 VMMR3/PGMDbg.cpp \
141 VMMR3/PGMR3DbgA.asm \
142 VMMR3/PGMHandler.cpp \
143 VMMR3/PGMMap.cpp \
144 VMMR3/PGMPhys.cpp \
145 VMMR3/PGMPool.cpp \
146 VMMR3/PGMSavedState.cpp \
147 VMMR3/PGMSharedPage.cpp \
148 VMMR3/SELM.cpp \
149 VMMR3/SSM.cpp \
150 VMMR3/STAM.cpp \
151 VMMR3/TM.cpp \
152 VMMR3/TRPM.cpp \
153 VMMR3/VM.cpp \
154 VMMR3/VMEmt.cpp \
155 VMMR3/VMReq.cpp \
156 VMMR3/VMM.cpp \
157 VMMR3/VMMGuruMeditation.cpp \
158 VMMR3/VMMSwitcher.cpp \
159 VMMR3/VMMTests.cpp \
160 VMMR3/HM.cpp \
161 $(if-expr defined(VBOX_WITH_RAW_MODE), \
162 VMMR3/CSAM.cpp \
163 VMMR3/PATM.cpp \
164 VMMR3/PATMPatch.cpp \
165 VMMR3/PATMGuest.cpp \
166 VMMR3/PATMA.asm \
167 VMMR3/PATMSSM.cpp \
168 VMMR3/PATMR3Dbg.cpp \
169 ,) \
170 VMMAll/APICAll.cpp \
171 VMMAll/CPUMAllRegs.cpp \
172 VMMAll/CPUMAllMsrs.cpp \
173 VMMAll/CPUMStack.cpp \
174 VMMAll/DBGFAll.cpp \
175 VMMAll/HMAll.cpp \
176 VMMAll/HMSVMAll.cpp \
177 VMMAll/IEMAll.cpp \
178 VMMAll/IEMAllAImpl.asm \
179 VMMAll/IEMAllAImplC.cpp \
180 VMMAll/IOMAll.cpp \
181 VMMAll/IOMAllMMIO.cpp \
182 VMMAll/MMAll.cpp \
183 VMMAll/MMAllHyper.cpp \
184 VMMAll/MMAllPagePool.cpp \
185 VMMAll/NEMAll.cpp \
186 VMMAll/PDMAll.cpp \
187 VMMAll/PDMAllCritSect.cpp \
188 VMMAll/PDMAllCritSectRw.cpp \
189 VMMAll/PDMAllCritSectBoth.cpp \
190 VMMAll/PDMAllQueue.cpp \
191 VMMAll/PGMAll.cpp \
192 VMMAll/PGMAllHandler.cpp \
193 VMMAll/PGMAllMap.cpp \
194 VMMAll/PGMAllPhys.cpp \
195 VMMAll/PGMAllPool.cpp \
196 VMMAll/SELMAll.cpp \
197 VMMAll/EMAll.cpp \
198 VMMAll/FTMAll.cpp \
199 VMMAll/GIMAll.cpp \
200 VMMAll/GIMAllHv.cpp \
201 VMMAll/GIMAllKvm.cpp \
202 VMMAll/TMAll.cpp \
203 VMMAll/TMAllCpu.cpp \
204 VMMAll/TMAllReal.cpp \
205 VMMAll/TMAllVirtual.cpp \
206 VMMAll/TRPMAll.cpp \
207 VMMAll/VMAll.cpp \
208 VMMAll/VMMAll.cpp \
209 VMMAll/VMMAllA.asm \
210 $(if-expr defined(VBOX_WITH_RAW_MODE), \
211 VMMAll/CSAMAll.cpp \
212 VMMAll/PATMAll.cpp \
213 ,)
214ifdef VBOX_WITH_VUSB
215 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
216endif
217ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
218 VBoxVMM_SOURCES += \
219 VMMR3/PDMAsyncCompletion.cpp \
220 VMMR3/PDMAsyncCompletionFile.cpp \
221 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
222 VMMR3/PDMAsyncCompletionFileNormal.cpp
223endif
224ifdef VBOX_WITH_NETSHAPER
225 VBoxVMM_SOURCES += \
226 VMMR3/PDMNetShaper.cpp \
227 VMMAll/PDMAllNetShaper.cpp
228endif
229ifdef VBOX_WITH_REM
230 VBoxVMM_SOURCES += \
231 VMMAll/REMAll.cpp
232endif
233ifdef VBOX_WITH_RAW_MODE
234 VBoxVMM_SOURCES.x86 += \
235 VMMSwitcher/32BitTo32Bit.asm \
236 VMMSwitcher/32BitToPAE.asm \
237 VMMSwitcher/PAETo32Bit.asm \
238 VMMSwitcher/PAEToPAE.asm
239 VBoxVMM_SOURCES.amd64 = \
240 VMMSwitcher/AMD64To32Bit.asm \
241 VMMSwitcher/AMD64ToPAE.asm
242endif
243VBoxVMM_SOURCES.x86 += \
244 VMMSwitcher/32BitToAMD64.asm \
245 VMMSwitcher/PAEToAMD64.asm \
246 VMMSwitcher/X86Stub.asm
247VBoxVMM_SOURCES.amd64 += \
248 VMMSwitcher/AMD64Stub.asm
249
250ifdef VBOX_WITH_NATIVE_NEM
251 VBoxVMM_SOURCES.win.amd64 += VMMR3/NEMR3Native-win.cpp
252 VBoxVMM_DEFS.win.amd64 += VBOX_WITH_NATIVE_NEM
253 VBoxVMM_SDKS.win += VBOX_NTDLL
254 VMMR3/NEMR3Native-win.cpp_DEFS.amd64 = _AMD64_
255 VMMR3/NEMR3Native-win.cpp_INCS = \
256 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
257 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
258endif
259
260VBoxVMM_LIBS = \
261 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
262ifdef VBOX_WITH_DEBUGGER
263 VBoxVMM_LIBS += \
264 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
265endif
266VBoxVMM_LIBS += \
267 $(LIB_REM) \
268 $(LIB_RUNTIME)
269
270VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
271VBoxVMM_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED)
272VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
273VBoxVMM_LDFLAGS.solaris = -mimpure-text
274
275# SSM wish to know the build type, host os and arch.
276VMMR3/SSM.cpp_DEFS += \
277 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
278 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
279 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
280
281ifdef VBOX_WITH_GCC_SANITIZER
282 VMMR3/PGMPool.cpp_CXXFLAGS.linux += -fno-sanitize=address
283endif
284
285#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
286# ifeq ($(KBUILD_HOST), linux)
287#VBoxVMM_LIBS += aio
288# endif
289#endif
290
291if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
292 VBoxVMM_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
293 VBoxVMM_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
294 VBoxVMM_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
295 VBoxVMM_VMMAll/PDMAllCritSect.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
296endif
297
298$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
299
300
301#
302# Generate macro template for IEM instruction statistics.
303#
304$(call KB_FN_DO_PASS0_ON_TARGET,VBoxVMM) # Set VBoxVMM_0_OUTDIR
305VBoxVMM_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
306VBoxVMM_CLEAN += \
307 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
308 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
309$(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts)
310$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
311+| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h: \
312 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructions.cpp.h \
313 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsOneByte.cpp.h \
314 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h \
315 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsThree0f38.cpp.h \
316 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsThree0f3a.cpp.h \
317 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap1.cpp.h \
318 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap2.cpp.h \
319 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap3.cpp.h \
320 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructions3DNow.cpp.h
321 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,VMMAll/IEMAllInstructions*.cpp.h)
322 $(QUIET)$(RM) -f -- "[email protected]" "[email protected]" "[email protected]"
323 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
324 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
325 $(QUIET)$(SED) \
326 -e '/IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/!d' \
327 -e ':look-for-end-of-invocation' \
328 -e '/)/bend-of-invocation' \
329 -e 'N' \
330 -e 'blook-for-end-of-invocation' \
331 -e ':end-of-invocation' \
332 -e 's/\n/ /g' \
333 -e 's/ */ /g' \
334 -e 's/^.*IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/IEM_DO_INSTR_STAT\1(/' \
335 -e 's/;.*$(DOLLAR)//' \
336 --output "[email protected]" $(filter %.cpp.h,$^)
337# Windows sort does some kind of seeking. So, we must use a temporary file and kmk_cat to define and undefine our macros.
338 $(QUIET)$(REDIRECT) -wto "[email protected]" -- sort "[email protected]"
339 $(QUIET)$(APPEND) -nt "$@" \
340 '/* Warning autogenerated by VMM/Makefile.kmk. */ ' \
341 '#define IEM_DO_INSTR_STAT0(f,u,l,fd,fi) IEM_DO_INSTR_STAT(l, #l)' \
342 '#define IEM_DO_INSTR_STAT1(f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1, #l " " #o1)' \
343 '#define IEM_DO_INSTR_STAT2(f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2, #l " " #o1 "," #o2)' \
344 '#define IEM_DO_INSTR_STAT3(f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3, #l " " #o1 "," #o2 "," #o3)' \
345 '#define IEM_DO_INSTR_STAT4(f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3 ## _ ## o4, #l " " #o1 "," #o2 "," #o3 "," #o4)' \
346 '#define IEM_DO_INSTR_STAT0EX(s,m,f,u,l,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
347 '#define IEM_DO_INSTR_STAT1EX(s,m,f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
348 '#define IEM_DO_INSTR_STAT2EX(s,m,f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
349 '#define IEM_DO_INSTR_STAT3EX(s,m,f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
350 '#define IEM_DO_INSTR_STAT4EX(s,m,f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
351 ''
352 $(QUIET)$(REDIRECT) -ato "$@" -- $(CAT_EXT) "[email protected]"
353 $(QUIET)$(APPEND) -n "$@" \
354 '' \
355 '#undef IEM_DO_INSTR_STAT0' \
356 '#undef IEM_DO_INSTR_STAT1' \
357 '#undef IEM_DO_INSTR_STAT2' \
358 '#undef IEM_DO_INSTR_STAT3' \
359 '#undef IEM_DO_INSTR_STAT4' \
360 '#undef IEM_DO_INSTR_STAT0EX' \
361 '#undef IEM_DO_INSTR_STAT1EX' \
362 '#undef IEM_DO_INSTR_STAT2EX' \
363 '#undef IEM_DO_INSTR_STAT3EX' \
364 '#undef IEM_DO_INSTR_STAT4EX' \
365 ''
366 $(QUIET)$(RM) -f -- "[email protected]" "[email protected]"
367 $(QUIET)$(CP) -v -f --changed -- "$@" "$(patsubst %.ts,%,$@)"
368
369foobar: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
370
371if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
372 #
373 # Debug type info hack for VMCPU, VM and similar.
374 #
375 # The microsoft linker seems to be using the last occurence of the structures
376 # when writing the module PDB file. So, we put the fully complete structures
377 # in a library which is at the end of the library list.
378 #
379 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
380 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
381
382 LIBRARIES += VBoxVMMPdbTypeHack
383 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
384 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
385 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
386 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
387 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
388 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
389 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
390 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
391endif
392
393
394if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
395
396 #
397 # VMMRCBuiltin.lib
398 #
399 LIBRARIES += VMMRCBuiltin
400 VMMRCBuiltin_TEMPLATE = VBoxRc
401 ifeq ($(VBOX_LDR_FMT32),pe)
402 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
403 endif
404 ifeq ($(VBOX_LDR_FMT32),lx)
405 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
406 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
407 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
408 endif
409
410
411 #
412 # VMMRCImp.lib
413 #
414 LIBRARIES += VMMRCImp
415 VMMRCImp_TEMPLATE = VBoxRc
416 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
417 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
418 $(call KB_FN_DO_PASS0_ON_TARGET,VMMRCImp)
419
420 $(call KB_FN_AUTO_CMD_DEPS,$(VMMRCImp_0_OUTDIR)/VMMRC.def)
421 $(VMMRCImp_0_OUTDIR)/VMMRC.def: $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def | $$(dir $$@)
422 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
423 ifeq ($(VBOX_LDR_FMT32),lx)
424 $(SED) \
425 -e '/not-os2/d' \
426 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
427 -e 's/[ \t]DATA[ \t]*/ /' \
428 --output $@ \
429 $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def
430 $(APPEND) "$@" ""
431 $(APPEND) "$@" " ___ehInit"
432 else
433 $(SED) \
434 -e '/not-win/d' \
435 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
436 --output $@ $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def
437 endif
438
439endif # RC && (pe || lx)
440
441
442if1of ($(VBOX_LDR_FMT), pe lx)
443 #
444 # VMMR0Imp.lib
445 #
446 LIBRARIES += VMMR0Imp
447 VMMR0Imp_TEMPLATE = VBoxR0
448 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
449 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
450 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
451 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
452 endif
453 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR0Imp)
454
455 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR0Imp_0_OUTDIR)/VMMR0.def)
456 $(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def | $$(dir $$@)
457 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
458 ifeq ($(VBOX_LDR_FMT),lx)
459 $(SED) \
460 -e '/not-os2/d' \
461 -e '/not-amd64/d' \
462 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
463 -e 's/[ \t]DATA[ \t]*/ /' \
464 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
465 $(APPEND) "$@" ""
466 $(APPEND) "$@" " ___ehInit"
467 else
468 $(SED) \
469 -e '/not-win/d' \
470 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
471 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
472 endif
473endif # R0: pe + lx
474
475
476#
477# VMMR3Imp.lib
478#
479IMPORT_LIBS += VMMR3Imp
480$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
481
482ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
483 #
484 # VMMR3LazyImp.lib (experimental)
485 #
486 LIBRARIES += VMMR3LazyImp
487 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
488 VMMR3LazyImp_INST = $(INST_LIB)
489 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
490 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
491 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR3LazyImp)
492
493 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm)
494 $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(VMMR3LazyImp_DEFPATH)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
495 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
496 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $(VMMR3LazyImp_DEFPATH)/VMMR3/VMMR3.def
497endif
498
499
500if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
501 #
502 # VMMRC.rc
503 #
504 SYSMODS += VMMRC
505 VMMRC_TEMPLATE = VBoxRc
506 VMMRC_NAME = VMMRC
507
508 VMMRC_DEFS = IN_VMM_RC IN_RT_RC IN_DIS DIS_CORE_ONLY VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0 IN_SUP_RC \
509 $(VMM_COMMON_DEFS)
510 VMMRC_DEFS := $(filter-out VBOX_WITH_NESTED_HWVIRT_SVM,$(VMMRC_DEFS))
511 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
512 VMMRC_DEFS += VMM_R0_SWITCH_STACK
513 endif
514
515 VMMRC_INCS = \
516 include \
517 VMMRC \
518 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
519 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
520
521 VMMRC_LIBS = \
522 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
523 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
524 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
525 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
526 VMMRC_LIBS += \
527 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
528 endif
529
530 VMMRC_SOURCES = \
531 VBoxVMM.d \
532 VMMRC/VMMRC0.asm \
533 VMMRC/VMMRCDeps.cpp \
534 VMMRC/CPUMRC.cpp \
535 VMMRC/CPUMRCA.asm \
536 VMMRC/CPUMRCPatchHlp.asm \
537 VMMRC/EMRCA.asm \
538 VMMRC/IOMRC.cpp \
539 VMMRC/MMRamRC.cpp \
540 VMMRC/MMRamRCA.asm \
541 VMMRC/PDMRCDevice.cpp \
542 VMMRC/PGMRC.cpp \
543 VMMRC/SELMRC.cpp \
544 VMMRC/TRPMRC.cpp \
545 VMMRC/TRPMRCHandlers.cpp \
546 VMMRC/TRPMRCHandlersA.asm \
547 VMMRC/VMMRC.cpp \
548 VMMRC/VMMRCA.asm \
549 $(if-expr defined(VBOX_WITH_RAW_MODE), \
550 VMMRC/CSAMRC.cpp \
551 VMMRC/PATMRC.cpp \
552 ,) \
553 VMMRZ/CPUMRZ.cpp \
554 VMMRZ/CPUMRZA.asm \
555 VMMRZ/DBGFRZ.cpp \
556 VMMRZ/PGMRZDynMap.cpp \
557 VMMRZ/VMMRZ.cpp \
558 VMMAll/APICAll.cpp \
559 VMMAll/CPUMAllRegs.cpp \
560 VMMAll/CPUMAllMsrs.cpp \
561 VMMAll/DBGFAll.cpp \
562 VMMAll/IEMAll.cpp \
563 VMMAll/IEMAllAImpl.asm \
564 VMMAll/IEMAllAImplC.cpp \
565 VMMAll/IOMAll.cpp \
566 VMMAll/IOMAllMMIO.cpp \
567 VMMAll/EMAll.cpp \
568 VMMAll/FTMAll.cpp \
569 VMMAll/GIMAll.cpp \
570 VMMAll/GIMAllHv.cpp \
571 VMMAll/GIMAllKvm.cpp \
572 VMMAll/HMAll.cpp \
573 VMMAll/HMSVMAll.cpp \
574 VMMAll/MMAll.cpp \
575 VMMAll/MMAllHyper.cpp \
576 VMMAll/PDMAll.cpp \
577 VMMAll/PDMAllCritSect.cpp \
578 VMMAll/PDMAllCritSectRw.cpp \
579 VMMAll/PDMAllCritSectBoth.cpp \
580 VMMAll/PDMAllQueue.cpp \
581 VMMAll/PGMAll.cpp \
582 VMMAll/PGMAllHandler.cpp \
583 VMMAll/PGMAllMap.cpp \
584 VMMAll/PGMAllPhys.cpp \
585 VMMAll/PGMAllPool.cpp \
586 VMMAll/SELMAll.cpp \
587 VMMAll/TMAll.cpp \
588 VMMAll/TMAllCpu.cpp \
589 VMMAll/TMAllReal.cpp \
590 VMMAll/TMAllVirtual.cpp \
591 VMMAll/TRPMAll.cpp \
592 VMMAll/VMAll.cpp \
593 VMMAll/VMMAll.cpp \
594 VMMAll/VMMAllA.asm \
595 $(if-expr defined(VBOX_WITH_RAW_MODE), \
596 VMMAll/CSAMAll.cpp \
597 VMMAll/PATMAll.cpp \
598 ,)
599 ifeq ($(VBOX_LDR_FMT32),pe)
600 VMMRC_SOURCES += VMMRC/VMMRC.def
601 endif
602 ifeq ($(VBOX_LDR_FMT32),lx)
603 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
604 endif
605 ifdef VBOX_WITH_REM
606 VMMRC_SOURCES += \
607 VMMAll/REMAll.cpp
608 endif
609
610 # The very last one.
611 VMMRC_SOURCES += \
612 VMMRC/VMMRC99.asm
613
614 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
615
616 $(call VBOX_SET_VER_INFO_RC,VMMRC,VirtualBox VMM - raw-mode context parts) # Version info / description.
617
618 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
619 VMMRC_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
620 VMMRC_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
621 VMMRC_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
622 endif
623
624 VMMRC_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
625
626 if "$(KBUILD_TARGET)" == "win"
627 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
628 VMMRC_LIBS += $(VMMRCPdbTypeHack_1_TARGET)
629 VMMRC_LDFLAGS += /Export:PdbTypeHack
630
631 LIBRARIES += VMMRCPdbTypeHack
632 VMMRCPdbTypeHack_TEMPLATE = $(VMMRC_TEMPLATE)
633 VMMRCPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
634 VMMRCPdbTypeHack_DEFS = $(VMMRC_DEFS)
635 VMMRCPdbTypeHack_DEFS.win = $(VMMRC_DEFS.win)
636 VMMRCPdbTypeHack_DEFS.win.x86 = $(VMMRC_DEFS.win.x86)
637 VMMRCPdbTypeHack_DEFS.win.amd64 = $(VMMRC_DEFS.win.amd64)
638 VMMRCPdbTypeHack_INCS = $(VMMRC_INCS)
639 VMMRCPdbTypeHack_INTERMEDIATES = $(VMMRC_INTERMEDIATES)
640 endif
641
642endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
643
644
645ifndef VBOX_ONLY_EXTPACKS
646 #
647 # VMMR0.r0
648 #
649 SYSMODS += VMMR0
650 VMMR0_TEMPLATE = VBoxR0
651 VMMR0_SYSSUFF = .r0
652
653 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
654 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
655 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
656 ifdef VBOX_WITH_PCI_PASSTHROUGH
657 VMMR0_DEFS += IN_PCIRAW_R0
658 endif
659 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
660 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
661 endif
662 ifdef VBOX_WITH_RAW_MODE
663 VMMR0_DEFS += VBOX_WITH_RAW_MODE
664 endif
665 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
666 VMMR0_DEFS += VMM_R0_SWITCH_STACK
667 endif
668 if1of ($(KBUILD_TARGET), darwin linux win)
669 VMMR0_DEFS += VMM_R0_TOUCH_FPU
670 endif
671 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
672 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
673
674 ifeq ($(VBOX_LDR_FMT),elf)
675 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
676 endif
677
678 VMMR0_INCS = \
679 include \
680 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
681 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
682
683 VMMR0_SOURCES = \
684 VBoxVMM.d \
685 VMMR0/CPUMR0.cpp \
686 VMMR0/CPUMR0A.asm \
687 VMMR0/GIMR0.cpp \
688 VMMR0/GIMR0Hv.cpp \
689 VMMR0/GIMR0Kvm.cpp \
690 VMMR0/GMMR0.cpp \
691 VMMR0/GVMMR0.cpp \
692 VMMR0/EMR0.cpp \
693 VMMR0/HMR0.cpp \
694 VMMR0/HMR0A.asm \
695 VMMR0/HMVMXR0.cpp \
696 VMMR0/HMSVMR0.cpp \
697 VMMR0/PDMR0Device.cpp \
698 VMMR0/PDMR0Driver.cpp \
699 VMMR0/PGMR0.cpp \
700 VMMR0/PGMR0SharedPage.cpp \
701 VMMR0/TRPMR0.cpp \
702 VMMR0/TRPMR0A.asm \
703 VMMR0/VMMR0.cpp \
704 VMMRZ/CPUMRZ.cpp \
705 VMMRZ/CPUMRZA.asm \
706 VMMRZ/DBGFRZ.cpp \
707 VMMRZ/VMMRZ.cpp \
708 VMMAll/APICAll.cpp \
709 VMMAll/CPUMAllRegs.cpp \
710 VMMAll/CPUMAllMsrs.cpp \
711 VMMAll/CPUMStack.cpp \
712 VMMAll/DBGFAll.cpp \
713 VMMAll/EMAll.cpp \
714 VMMAll/FTMAll.cpp \
715 VMMAll/GIMAll.cpp \
716 VMMAll/GIMAllHv.cpp \
717 VMMAll/GIMAllKvm.cpp \
718 VMMAll/HMAll.cpp \
719 VMMAll/HMSVMAll.cpp \
720 VMMAll/IEMAll.cpp \
721 VMMAll/IEMAllAImpl.asm \
722 VMMAll/IEMAllAImplC.cpp \
723 VMMAll/IOMAll.cpp \
724 VMMAll/IOMAllMMIO.cpp \
725 VMMAll/MMAll.cpp \
726 VMMAll/MMAllHyper.cpp \
727 VMMAll/MMAllPagePool.cpp \
728 VMMAll/NEMAll.cpp \
729 VMMAll/PDMAll.cpp \
730 VMMAll/PDMAllCritSect.cpp \
731 VMMAll/PDMAllCritSectRw.cpp \
732 VMMAll/PDMAllCritSectBoth.cpp \
733 VMMAll/PDMAllQueue.cpp \
734 VMMAll/PGMAll.cpp \
735 VMMAll/PGMAllHandler.cpp \
736 VMMAll/PGMAllMap.cpp \
737 VMMAll/PGMAllPhys.cpp \
738 VMMAll/PGMAllPool.cpp \
739 VMMAll/SELMAll.cpp \
740 VMMAll/TMAll.cpp \
741 VMMAll/TMAllCpu.cpp \
742 VMMAll/TMAllReal.cpp \
743 VMMAll/TMAllVirtual.cpp \
744 VMMAll/TRPMAll.cpp \
745 VMMAll/VMAll.cpp \
746 VMMAll/VMMAll.cpp \
747 VMMAll/VMMAllA.asm
748 if1of ($(VBOX_LDR_FMT), pe lx)
749 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
750 endif
751 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
752 VMMR0_SOURCES += \
753 VMMR0/VMMR0TripleFaultHack.cpp \
754 VMMR0/VMMR0TripleFaultHackA.asm
755 endif
756 ifdef VBOX_WITH_NETSHAPER
757 VMMR0_SOURCES += \
758 VMMAll/PDMAllNetShaper.cpp
759 endif
760 ifdef VBOX_WITH_REM
761 VMMR0_SOURCES += \
762 VMMAll/REMAll.cpp
763 endif
764 VMMR0_SOURCES.amd64 = \
765 VMMR0/VMMR0JmpA-amd64.asm
766 VMMR0_SOURCES.x86 = \
767 VMMR0/VMMR0JmpA-x86.asm
768
769 VMMR0_LIBS = \
770 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
771 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
772 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
773 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
774 VMMR0_LIBS += \
775 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
776 endif
777 ifdef VBOX_WITH_NATIVE_NEM
778 VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-win.cpp
779 VMMR0_DEFS.win.amd64 += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
780 VMMR0/NEMR0Native-win.cpp_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
781 endif
782
783 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
784
785 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
786 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
787 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
788 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
789 endif
790
791 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
792
793 if "$(KBUILD_TARGET)" == "win"
794 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
795 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
796 VMMR0_LDFLAGS += /Export:PdbTypeHack
797
798 LIBRARIES += VMMR0PdbTypeHack
799 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
800 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
801 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
802 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
803 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
804 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
805 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
806 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
807 endif
808
809endif # !VBOX_ONLY_EXTPACKS
810
811
812
813ifndef VBOX_ONLY_EXTPACKS
814 #
815 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
816 #
817 LIBRARIES += SSMStandalone
818 SSMStandalone_TEMPLATE = VBOXR3EXE
819 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
820 SSMStandalone_INCS = include
821 SSMStandalone_SOURCES = \
822 VMMR3/SSM.cpp \
823 VMMR3/CPUMR3Db.cpp
824endif # !VBOX_ONLY_EXTPACKS
825
826
827if !defined(VBOX_ONLY_EXTPACKS) \
828 && ( defined(VBOX_WITH_DTRACE_R3) \
829 || defined(VBOX_WITH_DTRACE_R0) \
830 || defined(VBOX_WITH_DTRACE_RC))
831 #
832 # Install the dtrace library files.
833 #
834 INSTALLS += VMMLibDTrace
835 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
836 VMMLibDTrace_SOURCES = \
837 dtrace/lib/vbox-types.d \
838 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
839 $(VMMLibDTrace_0_OUTDIR)/vm.d \
840 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
841 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
842 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
843 $(VMMLibDTrace_0_OUTDIR)/x86.d
844 $(call KB_FN_DO_PASS0_ON_TARGET,VMMLibDTrace)
845
846
847 ##
848 # Turn the header $2 into the DTrace library script $1.
849 #
850 define def_vmm_lib_dtrace_preprocess
851 $$(call KB_FN_AUTO_CMD_DEPS,$$(VMMLibDTrace_0_OUTDIR)/$1)
852 $$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
853 $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
854 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$2)
855 $$(QUIET)$(VBOX_VBOXCPP) -d \
856 -D VBOX_FOR_DTRACE_LIB \
857 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
858 -D IN_RING0 \
859 -D RT_C_DECLS_BEGIN= \
860 -D RT_C_DECLS_END= \
861 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
862 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
863 -D 'R0PTRTYPE(a_Type)=a_Type' \
864 -D 'AssertCompile(a_Expr)=' \
865 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
866 -D 'bool=uint8_t' \
867 $$(foreach def,\
868 $$(DEFS) \
869 $$(DEFS.$$(KBUILD_TARGET)) \
870 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
871 $$(VMM_COMMON_DEFS) \
872 $$(ARCH_BITS_DEFS)\
873 ,-D '$$(def)') \
874 $2 \
875 $$@
876 $$(QUIET)$$(CHMOD) 644 $$@
877 endef
878 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
879 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
880 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
881 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
882 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
883
884endif
885
886
887
888#
889# For vmmGetSvnRev.
890#
891VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
892
893#
894# Disable annoying warnings about array subscript above array bounds in aPages[]
895#
896ifneq ($(KBUILD_TARGET),win)
897 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
898 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
899 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
900 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
901 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
902endif
903
904#
905# Always optimize the interpreter.
906#
907if $(USERNAME) != "bird" || "$(KBUILD_TYPE)" == "release" #|| "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64"
908 if1of ($(KBUILD_TARGET), win)
909 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
910 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
911 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
912 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
913 else
914 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
915 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
916 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
917 VMMAll/IEMAll.cpp_CXXFLAGS += -fomit-frame-pointer # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
918 endif
919endif # bird wants good stacks
920
921
922# Alias the CPU database entries.
923$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
924
925
926#
927# Process python source(s).
928#
929BLDDIRS += $(PATH_TARGET)/pylint
930
931define def_vbox_vmm_py_check
932$(eval name:=$(basename $(notdir $(py))))
933
934pylint:: $(name)-py-phony.o
935$(name).o: $(name)-py-phony.o
936$(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
937ifdef VBOX_WITH_PYLINT
938 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
939 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -- \
940 $(VBOX_PYLINT) --rcfile=$(PATH_TARGET)/no-such-pylintrc \
941 $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
942endif
943 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
944
945TESTING += $(name)-py-phony.o
946endef # def_vbox_vmm_py_check
947
948$(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstructionsPython.py ) , $(eval $(def_vbox_vmm_py_check)))
949
950
951#
952# Test for undefined symbols.
953#
954if1of ($(SYSMODS),VMMRC)
955 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
956 OTHERS += $(PATH_TARGET)/undef-rc.run
957 CLEANS += $(PATH_TARGET)/undef-rc.run
958 $(call KB_FN_AUTO_CMD_DEPS,$(PATH_TARGET)/undef-rc.run)
959 $(PATH_TARGET)/undef-rc.run: $$(VMMRC_1_TARGET)
960 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
961 ifn1of ($(KBUILD_TARGET), linux solaris)
962 else
963 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
964 $(QUIET)$(VBOX_NM) $(VMMRC_1_TARGET) 2> /dev/null \
965 | $(SED) -n \
966 -e '/^ *U .*/!d' \
967 -e 's/ *U //' \
968 \
969 -e '/^g_VM\>/d'\
970 -e '/^g_CPUM\>/d'\
971 -e '/^g_Logger\>/d'\
972 -e '/^g_RelLogger\>/d'\
973 -e '/^g_TRPM\>/d'\
974 -e '/^g_TRPMCPU\>/d'\
975 -e '/^g_pSUPGlobalInfoPage\>/d'\
976 -e '/^g_trpmHyperCtxCore\>/d' \
977 -e '/^g_trpmGuestCtxCore\>/d' \
978 \
979 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
980 -e 'p' \
981 -e 'q 1'
982 endif
983 $(QUIET)$(APPEND) -t $@
984endif
985
986include $(FILE_KBUILD_SUB_FOOTER)
987
988
989# Alias the PGM templates to the object in which they are defined.
990PGMInternal.o: PGM.o
991
992PGMAllBth.o PGMAllGst.o PGMAllShw.o \
993PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
994
995PGMRCBth.o PGMRCGst.o PGMRCShw.o \
996PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
997
998PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
999
1000PGMInline.o PGMInline.obj: PGMDbg.o
1001
1002# Alias the IEM templates to the object in which they are instantiated.
1003IEMInternal.o \
1004IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
1005IEMAllInstructionsOneByte.cpp.o IEMAllInstructionsOneByte.cpp.obj \
1006IEMAllInstructionsTwoByte0f.cpp.o IEMAllInstructionsTwoByte0f.cpp.obj \
1007IEMAllInstructionsThree0f38.cpp.o IEMAllInstructionsThree0f38.cpp.obj \
1008IEMAllInstructionsThree0f3a.cpp.o IEMAllInstructionsThree0f3a.cpp.obj \
1009IEMAllInstructionsVexMap1.cpp.o IEMAllInstructionsVexMap1.cpp.obj \
1010IEMAllInstructionsVexMap2.cpp.o IEMAllInstructionsVexMap2.cpp.obj \
1011IEMAllInstructionsVexMap3.cpp.o IEMAllInstructionsVexMap3.cpp.obj \
1012IEMAllInstructions3DNow.cpp.o IEMAllInstructions3DNow.cpp.obj \
1013IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
1014IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj \
1015IEMAllCImplSvmInstr.cpp.o IEMAllCImplSvmInstr.cpp.obj \
1016IEMAllCImplVmxInstr.cpp.o IEMAllCImplVmxInstr.cpp.obj: IEMAll.o
1017
1018# Alias the NEM template to the objects where it is used:
1019NEMAllNativeTemplate-win.cpp.o: NEMR3Native-win.o NEMR0Native-win.o
1020
1021# Alias the switcher templates.
1022PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
1023LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
1024AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
1025
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