VirtualBox

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

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

IEM: Implemented mfence, lfence, sfence.

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