VirtualBox

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

Last change on this file since 54647 was 54385, checked in by vboxsync, 10 years ago

PDM/Audio: Ignore old AudioSniffer device when loading older saved states.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.0 KB
Line 
1# $Id: Makefile.kmk 54385 2015-02-23 15:21:50Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
4#
5
6#
7# Copyright (C) 2006-2015 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#
29# Globals
30#
31
32## DEFS variable that is picked up by all three VMM targets.
33# Can be prepended to by setting it in LocalConfig.kmk
34VMM_COMMON_DEFS ?= VBOX_IN_VMM
35ifdef VBOX_WITH_FIRST_IEM_STEP
36 VMM_COMMON_DEFS += VBOX_WITH_FIRST_IEM_STEP
37endif
38#ifdef VBOX_WITH_IEM
39# VMM_COMMON_DEFS += VBOX_WITH_IEM
40#endif
41ifdef VBOX_WITH_REM
42 VMM_COMMON_DEFS += VBOX_WITH_REM
43endif
44ifdef VBOX_WITH_MULTI_CORE
45 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
46endif
47ifdef VBOX_WITH_R0_LOGGING
48 VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
49endif
50ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
51 VMM_COMMON_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
52endif
53ifdef VBOX_WITH_PCI_PASSTHROUGH
54 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
55endif
56ifdef VBOX_WITH_DTRACE_RC
57 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
58endif
59ifdef VBOX_WITH_SAFE_STR
60 VMM_COMMON_DEFS += VBOX_WITH_SAFE_STR
61endif
62ifdef VBOX_WITH_RAW_RING1
63 VMM_COMMON_DEFS += VBOX_WITH_RAW_RING1
64endif
65ifdef VBOX_WITH_64ON32_IDT
66 VMM_COMMON_DEFS += VBOX_WITH_64ON32_IDT
67endif
68ifdef VBOX_WITH_64ON32_CMOS_DEBUG
69 VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG
70endif
71
72# VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
73
74# Special IEM debug mode which compares the result with HM/REM
75ifdef IEM_VERIFICATION_MODE
76 VMM_COMMON_DEFS += IEM_VERIFICATION_MODE IEM_VERIFICATION_MODE_FULL IEM_VERIFICATION_MODE_FULL_HM
77endif
78
79
80#
81# The VMM DLL.
82#
83ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
84 DLLS += VBoxVMM
85endif
86VBoxVMM_TEMPLATE = VBoxR3DllNoPic
87VBoxVMM_SONAME.linux = VBoxVMM.so
88
89VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
90## @todo eliminate IN_GMM_R3
91ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
92 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
93endif
94ifdef VBOX_WITH_VUSB
95 VBoxVMM_DEFS += VBOX_WITH_USB
96endif
97ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
98 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
99endif
100ifdef VBOX_WITH_NETSHAPER
101 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
102endif
103ifdef VBOX_WITH_RAW_MODE
104 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
105endif
106ifdef VBOX_WITH_PDM_AUDIO_DRIVER
107 VBoxVMM_DEFS += VBOX_WITH_PDM_AUDIO_DRIVER
108endif
109ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
110 VBoxVMM_DEFS += VMM_R0_SWITCH_STACK
111endif
112VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
113VBoxVMM_DEFS.darwin.x86 = \
114 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
115 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
116
117VBoxVMM_INCS = \
118 include \
119 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
120VBoxVMM_ASINCS = .
121
122VBoxVMM_SOURCES = \
123 VBoxVMM.d \
124 VMMR3/CFGM.cpp \
125 VMMR3/CPUM.cpp \
126 VMMR3/CPUMR3CpuId.cpp \
127 VMMR3/CPUMR3Db.cpp \
128 VMMR3/CPUMDbg.cpp \
129 VMMR3/DBGF.cpp \
130 VMMR3/DBGFAddr.cpp \
131 VMMR3/DBGFAddrSpace.cpp \
132 VMMR3/DBGFBp.cpp \
133 VMMR3/DBGFCoreWrite.cpp \
134 VMMR3/DBGFCpu.cpp \
135 VMMR3/DBGFDisas.cpp \
136 VMMR3/DBGFInfo.cpp \
137 VMMR3/DBGFLog.cpp \
138 VMMR3/DBGFMem.cpp \
139 VMMR3/DBGFOS.cpp \
140 VMMR3/DBGFReg.cpp \
141 VMMR3/DBGFStack.cpp \
142 VMMR3/DBGFR3Trace.cpp \
143 VMMR3/EM.cpp \
144 VMMR3/EMR3Dbg.cpp \
145 $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
146 VMMR3/EMHM.cpp \
147 VMMR3/FTM.cpp \
148 VMMR3/GIM.cpp \
149 VMMR3/GIMHv.cpp \
150 VMMR3/GIMMinimal.cpp \
151 VMMR3/IEMR3.cpp \
152 VMMR3/IOM.cpp \
153 VMMR3/GMM.cpp \
154 VMMR3/MM.cpp \
155 VMMR3/MMHeap.cpp \
156 VMMR3/MMHyper.cpp \
157 VMMR3/MMPagePool.cpp \
158 VMMR3/MMUkHeap.cpp \
159 VMMR3/PDM.cpp \
160 VMMR3/PDMBlkCache.cpp \
161 VMMR3/PDMDevice.cpp \
162 VMMR3/PDMDevHlp.cpp \
163 VMMR3/PDMDevMiscHlp.cpp \
164 VMMR3/PDMDriver.cpp \
165 VMMR3/PDMLdr.cpp \
166 VMMR3/PDMCritSect.cpp \
167 VMMR3/PDMQueue.cpp \
168 VMMR3/PDMThread.cpp \
169 VMMR3/PGM.cpp \
170 VMMR3/PGMDbg.cpp \
171 VMMR3/PGMHandler.cpp \
172 VMMR3/PGMMap.cpp \
173 VMMR3/PGMPhys.cpp \
174 VMMR3/PGMPool.cpp \
175 VMMR3/PGMSavedState.cpp \
176 VMMR3/PGMSharedPage.cpp \
177 VMMR3/SELM.cpp \
178 VMMR3/SSM.cpp \
179 VMMR3/STAM.cpp \
180 VMMR3/TM.cpp \
181 VMMR3/TRPM.cpp \
182 VMMR3/VM.cpp \
183 VMMR3/VMEmt.cpp \
184 VMMR3/VMReq.cpp \
185 VMMR3/VMM.cpp \
186 VMMR3/VMMGuruMeditation.cpp \
187 VMMR3/VMMSwitcher.cpp \
188 VMMR3/VMMTests.cpp \
189 VMMR3/HM.cpp \
190 $(if-expr defined(VBOX_WITH_RAW_MODE), \
191 VMMR3/CSAM.cpp \
192 VMMR3/PATM.cpp \
193 VMMR3/PATMPatch.cpp \
194 VMMR3/PATMGuest.cpp \
195 VMMR3/PATMA.asm \
196 VMMR3/PATMSSM.cpp \
197 VMMR3/PATMR3Dbg.cpp \
198 ,) \
199 VMMAll/CPUMAllRegs.cpp \
200 VMMAll/CPUMAllMsrs.cpp \
201 VMMAll/CPUMStack.cpp \
202 VMMAll/DBGFAll.cpp \
203 VMMAll/HMAll.cpp \
204 VMMAll/IEMAll.cpp \
205 VMMAll/IEMAllAImpl.asm \
206 VMMAll/IEMAllAImplC.cpp \
207 VMMAll/IOMAll.cpp \
208 VMMAll/IOMAllMMIO.cpp \
209 VMMAll/MMAll.cpp \
210 VMMAll/MMAllHyper.cpp \
211 VMMAll/MMAllPagePool.cpp \
212 VMMAll/PDMAll.cpp \
213 VMMAll/PDMAllCritSect.cpp \
214 VMMAll/PDMAllCritSectRw.cpp \
215 VMMAll/PDMAllCritSectBoth.cpp \
216 VMMAll/PDMAllQueue.cpp \
217 VMMAll/PGMAll.cpp \
218 VMMAll/PGMAllHandler.cpp \
219 VMMAll/PGMAllMap.cpp \
220 VMMAll/PGMAllPhys.cpp \
221 VMMAll/PGMAllPool.cpp \
222 VMMAll/REMAll.cpp \
223 VMMAll/SELMAll.cpp \
224 VMMAll/EMAll.cpp \
225 VMMAll/EMAllA.asm \
226 VMMAll/FTMAll.cpp \
227 VMMAll/GIMAll.cpp \
228 VMMAll/GIMAllHv.cpp \
229 VMMAll/TMAll.cpp \
230 VMMAll/TMAllCpu.cpp \
231 VMMAll/TMAllReal.cpp \
232 VMMAll/TMAllVirtual.cpp \
233 VMMAll/TRPMAll.cpp \
234 VMMAll/VMAll.cpp \
235 VMMAll/VMMAll.cpp \
236 VMMAll/VMMAllA.asm \
237 $(if-expr defined(VBOX_WITH_RAW_MODE), \
238 VMMAll/CSAMAll.cpp \
239 VMMAll/PATMAll.cpp \
240 ,)
241ifdef VBOX_WITH_VUSB
242 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
243endif
244ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
245 VBoxVMM_SOURCES += \
246 VMMR3/PDMAsyncCompletion.cpp \
247 VMMR3/PDMAsyncCompletionFile.cpp \
248 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
249 VMMR3/PDMAsyncCompletionFileNormal.cpp
250endif
251ifdef VBOX_WITH_NETSHAPER
252 VBoxVMM_SOURCES += \
253 VMMR3/PDMNetShaper.cpp \
254 VMMAll/PDMAllNetShaper.cpp
255endif
256
257ifdef VBOX_WITH_RAW_MODE
258 VBoxVMM_SOURCES.x86 += \
259 VMMSwitcher/32BitTo32Bit.asm \
260 VMMSwitcher/32BitToPAE.asm \
261 VMMSwitcher/PAETo32Bit.asm \
262 VMMSwitcher/PAEToPAE.asm
263 VBoxVMM_SOURCES.amd64 = \
264 VMMSwitcher/AMD64To32Bit.asm \
265 VMMSwitcher/AMD64ToPAE.asm
266 VBoxVMM_SOURCES.darwin.x86 += \
267 VMMSwitcher/AMD64ToPAE.asm
268endif
269VBoxVMM_SOURCES.x86 += \
270 VMMSwitcher/32BitToAMD64.asm \
271 VMMSwitcher/PAEToAMD64.asm \
272 VMMSwitcher/X86Stub.asm
273VBoxVMM_SOURCES.amd64 += \
274 VMMSwitcher/AMD64Stub.asm
275VBoxVMM_SOURCES.win += \
276 VMMR3/VMMR3.rc
277
278VBoxVMM_LIBS = \
279 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
280ifdef VBOX_WITH_DEBUGGER
281 VBoxVMM_LIBS += \
282 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
283endif
284VBoxVMM_LIBS += \
285 $(LIB_REM) \
286 $(LIB_RUNTIME)
287
288VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
289VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
290VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
291VBoxVMM_LDFLAGS.solaris = -mimpure-text
292
293# SSM wish to know the build type, host os and arch.
294VMMR3/SSM.cpp_DEFS += \
295 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
296 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
297 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
298
299
300#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
301# ifeq ($(KBUILD_HOST), linux)
302#VBoxVMM_LIBS += aio
303# endif
304#endif
305
306
307if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
308
309 #
310 # VMMRCBuiltin.lib
311 #
312 LIBRARIES += VMMRCBuiltin
313 VMMRCBuiltin_TEMPLATE = VBoxRc
314 ifeq ($(VBOX_LDR_FMT32),pe)
315 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
316 endif
317 ifeq ($(VBOX_LDR_FMT32),lx)
318 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
319 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
320 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
321 endif
322
323
324 #
325 # VMMRCImp.lib
326 #
327 LIBRARIES += VMMRCImp
328 VMMRCImp_TEMPLATE = VBoxRc
329 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
330 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
331
332 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
333 ifeq ($(VBOX_LDR_FMT32),lx)
334 $(SED) \
335 -e '/not-os2/d' \
336 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
337 -e 's/[ \t]DATA[ \t]*/ /' \
338 --output $@ \
339 $<
340 $(APPEND) "$@" ""
341 $(APPEND) "$@" " ___ehInit"
342 else
343 $(SED) \
344 -e '/not-win/d' \
345 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
346 --output $@ $<
347 endif
348
349endif # RC && (pe || lx)
350
351
352if1of ($(VBOX_LDR_FMT), pe lx)
353 #
354 # VMMR0Imp.lib
355 #
356 LIBRARIES += VMMR0Imp
357 VMMR0Imp_TEMPLATE = VBoxR0
358 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
359 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
360
361 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
362 ifeq ($(VBOX_LDR_FMT),lx)
363 $(SED) \
364 -e '/not-os2/d' \
365 -e '/not-amd64/d' \
366 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
367 -e 's/[ \t]DATA[ \t]*/ /' \
368 --output $@ $<
369 $(APPEND) "$@" ""
370 $(APPEND) "$@" " ___ehInit"
371 else
372 $(SED) \
373 -e '/not-win/d' \
374 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
375 --output $@ $<
376 endif
377endif # R0: pe + lx
378
379
380#
381# VMMR3Imp.lib
382#
383IMPORT_LIBS += VMMR3Imp
384$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
385
386ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
387 #
388 # VMMR3LazyImp.lib (experimental)
389 #
390 LIBRARIES += VMMR3LazyImp
391 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
392 VMMR3LazyImp_INST = $(INST_LIB)
393 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
394 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
395 $$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(PATH_SUB_CURRENT)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
396 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $<
397endif
398
399
400if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
401 #
402 # VMMRC.gc
403 #
404 SYSMODS += VMMRC
405 VMMRC_TEMPLATE = VBoxRc
406 VMMRC_NAME = VMMGC
407 VMMRC_SYSSUFF = .gc
408
409 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 \
410 $(VMM_COMMON_DEFS)
411 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
412 VMMRC_DEFS += VMM_R0_SWITCH_STACK
413 endif
414 ifeq ($(KBUILD_TARGET_ARCH),x86)
415 VMMRC_DEFS.darwin = VMM_R0_SWITCH_STACK
416 VMMRC_DEFS.darwin = \
417 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
418 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
419 endif
420
421 VMMRC_INCS := \
422 include \
423 VMMRC \
424 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
425
426 VMMRC_LIBS = \
427 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
428 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
429 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
430 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
431 VMMRC_LIBS += \
432 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
433 endif
434
435 VMMRC_SOURCES = \
436 VBoxVMM.d \
437 VMMRC/VMMRC0.asm \
438 VMMRC/VMMRCDeps.cpp \
439 VMMRC/CPUMRC.cpp \
440 VMMRC/CPUMRCA.asm \
441 VMMRC/EMRCA.asm \
442 VMMRC/IOMRC.cpp \
443 VMMRC/MMRamRC.cpp \
444 VMMRC/MMRamRCA.asm \
445 VMMRC/PDMRCDevice.cpp \
446 VMMRC/PGMRC.cpp \
447 VMMRC/SELMRC.cpp \
448 VMMRC/TRPMRC.cpp \
449 VMMRC/TRPMRCHandlers.cpp \
450 VMMRC/TRPMRCHandlersA.asm \
451 VMMRC/VMMRC.cpp \
452 VMMRC/VMMRCA.asm \
453 $(if-expr defined(VBOX_WITH_RAW_MODE), \
454 VMMRC/CSAMRC.cpp \
455 VMMRC/PATMRC.cpp \
456 ,) \
457 VMMRZ/DBGFRZ.cpp \
458 VMMRZ/PGMRZDynMap.cpp \
459 VMMRZ/VMMRZ.cpp \
460 VMMAll/CPUMAllRegs.cpp \
461 VMMAll/CPUMAllMsrs.cpp \
462 VMMAll/DBGFAll.cpp \
463 VMMAll/IEMAll.cpp \
464 VMMAll/IEMAllAImpl.asm \
465 VMMAll/IEMAllAImplC.cpp \
466 VMMAll/IOMAll.cpp \
467 VMMAll/IOMAllMMIO.cpp \
468 VMMAll/EMAll.cpp \
469 VMMAll/EMAllA.asm \
470 VMMAll/FTMAll.cpp \
471 VMMAll/GIMAll.cpp \
472 VMMAll/GIMAllHv.cpp \
473 VMMAll/MMAll.cpp \
474 VMMAll/MMAllHyper.cpp \
475 VMMAll/PDMAll.cpp \
476 VMMAll/PDMAllCritSect.cpp \
477 VMMAll/PDMAllCritSectRw.cpp \
478 VMMAll/PDMAllCritSectBoth.cpp \
479 VMMAll/PDMAllQueue.cpp \
480 VMMAll/PGMAll.cpp \
481 VMMAll/PGMAllHandler.cpp \
482 VMMAll/PGMAllMap.cpp \
483 VMMAll/PGMAllPhys.cpp \
484 VMMAll/PGMAllPool.cpp \
485 VMMAll/REMAll.cpp \
486 VMMAll/SELMAll.cpp \
487 VMMAll/TMAll.cpp \
488 VMMAll/TMAllCpu.cpp \
489 VMMAll/TMAllReal.cpp \
490 VMMAll/TMAllVirtual.cpp \
491 VMMAll/TRPMAll.cpp \
492 VMMAll/VMAll.cpp \
493 VMMAll/VMMAll.cpp \
494 VMMAll/VMMAllA.asm \
495 $(if-expr defined(VBOX_WITH_RAW_MODE), \
496 VMMAll/CSAMAll.cpp \
497 VMMAll/PATMAll.cpp \
498 ,)
499 ifeq ($(VBOX_LDR_FMT32),pe)
500 VMMRC_SOURCES += VMMRC/VMMRC.def
501 endif
502 ifeq ($(VBOX_LDR_FMT32),lx)
503 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
504 endif
505
506 # the very last one.
507 VMMRC_SOURCES += VMMRC/VMMRC99.asm
508
509 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
510endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
511
512
513ifndef VBOX_ONLY_EXTPACKS
514 #
515 # VMMR0.r0
516 #
517 SYSMODS += VMMR0
518 VMMR0_TEMPLATE = VBoxR0
519 VMMR0_SYSSUFF = .r0
520
521 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
522 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
523 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
524 ifdef VBOX_WITH_PCI_PASSTHROUGH
525 VMMR0_DEFS += IN_PCIRAW_R0
526 endif
527 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
528 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
529 endif
530 ifdef VBOX_WITH_RAW_MODE
531 VMMR0_DEFS += VBOX_WITH_RAW_MODE
532 endif
533 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
534 VMMR0_DEFS += VMM_R0_SWITCH_STACK
535 endif
536 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
537 VMMR0_DEFS.darwin.x86 = \
538 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 \
539 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
540 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
541
542 VMMR0_INCS = \
543 include \
544 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
545
546 VMMR0_SOURCES = \
547 VBoxVMM.d \
548 VMMR0/CPUMR0.cpp \
549 VMMR0/CPUMR0A.asm \
550 VMMR0/GIMR0.cpp \
551 VMMR0/GIMR0Hv.cpp \
552 VMMR0/GMMR0.cpp \
553 VMMR0/GVMMR0.cpp \
554 VMMR0/HMR0.cpp \
555 VMMR0/HMR0A.asm \
556 VMMR0/HMVMXR0.cpp \
557 VMMR0/HMSVMR0.cpp \
558 VMMR0/PDMR0Device.cpp \
559 VMMR0/PDMR0Driver.cpp \
560 VMMR0/PGMR0.cpp \
561 VMMR0/PGMR0SharedPage.cpp \
562 VMMR0/TRPMR0.cpp \
563 VMMR0/TRPMR0A.asm \
564 VMMR0/VMMR0.cpp \
565 VMMRZ/DBGFRZ.cpp \
566 VMMRZ/VMMRZ.cpp \
567 VMMAll/CPUMAllRegs.cpp \
568 VMMAll/CPUMAllMsrs.cpp \
569 VMMAll/CPUMStack.cpp \
570 VMMAll/DBGFAll.cpp \
571 VMMAll/EMAll.cpp \
572 VMMAll/EMAllA.asm \
573 VMMAll/FTMAll.cpp \
574 VMMAll/GIMAll.cpp \
575 VMMAll/GIMAllHv.cpp \
576 VMMAll/HMAll.cpp \
577 VMMAll/IEMAll.cpp \
578 VMMAll/IEMAllAImpl.asm \
579 VMMAll/IEMAllAImplC.cpp \
580 VMMAll/IOMAll.cpp \
581 VMMAll/IOMAllMMIO.cpp \
582 VMMAll/MMAll.cpp \
583 VMMAll/MMAllHyper.cpp \
584 VMMAll/MMAllPagePool.cpp \
585 VMMAll/PDMAll.cpp \
586 VMMAll/PDMAllCritSect.cpp \
587 VMMAll/PDMAllCritSectRw.cpp \
588 VMMAll/PDMAllCritSectBoth.cpp \
589 VMMAll/PDMAllQueue.cpp \
590 VMMAll/PGMAll.cpp \
591 VMMAll/PGMAllHandler.cpp \
592 VMMAll/PGMAllMap.cpp \
593 VMMAll/PGMAllPhys.cpp \
594 VMMAll/PGMAllPool.cpp \
595 VMMAll/REMAll.cpp \
596 VMMAll/SELMAll.cpp \
597 VMMAll/TMAll.cpp \
598 VMMAll/TMAllCpu.cpp \
599 VMMAll/TMAllReal.cpp \
600 VMMAll/TMAllVirtual.cpp \
601 VMMAll/TRPMAll.cpp \
602 VMMAll/VMAll.cpp \
603 VMMAll/VMMAll.cpp \
604 VMMAll/VMMAllA.asm
605 if1of ($(VBOX_LDR_FMT), pe lx)
606 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
607 endif
608 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
609 VMMR0_SOURCES += \
610 VMMR0/VMMR0TripleFaultHack.cpp \
611 VMMR0/VMMR0TripleFaultHackA.asm
612 endif
613 ifdef VBOX_WITH_NETSHAPER
614 VMMR0_SOURCES += \
615 VMMAll/PDMAllNetShaper.cpp
616 endif
617 VMMR0_SOURCES.amd64 = \
618 VMMR0/VMMR0JmpA-amd64.asm
619 VMMR0_SOURCES.x86 = \
620 VMMR0/VMMR0JmpA-x86.asm
621 VMMR0_SOURCES.darwin.x86 = \
622 VMMRZ/PGMRZDynMap.cpp
623
624 VMMR0_LIBS = \
625 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
626 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
627 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
628 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
629 VMMR0_LIBS += \
630 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
631 endif
632endif # !VBOX_ONLY_EXTPACKS
633
634
635ifndef VBOX_ONLY_EXTPACKS
636 #
637 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
638 #
639 LIBRARIES += SSMStandalone
640 SSMStandalone_TEMPLATE = VBOXR3EXE
641 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
642 SSMStandalone_INCS = include
643 SSMStandalone_SOURCES = \
644 VMMR3/SSM.cpp \
645 VMMR3/CPUMR3Db.cpp
646endif # !VBOX_ONLY_EXTPACKS
647
648
649if !defined(VBOX_ONLY_EXTPACKS) \
650 && ( defined(VBOX_WITH_DTRACE_R3) \
651 || defined(VBOX_WITH_DTRACE_R0) \
652 || defined(VBOX_WITH_DTRACE_RC))
653 #
654 # Install the dtrace library files.
655 #
656 INSTALLS += VMMLibDTrace
657 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
658 VMMLibDTrace_SOURCES = \
659 dtrace/lib/vbox-types.d \
660 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
661 $(VMMLibDTrace_0_OUTDIR)/vm.d \
662 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
663 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
664 $(VMMLibDTrace_0_OUTDIR)/x86.d \
665
666
667 ##
668 # Turn the header $2 into the DTrace library script $1.
669 #
670 define def_vmm_lib_dtrace_preprocess
671 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
672 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
673 $$(QUIET)$(VBOX_VBOXCPP) -d \
674 -D VBOX_FOR_DTRACE_LIB \
675 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
676 -D IN_RING0 \
677 -D RT_C_DECLS_BEGIN= \
678 -D RT_C_DECLS_END= \
679 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
680 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
681 -D 'R0PTRTYPE(a_Type)=a_Type' \
682 -D 'AssertCompile(a_Expr)=' \
683 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
684 -D 'bool=uint8_t' \
685 $$(foreach def,\
686 $$(DEFS) \
687 $$(DEFS.$$(KBUILD_TARGET)) \
688 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
689 $$(VMM_COMMON_DEFS) \
690 $$(ARCH_BITS_DEFS)\
691 ,-D '$$(def)') \
692 $$< \
693 $$@
694 $$(QUIET)$$(CHMOD) 644 $$@
695 endef
696 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
697 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
698 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
699 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
700
701endif
702
703
704
705#
706# For vmmGetSvnRev.
707#
708VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
709
710#
711# Disable annoying warnings about array subscript above array bounds in aPages[]
712#
713ifneq ($(KBUILD_TARGET),win)
714 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
715 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
716 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
717 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-parameter
718endif
719
720#
721# Always optimize the interpreter.
722#
723ifn1of ($(USERNAME),bird)
724if1of ($(KBUILD_TARGET), win)
725 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
726 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
727 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
728 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
729else
730 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
731 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
732 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
733 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?)
734endif
735endif # bird wants good stacks
736
737
738# Alias the CPU database entries.
739$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
740
741
742include $(FILE_KBUILD_SUB_FOOTER)
743
744
745# Alias the PGM templates to the object in which they are defined.
746PGMInternal.o \
747PGMBth.o PGMGst.o PGMShw.o \
748PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
749
750PGMAllBth.o PGMAllGst.o PGMAllShw.o \
751PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
752
753PGMRCBth.o PGMRCGst.o PGMRCShw.o \
754PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
755
756PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
757
758PGMInline.o PGMInline.obj: PGMDbg.o
759
760# Alias the IEM templates to the object in which they are instantiated.
761IEMInternal.o \
762IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
763IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
764IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
765
766# Alias the switcher templates.
767PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
768LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
769AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
770
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