VirtualBox

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

Last change on this file since 70954 was 70954, checked in by vboxsync, 7 years ago

NEM: Working on PGM notifications. bugref:9044

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