VirtualBox

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

Last change on this file since 45616 was 45529, checked in by vboxsync, 12 years ago

oops.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.7 KB
Line 
1# $Id: Makefile.kmk 45529 2013-04-12 17:38:27Z 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_IEM
36 VMM_COMMON_DEFS += VBOX_WITH_IEM
37endif
38ifdef VBOX_WITH_REM
39 VMM_COMMON_DEFS += VBOX_WITH_REM
40endif
41ifdef VBOX_WITH_MULTI_CORE
42 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
43endif
44ifdef VBOX_WITH_R0_LOGGING
45 VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
46endif
47ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
48 VMM_COMMON_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
49endif
50ifdef VBOX_WITH_PCI_PASSTHROUGH
51 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
52endif
53ifdef VBOX_WITH_DTRACE_RC
54 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
55endif
56ifdef VBOX_WITH_OLD_VTX_CODE
57 VMM_COMMON_DEFS += VBOX_WITH_OLD_VTX_CODE
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 REM.
69ifdef IEM_VERIFICATION_MODE
70 VMM_COMMON_DEFS += IEM_VERIFICATION_MODE IEM_VERIFICATION_MODE_FULL
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/DBGFSym.cpp \
129 VMMR3/DBGFR3Trace.cpp \
130 VMMR3/EM.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 ,) \
181 VMMAll/CPUMAllRegs.cpp \
182 VMMAll/CPUMStack.cpp \
183 VMMAll/DBGFAll.cpp \
184 VMMAll/HMAll.cpp \
185 VMMAll/IOMAll.cpp \
186 VMMAll/IOMAllMMIO.cpp \
187 VMMAll/MMAll.cpp \
188 VMMAll/MMAllHyper.cpp \
189 VMMAll/MMAllPagePool.cpp \
190 VMMAll/PDMAll.cpp \
191 VMMAll/PDMAllCritSect.cpp \
192 VMMAll/PDMAllCritSectRw.cpp \
193 VMMAll/PDMAllCritSectBoth.cpp \
194 VMMAll/PDMAllQueue.cpp \
195 VMMAll/PGMAll.cpp \
196 VMMAll/PGMAllHandler.cpp \
197 VMMAll/PGMAllMap.cpp \
198 VMMAll/PGMAllPhys.cpp \
199 VMMAll/PGMAllPool.cpp \
200 VMMAll/REMAll.cpp \
201 VMMAll/SELMAll.cpp \
202 VMMAll/EMAll.cpp \
203 VMMAll/EMAllA.asm \
204 VMMAll/FTMAll.cpp \
205 VMMAll/IEMAll.cpp \
206 VMMAll/IEMAllAImpl.asm \
207 VMMAll/IEMAllAImplC.cpp \
208 VMMAll/TMAll.cpp \
209 VMMAll/TMAllCpu.cpp \
210 VMMAll/TMAllReal.cpp \
211 VMMAll/TMAllVirtual.cpp \
212 VMMAll/TRPMAll.cpp \
213 VMMAll/VMAll.cpp \
214 VMMAll/VMMAll.cpp \
215 VMMAll/VMMAllA.asm \
216 $(if-expr defined(VBOX_WITH_RAW_MODE), \
217 VMMAll/CSAMAll.cpp \
218 VMMAll/PATMAll.cpp \
219 ,)
220ifdef VBOX_WITH_VUSB
221 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
222endif
223ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
224 VBoxVMM_SOURCES += \
225 VMMR3/PDMAsyncCompletion.cpp \
226 VMMR3/PDMAsyncCompletionFile.cpp \
227 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
228 VMMR3/PDMAsyncCompletionFileNormal.cpp
229endif
230ifdef VBOX_WITH_NETSHAPER
231 VBoxVMM_SOURCES += \
232 VMMR3/PDMNetShaper.cpp \
233 VMMAll/PDMAllNetShaper.cpp
234endif
235
236ifdef VBOX_WITH_RAW_MODE
237 VBoxVMM_SOURCES.x86 += \
238 VMMSwitcher/32BitTo32Bit.asm \
239 VMMSwitcher/32BitToPAE.asm \
240 VMMSwitcher/32BitToAMD64.asm \
241 VMMSwitcher/PAETo32Bit.asm \
242 VMMSwitcher/PAEToAMD64.asm \
243 VMMSwitcher/PAEToPAE.asm
244 VBoxVMM_SOURCES.amd64 = \
245 VMMSwitcher/AMD64To32Bit.asm \
246 VMMSwitcher/AMD64ToPAE.asm
247 VBoxVMM_SOURCES.darwin.x86 += \
248 VMMSwitcher/AMD64ToPAE.asm
249endif
250
251VBoxVMM_LIBS = \
252 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
253ifdef VBOX_WITH_DEBUGGER
254 VBoxVMM_LIBS += \
255 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
256endif
257VBoxVMM_LIBS += \
258 $(LIB_REM) \
259 $(LIB_RUNTIME)
260
261VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
262VBoxVMM_LDFLAGS.win = /DELAYLOAD:dbghelp.dll
263VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
264VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
265VBoxVMM_LDFLAGS.solaris = -mimpure-text
266
267# SSM wish to know the build type, host os and arch.
268VMMR3/SSM.cpp_DEFS += \
269 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
270 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
271 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
272
273
274#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
275# ifeq ($(KBUILD_HOST), linux)
276#VBoxVMM_LIBS += aio
277# endif
278#endif
279
280
281if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
282
283 #
284 # VMMRCBuiltin.lib
285 #
286 LIBRARIES += VMMRCBuiltin
287 VMMRCBuiltin_TEMPLATE = VBoxRc
288 ifeq ($(VBOX_LDR_FMT32),pe)
289 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
290 endif
291 ifeq ($(VBOX_LDR_FMT32),lx)
292 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
293 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
294 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
295 endif
296
297
298 #
299 # VMMRCImp.lib
300 #
301 LIBRARIES += VMMRCImp
302 VMMRCImp_TEMPLATE = VBoxRc
303 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
304 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
305
306 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
307 ifeq ($(VBOX_LDR_FMT32),lx)
308 $(SED) \
309 -e '/not-os2/d' \
310 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
311 -e 's/[ \t]DATA[ \t]*/ /' \
312 --output $@ \
313 $<
314 $(APPEND) "$@" ""
315 $(APPEND) "$@" " ___ehInit"
316 else
317 $(SED) \
318 -e '/not-win/d' \
319 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
320 --output $@ $<
321 endif
322
323endif # RC && (pe || lx)
324
325
326if1of ($(VBOX_LDR_FMT), pe lx)
327 #
328 # VMMR0Imp.lib
329 #
330 LIBRARIES += VMMR0Imp
331 VMMR0Imp_TEMPLATE = VBoxR0
332 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
333 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
334
335 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
336 ifeq ($(VBOX_LDR_FMT),lx)
337 $(SED) \
338 -e '/not-os2/d' \
339 -e '/not-amd64/d' \
340 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
341 -e 's/[ \t]DATA[ \t]*/ /' \
342 --output $@ $<
343 $(APPEND) "$@" ""
344 $(APPEND) "$@" " ___ehInit"
345 else
346 $(SED) \
347 -e '/not-win/d' \
348 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
349 --output $@ $<
350 endif
351endif # R0: pe + lx
352
353
354#
355# VMMR3Imp.lib
356#
357IMPORT_LIBS += VMMR3Imp
358$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
359
360
361if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
362 #
363 # VMMRC.gc
364 #
365 SYSMODS += VMMRC
366 VMMRC_TEMPLATE = VBoxRc
367 VMMRC_NAME = VMMGC
368 VMMRC_SYSSUFF = .gc
369
370 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)
371 ifeq ($(KBUILD_TARGET_ARCH),x86)
372 VMMRC_DEFS.darwin = VMM_R0_SWITCH_STACK
373 VMMRC_DEFS.darwin = \
374 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
375 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
376 endif
377
378 VMMRC_INCS := \
379 include \
380 VMMRC \
381 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
382
383 VMMRC_LIBS = \
384 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
385 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB)
386 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
387 VMMRC_LIBS += \
388 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
389 endif
390
391 VMMRC_SOURCES = \
392 VBoxVMM.d \
393 VMMRC/VMMRC0.asm \
394 VMMRC/VMMRCDeps.cpp \
395 VMMRC/CPUMRC.cpp \
396 VMMRC/CPUMRCA.asm \
397 VMMRC/EMRCA.asm \
398 VMMRC/IOMRC.cpp \
399 VMMRC/MMRamRC.cpp \
400 VMMRC/MMRamRCA.asm \
401 VMMRC/PDMRCDevice.cpp \
402 VMMRC/PGMRC.cpp \
403 VMMRC/SELMRC.cpp \
404 VMMRC/TRPMRC.cpp \
405 VMMRC/TRPMRCHandlers.cpp \
406 VMMRC/TRPMRCHandlersA.asm \
407 VMMRC/VMMRC.cpp \
408 VMMRC/VMMRCA.asm \
409 VMMRC/HMRCA.asm \
410 $(if-expr defined(VBOX_WITH_RAW_MODE), \
411 VMMRC/CSAMRC.cpp \
412 VMMRC/PATMRC.cpp \
413 ,) \
414 VMMRZ/DBGFRZ.cpp \
415 VMMRZ/PGMRZDynMap.cpp \
416 VMMRZ/VMMRZ.cpp \
417 VMMAll/CPUMAllRegs.cpp \
418 VMMAll/CPUMAllA.asm \
419 VMMAll/DBGFAll.cpp \
420 VMMAll/IOMAll.cpp \
421 VMMAll/IOMAllMMIO.cpp \
422 VMMAll/EMAll.cpp \
423 VMMAll/EMAllA.asm \
424 VMMAll/FTMAll.cpp \
425 VMMAll/MMAll.cpp \
426 VMMAll/MMAllHyper.cpp \
427 VMMAll/PDMAll.cpp \
428 VMMAll/PDMAllCritSect.cpp \
429 VMMAll/PDMAllCritSectRw.cpp \
430 VMMAll/PDMAllCritSectBoth.cpp \
431 VMMAll/PDMAllQueue.cpp \
432 VMMAll/PGMAll.cpp \
433 VMMAll/PGMAllHandler.cpp \
434 VMMAll/PGMAllMap.cpp \
435 VMMAll/PGMAllPhys.cpp \
436 VMMAll/PGMAllPool.cpp \
437 VMMAll/REMAll.cpp \
438 VMMAll/SELMAll.cpp \
439 VMMAll/TMAll.cpp \
440 VMMAll/TMAllCpu.cpp \
441 VMMAll/TMAllReal.cpp \
442 VMMAll/TMAllVirtual.cpp \
443 VMMAll/TRPMAll.cpp \
444 VMMAll/VMAll.cpp \
445 VMMAll/VMMAll.cpp \
446 VMMAll/VMMAllA.asm \
447 $(if-expr defined(VBOX_WITH_RAW_MODE), \
448 VMMAll/CSAMAll.cpp \
449 VMMAll/PATMAll.cpp \
450 ,)
451 ifeq ($(VBOX_LDR_FMT32),pe)
452 VMMRC_SOURCES += VMMRC/VMMRC.def
453 endif
454 ifeq ($(VBOX_LDR_FMT32),lx)
455 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
456 endif
457 ifdef VBOX_WITH_IEM
458 VMMRC_SOURCES += \
459 VMMAll/IEMAll.cpp \
460 VMMAll/IEMAllAImpl.asm \
461 VMMAll/IEMAllAImplC.cpp
462 endif
463
464 # the very last one.
465 VMMRC_SOURCES += VMMRC/VMMRC99.asm
466
467 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
468endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
469
470
471ifndef VBOX_ONLY_EXTPACKS
472 #
473 # VMMR0.r0
474 #
475 SYSMODS += VMMR0
476 VMMR0_TEMPLATE = VBoxR0
477 VMMR0_SYSSUFF = .r0
478
479 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
480 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
481 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
482 ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION
483 VMMR0_DEFS += VBOX_WITH_VMMR0_DISABLE_PREEMPTION
484 endif
485 ifdef VBOX_WITH_PCI_PASSTHROUGH
486 VMMR0_DEFS += IN_PCIRAW_R0
487 endif
488 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
489 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
490 endif
491 ifdef VBOX_WITH_RAW_MODE
492 VMMR0_DEFS += VBOX_WITH_RAW_MODE
493 endif
494 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
495 VMMR0_DEFS.darwin.x86 = \
496 VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 \
497 VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
498 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
499
500 ifeq ($(VBOX_LDR_FMT),elf)
501 VMMR0_LDFLAGS = -e VMMR0EntryEx
502 endif
503 VMMR0_INCS = \
504 include \
505 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
506
507 VMMR0_SOURCES = \
508 VBoxVMM.d \
509 VMMR0/CPUMR0.cpp \
510 VMMR0/CPUMR0A.asm \
511 VMMR0/GMMR0.cpp \
512 VMMR0/GVMMR0.cpp \
513 VMMR0/HMR0.cpp \
514 VMMR0/HMR0A.asm \
515 VMMR0/HWSVMR0.cpp \
516 VMMR0/PDMR0Device.cpp \
517 VMMR0/PDMR0Driver.cpp \
518 VMMR0/PGMR0.cpp \
519 VMMR0/PGMR0SharedPage.cpp \
520 VMMR0/TRPMR0.cpp \
521 VMMR0/TRPMR0A.asm \
522 VMMR0/VMMR0.cpp \
523 VMMRZ/DBGFRZ.cpp \
524 VMMRZ/VMMRZ.cpp \
525 VMMAll/CPUMAllA.asm \
526 VMMAll/CPUMAllRegs.cpp \
527 VMMAll/CPUMStack.cpp \
528 VMMAll/DBGFAll.cpp \
529 VMMAll/EMAll.cpp \
530 VMMAll/EMAllA.asm \
531 VMMAll/FTMAll.cpp \
532 VMMAll/HMAll.cpp \
533 VMMAll/IOMAll.cpp \
534 VMMAll/IOMAllMMIO.cpp \
535 VMMAll/MMAll.cpp \
536 VMMAll/MMAllHyper.cpp \
537 VMMAll/MMAllPagePool.cpp \
538 VMMAll/PDMAll.cpp \
539 VMMAll/PDMAllCritSect.cpp \
540 VMMAll/PDMAllCritSectRw.cpp \
541 VMMAll/PDMAllCritSectBoth.cpp \
542 VMMAll/PDMAllQueue.cpp \
543 VMMAll/PGMAll.cpp \
544 VMMAll/PGMAllHandler.cpp \
545 VMMAll/PGMAllMap.cpp \
546 VMMAll/PGMAllPhys.cpp \
547 VMMAll/PGMAllPool.cpp \
548 VMMAll/REMAll.cpp \
549 VMMAll/SELMAll.cpp \
550 VMMAll/TMAll.cpp \
551 VMMAll/TMAllCpu.cpp \
552 VMMAll/TMAllReal.cpp \
553 VMMAll/TMAllVirtual.cpp \
554 VMMAll/TRPMAll.cpp \
555 VMMAll/VMAll.cpp \
556 VMMAll/VMMAll.cpp \
557 VMMAll/VMMAllA.asm
558 if1of ($(VBOX_LDR_FMT), pe lx)
559 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
560 endif
561 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
562 VMMR0_SOURCES += \
563 VMMR0/VMMR0TripleFaultHack.cpp \
564 VMMR0/VMMR0TripleFaultHackA.asm
565 endif
566 ifdef VBOX_WITH_IEM
567 VMMR0_SOURCES += \
568 VMMAll/IEMAll.cpp \
569 VMMAll/IEMAllAImpl.asm \
570 VMMAll/IEMAllAImplC.cpp
571 endif
572 ifdef VBOX_WITH_NETSHAPER
573 VMMR0_SOURCES += \
574 VMMAll/PDMAllNetShaper.cpp
575 endif
576 ifdef VBOX_WITH_OLD_VTX_CODE
577 VMMR0_SOURCES += VMMR0/HWVMXR0.cpp
578 else
579 VMMR0_SOURCES += VMMR0/HMVMXR0.cpp
580 endif
581 VMMR0_SOURCES.amd64 = \
582 VMMR0/VMMR0JmpA-amd64.asm
583 VMMR0_SOURCES.x86 = \
584 VMMR0/VMMR0JmpA-x86.asm
585 VMMR0_SOURCES.darwin.x86 = \
586 VMMRZ/PGMRZDynMap.cpp
587
588 VMMR0_LIBS = \
589 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
590 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
591 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
592 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
593 VMMR0_LIBS += \
594 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
595 endif
596endif # !VBOX_ONLY_EXTPACKS
597
598
599ifndef VBOX_ONLY_EXTPACKS
600 #
601 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
602 #
603 LIBRARIES += SSMStandalone
604 SSMStandalone_TEMPLATE = VBOXR3EXE
605 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE
606 SSMStandalone_INCS = include
607 SSMStandalone_SOURCES = VMMR3/SSM.cpp
608endif # !VBOX_ONLY_EXTPACKS
609
610
611if !defined(VBOX_ONLY_EXTPACKS) \
612 && ( defined(VBOX_WITH_DTRACE_R3) \
613 || defined(VBOX_WITH_DTRACE_R0) \
614 || defined(VBOX_WITH_DTRACE_RC))
615 #
616 # Install the dtrace library files.
617 #
618 INSTALLS += VMMLibDTrace
619 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
620 VMMLibDTrace_SOURCES = \
621 dtrace/lib/vbox-types.d \
622 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
623 $(VMMLibDTrace_0_OUTDIR)/vm.d \
624 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
625 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
626 $(VMMLibDTrace_0_OUTDIR)/x86.d \
627
628
629 ##
630 # Turn the header $2 into the DTrace library script $1.
631 #
632 define def_vmm_lib_dtrace_preprocess
633 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
634 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
635 $$(QUIET)$(VBOX_VBOXCPP) -d \
636 -D VBOX_FOR_DTRACE_LIB \
637 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
638 -D IN_RING0 \
639 -D RT_C_DECLS_BEGIN= \
640 -D RT_C_DECLS_END= \
641 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
642 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
643 -D 'R0PTRTYPE(a_Type)=a_Type' \
644 -D 'AssertCompile(a_Expr)=' \
645 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
646 -D 'bool=uint8_t' \
647 $$(foreach def,\
648 $$(DEFS) \
649 $$(DEFS.$$(KBUILD_TARGET)) \
650 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
651 $$(VMM_COMMON_DEFS) \
652 $$(ARCH_BITS_DEFS)\
653 ,-D '$$(def)') \
654 $$< \
655 $$@
656 $$(QUIET)$$(CHMOD) 644 $$@
657 endef
658 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
659 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
660 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
661 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
662
663endif
664
665
666
667#
668# For vmmGetSvnRev.
669#
670VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
671
672#
673# Disable annoying warnings about array subscript above array bounds in aPages[]
674#
675ifneq ($(KBUILD_TARGET),win)
676 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
677 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
678 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
679 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-parameter
680endif
681
682#
683# Always optimize the interpreter.
684#
685if1of ($(KBUILD_TARGET), win)
686 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
687 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
688 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
689 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
690else
691 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
692 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
693 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
694 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?)
695endif
696
697
698include $(FILE_KBUILD_SUB_FOOTER)
699
700
701# Alias the PGM templates to the object in which they are defined.
702PGMInternal.o \
703PGMBth.o PGMGst.o PGMShw.o \
704PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
705
706PGMAllBth.o PGMAllGst.o PGMAllShw.o \
707PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
708
709PGMRCBth.o PGMRCGst.o PGMRCShw.o \
710PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
711
712PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
713
714PGMInline.o PGMInline.obj: PGMDbg.o
715
716# Alias the IEM templates to the object in which they are instantiated.
717IEMInternal.o \
718IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
719IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
720IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
721
722# Alias the switcher templates.
723PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
724LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
725AMD64andLegacy.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