VirtualBox

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

Last change on this file since 61728 was 61671, checked in by vboxsync, 8 years ago

VMM/DBGF: Start on a simple type system to pretty print structs in the guest later on, work in progress

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