VirtualBox

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

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

VMM: Removing VBOX_WITH_HYBRID_32BIT_KERNEL and other 32-bit darwin fun.

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