VirtualBox

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

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

PGM,++: VBOXSTRICTRC for physical access handlers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.5 KB
Line 
1# $Id: Makefile.kmk 55966 2015-05-20 12:42: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#
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
71ifdef VBOXSTRICTRC_STRICT_ENABLED
72 VMM_COMMON_DEFS += VBOXSTRICTRC_STRICT_ENABLED
73endif
74ifeq ($(KBUILD_TARGET),amd64)
75 VMM_COMMON_DEFS += VBOX_WITH_MORE_RING0_MEM_MAPPINGS
76endif
77
78# VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
79
80# Special IEM debug mode which compares the result with HM/REM
81ifdef IEM_VERIFICATION_MODE
82 VMM_COMMON_DEFS += IEM_VERIFICATION_MODE IEM_VERIFICATION_MODE_FULL IEM_VERIFICATION_MODE_FULL_HM
83endif
84
85
86#
87# The VMM DLL.
88#
89ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
90 DLLS += VBoxVMM
91endif
92VBoxVMM_TEMPLATE = VBoxR3DllNoPic
93VBoxVMM_SONAME.linux = VBoxVMM.so
94
95VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
96## @todo eliminate IN_GMM_R3
97ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
98 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
99endif
100ifdef VBOX_WITH_VUSB
101 VBoxVMM_DEFS += VBOX_WITH_USB
102endif
103ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
104 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
105endif
106ifdef VBOX_WITH_NETSHAPER
107 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
108endif
109ifdef VBOX_WITH_RAW_MODE
110 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
111endif
112ifdef VBOX_WITH_PDM_AUDIO_DRIVER
113 VBoxVMM_DEFS += VBOX_WITH_PDM_AUDIO_DRIVER
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/PGMHandler.cpp \
183 VMMR3/PGMMap.cpp \
184 VMMR3/PGMPhys.cpp \
185 VMMR3/PGMPool.cpp \
186 VMMR3/PGMSavedState.cpp \
187 VMMR3/PGMSharedPage.cpp \
188 VMMR3/SELM.cpp \
189 VMMR3/SSM.cpp \
190 VMMR3/STAM.cpp \
191 VMMR3/TM.cpp \
192 VMMR3/TRPM.cpp \
193 VMMR3/VM.cpp \
194 VMMR3/VMEmt.cpp \
195 VMMR3/VMReq.cpp \
196 VMMR3/VMM.cpp \
197 VMMR3/VMMGuruMeditation.cpp \
198 VMMR3/VMMSwitcher.cpp \
199 VMMR3/VMMTests.cpp \
200 VMMR3/HM.cpp \
201 $(if-expr defined(VBOX_WITH_RAW_MODE), \
202 VMMR3/CSAM.cpp \
203 VMMR3/PATM.cpp \
204 VMMR3/PATMPatch.cpp \
205 VMMR3/PATMGuest.cpp \
206 VMMR3/PATMA.asm \
207 VMMR3/PATMSSM.cpp \
208 VMMR3/PATMR3Dbg.cpp \
209 ,) \
210 VMMAll/CPUMAllRegs.cpp \
211 VMMAll/CPUMAllMsrs.cpp \
212 VMMAll/CPUMStack.cpp \
213 VMMAll/DBGFAll.cpp \
214 VMMAll/HMAll.cpp \
215 VMMAll/IEMAll.cpp \
216 VMMAll/IEMAllAImpl.asm \
217 VMMAll/IEMAllAImplC.cpp \
218 VMMAll/IOMAll.cpp \
219 VMMAll/IOMAllMMIO.cpp \
220 VMMAll/MMAll.cpp \
221 VMMAll/MMAllHyper.cpp \
222 VMMAll/MMAllPagePool.cpp \
223 VMMAll/PDMAll.cpp \
224 VMMAll/PDMAllCritSect.cpp \
225 VMMAll/PDMAllCritSectRw.cpp \
226 VMMAll/PDMAllCritSectBoth.cpp \
227 VMMAll/PDMAllQueue.cpp \
228 VMMAll/PGMAll.cpp \
229 VMMAll/PGMAllHandler.cpp \
230 VMMAll/PGMAllMap.cpp \
231 VMMAll/PGMAllPhys.cpp \
232 VMMAll/PGMAllPool.cpp \
233 VMMAll/REMAll.cpp \
234 VMMAll/SELMAll.cpp \
235 VMMAll/EMAll.cpp \
236 VMMAll/EMAllA.asm \
237 VMMAll/FTMAll.cpp \
238 VMMAll/GIMAll.cpp \
239 VMMAll/GIMAllHv.cpp \
240 VMMAll/GIMAllKvm.cpp \
241 VMMAll/TMAll.cpp \
242 VMMAll/TMAllCpu.cpp \
243 VMMAll/TMAllReal.cpp \
244 VMMAll/TMAllVirtual.cpp \
245 VMMAll/TRPMAll.cpp \
246 VMMAll/VMAll.cpp \
247 VMMAll/VMMAll.cpp \
248 VMMAll/VMMAllA.asm \
249 $(if-expr defined(VBOX_WITH_RAW_MODE), \
250 VMMAll/CSAMAll.cpp \
251 VMMAll/PATMAll.cpp \
252 ,)
253ifdef VBOX_WITH_VUSB
254 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
255endif
256ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
257 VBoxVMM_SOURCES += \
258 VMMR3/PDMAsyncCompletion.cpp \
259 VMMR3/PDMAsyncCompletionFile.cpp \
260 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
261 VMMR3/PDMAsyncCompletionFileNormal.cpp
262endif
263ifdef VBOX_WITH_NETSHAPER
264 VBoxVMM_SOURCES += \
265 VMMR3/PDMNetShaper.cpp \
266 VMMAll/PDMAllNetShaper.cpp
267endif
268
269ifdef VBOX_WITH_RAW_MODE
270 VBoxVMM_SOURCES.x86 += \
271 VMMSwitcher/32BitTo32Bit.asm \
272 VMMSwitcher/32BitToPAE.asm \
273 VMMSwitcher/PAETo32Bit.asm \
274 VMMSwitcher/PAEToPAE.asm
275 VBoxVMM_SOURCES.amd64 = \
276 VMMSwitcher/AMD64To32Bit.asm \
277 VMMSwitcher/AMD64ToPAE.asm
278 VBoxVMM_SOURCES.darwin.x86 += \
279 VMMSwitcher/AMD64ToPAE.asm
280endif
281VBoxVMM_SOURCES.x86 += \
282 VMMSwitcher/32BitToAMD64.asm \
283 VMMSwitcher/PAEToAMD64.asm \
284 VMMSwitcher/X86Stub.asm
285VBoxVMM_SOURCES.amd64 += \
286 VMMSwitcher/AMD64Stub.asm
287
288VBoxVMM_LIBS = \
289 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
290ifdef VBOX_WITH_DEBUGGER
291 VBoxVMM_LIBS += \
292 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
293endif
294VBoxVMM_LIBS += \
295 $(LIB_REM) \
296 $(LIB_RUNTIME)
297
298VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
299VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
300VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
301VBoxVMM_LDFLAGS.solaris = -mimpure-text
302
303# SSM wish to know the build type, host os and arch.
304VMMR3/SSM.cpp_DEFS += \
305 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
306 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
307 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
308
309
310#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
311# ifeq ($(KBUILD_HOST), linux)
312#VBoxVMM_LIBS += aio
313# endif
314#endif
315
316$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
317
318
319if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
320
321 #
322 # VMMRCBuiltin.lib
323 #
324 LIBRARIES += VMMRCBuiltin
325 VMMRCBuiltin_TEMPLATE = VBoxRc
326 ifeq ($(VBOX_LDR_FMT32),pe)
327 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
328 endif
329 ifeq ($(VBOX_LDR_FMT32),lx)
330 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
331 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
332 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
333 endif
334
335
336 #
337 # VMMRCImp.lib
338 #
339 LIBRARIES += VMMRCImp
340 VMMRCImp_TEMPLATE = VBoxRc
341 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
342 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
343
344 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
345 ifeq ($(VBOX_LDR_FMT32),lx)
346 $(SED) \
347 -e '/not-os2/d' \
348 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
349 -e 's/[ \t]DATA[ \t]*/ /' \
350 --output $@ \
351 $<
352 $(APPEND) "$@" ""
353 $(APPEND) "$@" " ___ehInit"
354 else
355 $(SED) \
356 -e '/not-win/d' \
357 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
358 --output $@ $<
359 endif
360
361endif # RC && (pe || lx)
362
363
364if1of ($(VBOX_LDR_FMT), pe lx)
365 #
366 # VMMR0Imp.lib
367 #
368 LIBRARIES += VMMR0Imp
369 VMMR0Imp_TEMPLATE = VBoxR0
370 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
371 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
372
373 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
374 ifeq ($(VBOX_LDR_FMT),lx)
375 $(SED) \
376 -e '/not-os2/d' \
377 -e '/not-amd64/d' \
378 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
379 -e 's/[ \t]DATA[ \t]*/ /' \
380 --output $@ $<
381 $(APPEND) "$@" ""
382 $(APPEND) "$@" " ___ehInit"
383 else
384 $(SED) \
385 -e '/not-win/d' \
386 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
387 --output $@ $<
388 endif
389endif # R0: pe + lx
390
391
392#
393# VMMR3Imp.lib
394#
395IMPORT_LIBS += VMMR3Imp
396$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
397
398ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
399 #
400 # VMMR3LazyImp.lib (experimental)
401 #
402 LIBRARIES += VMMR3LazyImp
403 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
404 VMMR3LazyImp_INST = $(INST_LIB)
405 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
406 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
407 $$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(PATH_SUB_CURRENT)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
408 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $<
409endif
410
411
412if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
413 #
414 # VMMRC.gc
415 #
416 SYSMODS += VMMRC
417 VMMRC_TEMPLATE = VBoxRc
418 VMMRC_NAME = VMMGC
419 VMMRC_SYSSUFF = .gc
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/GMMR0.cpp \
569 VMMR0/GVMMR0.cpp \
570 VMMR0/HMR0.cpp \
571 VMMR0/HMR0A.asm \
572 VMMR0/HMVMXR0.cpp \
573 VMMR0/HMSVMR0.cpp \
574 VMMR0/PDMR0Device.cpp \
575 VMMR0/PDMR0Driver.cpp \
576 VMMR0/PGMR0.cpp \
577 VMMR0/PGMR0SharedPage.cpp \
578 VMMR0/TRPMR0.cpp \
579 VMMR0/TRPMR0A.asm \
580 VMMR0/VMMR0.cpp \
581 VMMRZ/DBGFRZ.cpp \
582 VMMRZ/VMMRZ.cpp \
583 VMMAll/CPUMAllRegs.cpp \
584 VMMAll/CPUMAllMsrs.cpp \
585 VMMAll/CPUMStack.cpp \
586 VMMAll/DBGFAll.cpp \
587 VMMAll/EMAll.cpp \
588 VMMAll/EMAllA.asm \
589 VMMAll/FTMAll.cpp \
590 VMMAll/GIMAll.cpp \
591 VMMAll/GIMAllHv.cpp \
592 VMMAll/GIMAllKvm.cpp \
593 VMMAll/HMAll.cpp \
594 VMMAll/IEMAll.cpp \
595 VMMAll/IEMAllAImpl.asm \
596 VMMAll/IEMAllAImplC.cpp \
597 VMMAll/IOMAll.cpp \
598 VMMAll/IOMAllMMIO.cpp \
599 VMMAll/MMAll.cpp \
600 VMMAll/MMAllHyper.cpp \
601 VMMAll/MMAllPagePool.cpp \
602 VMMAll/PDMAll.cpp \
603 VMMAll/PDMAllCritSect.cpp \
604 VMMAll/PDMAllCritSectRw.cpp \
605 VMMAll/PDMAllCritSectBoth.cpp \
606 VMMAll/PDMAllQueue.cpp \
607 VMMAll/PGMAll.cpp \
608 VMMAll/PGMAllHandler.cpp \
609 VMMAll/PGMAllMap.cpp \
610 VMMAll/PGMAllPhys.cpp \
611 VMMAll/PGMAllPool.cpp \
612 VMMAll/REMAll.cpp \
613 VMMAll/SELMAll.cpp \
614 VMMAll/TMAll.cpp \
615 VMMAll/TMAllCpu.cpp \
616 VMMAll/TMAllReal.cpp \
617 VMMAll/TMAllVirtual.cpp \
618 VMMAll/TRPMAll.cpp \
619 VMMAll/VMAll.cpp \
620 VMMAll/VMMAll.cpp \
621 VMMAll/VMMAllA.asm
622 if1of ($(VBOX_LDR_FMT), pe lx)
623 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
624 endif
625 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
626 VMMR0_SOURCES += \
627 VMMR0/VMMR0TripleFaultHack.cpp \
628 VMMR0/VMMR0TripleFaultHackA.asm
629 endif
630 ifdef VBOX_WITH_NETSHAPER
631 VMMR0_SOURCES += \
632 VMMAll/PDMAllNetShaper.cpp
633 endif
634 VMMR0_SOURCES.amd64 = \
635 VMMR0/VMMR0JmpA-amd64.asm
636 VMMR0_SOURCES.x86 = \
637 VMMR0/VMMR0JmpA-x86.asm
638 VMMR0_SOURCES.darwin.x86 = \
639 VMMRZ/PGMRZDynMap.cpp
640
641 VMMR0_LIBS = \
642 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
643 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
644 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
645 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
646 VMMR0_LIBS += \
647 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
648 endif
649
650 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
651endif # !VBOX_ONLY_EXTPACKS
652
653
654ifndef VBOX_ONLY_EXTPACKS
655 #
656 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
657 #
658 LIBRARIES += SSMStandalone
659 SSMStandalone_TEMPLATE = VBOXR3EXE
660 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
661 SSMStandalone_INCS = include
662 SSMStandalone_SOURCES = \
663 VMMR3/SSM.cpp \
664 VMMR3/CPUMR3Db.cpp
665endif # !VBOX_ONLY_EXTPACKS
666
667
668if !defined(VBOX_ONLY_EXTPACKS) \
669 && ( defined(VBOX_WITH_DTRACE_R3) \
670 || defined(VBOX_WITH_DTRACE_R0) \
671 || defined(VBOX_WITH_DTRACE_RC))
672 #
673 # Install the dtrace library files.
674 #
675 INSTALLS += VMMLibDTrace
676 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
677 VMMLibDTrace_SOURCES = \
678 dtrace/lib/vbox-types.d \
679 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
680 $(VMMLibDTrace_0_OUTDIR)/vm.d \
681 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
682 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
683 $(VMMLibDTrace_0_OUTDIR)/x86.d \
684
685
686 ##
687 # Turn the header $2 into the DTrace library script $1.
688 #
689 define def_vmm_lib_dtrace_preprocess
690 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
691 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
692 $$(QUIET)$(VBOX_VBOXCPP) -d \
693 -D VBOX_FOR_DTRACE_LIB \
694 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
695 -D IN_RING0 \
696 -D RT_C_DECLS_BEGIN= \
697 -D RT_C_DECLS_END= \
698 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
699 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
700 -D 'R0PTRTYPE(a_Type)=a_Type' \
701 -D 'AssertCompile(a_Expr)=' \
702 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
703 -D 'bool=uint8_t' \
704 $$(foreach def,\
705 $$(DEFS) \
706 $$(DEFS.$$(KBUILD_TARGET)) \
707 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
708 $$(VMM_COMMON_DEFS) \
709 $$(ARCH_BITS_DEFS)\
710 ,-D '$$(def)') \
711 $$< \
712 $$@
713 $$(QUIET)$$(CHMOD) 644 $$@
714 endef
715 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
716 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
717 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
718 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
719
720endif
721
722
723
724#
725# For vmmGetSvnRev.
726#
727VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
728
729#
730# Disable annoying warnings about array subscript above array bounds in aPages[]
731#
732ifneq ($(KBUILD_TARGET),win)
733 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
734 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
735 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
736 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-parameter
737endif
738
739#
740# Always optimize the interpreter.
741#
742ifn1of ($(USERNAME),bird)
743if1of ($(KBUILD_TARGET), win)
744 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
745 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
746 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
747 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
748else
749 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
750 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
751 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
752 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?)
753endif
754endif # bird wants good stacks
755
756
757# Alias the CPU database entries.
758$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
759
760
761#
762# Test for undefined symbols.
763#
764if1of ($(SYSMODS),VMMRC)
765 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
766 OTHERS += $(PATH_TARGET)/undef-rc.run
767 CLEANS += $(PATH_TARGET)/undef-rc.run
768 $(PATH_TARGET)/undef-rc.run: \
769 $$(VMMRC_1_TARGET)
770 ifn1of ($(KBUILD_TARGET), linux solaris)
771 else
772 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
773 $(QUIET)$(VBOX_NM) $^ 2> /dev/null \
774 | $(SED) -n \
775 -e '/^ *U .*/!d' \
776 -e 's/ *U //' \
777 \
778 -e '/^g_VM\>/d'\
779 -e '/^g_CPUM\>/d'\
780 -e '/^g_Logger\>/d'\
781 -e '/^g_RelLogger\>/d'\
782 -e '/^g_TRPM\>/d'\
783 -e '/^g_TRPMCPU\>/d'\
784 -e '/^g_pSUPGlobalInfoPage\>/d'\
785 -e '/^g_trpmHyperCtxCore\>/d' \
786 -e '/^g_trpmGuestCtxCore\>/d' \
787 \
788 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
789 -e 'p' \
790 -e 'q 1'
791 endif
792 $(QUIET)$(APPEND) -t $@
793endif
794
795include $(FILE_KBUILD_SUB_FOOTER)
796
797
798# Alias the PGM templates to the object in which they are defined.
799PGMInternal.o \
800PGMBth.o PGMGst.o PGMShw.o \
801PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
802
803PGMAllBth.o PGMAllGst.o PGMAllShw.o \
804PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
805
806PGMRCBth.o PGMRCGst.o PGMRCShw.o \
807PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
808
809PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
810
811PGMInline.o PGMInline.obj: PGMDbg.o
812
813# Alias the IEM templates to the object in which they are instantiated.
814IEMInternal.o \
815IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
816IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
817IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
818
819# Alias the switcher templates.
820PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
821LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
822AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
823
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