VirtualBox

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

Last change on this file since 54030 was 53781, checked in by vboxsync, 10 years ago

added a bunch of missing Windows resource files and fixed a few minor bugs

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