VirtualBox

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

Last change on this file since 48208 was 48132, checked in by vboxsync, 11 years ago

VMM: Ditch VBOX_WITH_VMMR0_DISABLE_PREEMPTION.

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