VirtualBox

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

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

VMM: APIC rewrite. Initial commit, work in progress.

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