VirtualBox

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

Last change on this file since 51906 was 51643, checked in by vboxsync, 10 years ago

VMM/GIM: More bits for Hyper-V implementation.

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