VirtualBox

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

Last change on this file since 57143 was 57126, checked in by vboxsync, 9 years ago

VMM: Optimizations for memory scanning, trying to make 'detect' run faster against 64-bit guest systems.

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