VirtualBox

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

Last change on this file since 49993 was 49893, checked in by vboxsync, 11 years ago

MSR rewrite: initial hacking - half disabled.

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