VirtualBox

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

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

IEM: Playing with setjmp (disabled) vs return codes. Group6 jump table.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.8 KB
Line 
1# $Id: Makefile.kmk 61885 2016-06-26 22:12:23Z 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
334if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
335 VBoxVMM_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
336endif
337
338$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
339
340
341if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
342
343 #
344 # VMMRCBuiltin.lib
345 #
346 LIBRARIES += VMMRCBuiltin
347 VMMRCBuiltin_TEMPLATE = VBoxRc
348 ifeq ($(VBOX_LDR_FMT32),pe)
349 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
350 endif
351 ifeq ($(VBOX_LDR_FMT32),lx)
352 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
353 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
354 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
355 endif
356
357
358 #
359 # VMMRCImp.lib
360 #
361 LIBRARIES += VMMRCImp
362 VMMRCImp_TEMPLATE = VBoxRc
363 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
364 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
365
366 $$(VMMRCImp_0_OUTDIR)/VMMRC.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRC.def | $$(dir $$@)
367 ifeq ($(VBOX_LDR_FMT32),lx)
368 $(SED) \
369 -e '/not-os2/d' \
370 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
371 -e 's/[ \t]DATA[ \t]*/ /' \
372 --output $@ \
373 $<
374 $(APPEND) "$@" ""
375 $(APPEND) "$@" " ___ehInit"
376 else
377 $(SED) \
378 -e '/not-win/d' \
379 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
380 --output $@ $<
381 endif
382
383endif # RC && (pe || lx)
384
385
386if1of ($(VBOX_LDR_FMT), pe lx)
387 #
388 # VMMR0Imp.lib
389 #
390 LIBRARIES += VMMR0Imp
391 VMMR0Imp_TEMPLATE = VBoxR0
392 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
393 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
394 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
395 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
396 endif
397
398 $$(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(PATH_SUB_CURRENT)/VMMR0/VMMR0.def | $$(dir $$@)
399 ifeq ($(VBOX_LDR_FMT),lx)
400 $(SED) \
401 -e '/not-os2/d' \
402 -e '/not-amd64/d' \
403 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
404 -e 's/[ \t]DATA[ \t]*/ /' \
405 --output $@ $<
406 $(APPEND) "$@" ""
407 $(APPEND) "$@" " ___ehInit"
408 else
409 $(SED) \
410 -e '/not-win/d' \
411 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
412 --output $@ $<
413 endif
414endif # R0: pe + lx
415
416
417#
418# VMMR3Imp.lib
419#
420IMPORT_LIBS += VMMR3Imp
421$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
422
423ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
424 #
425 # VMMR3LazyImp.lib (experimental)
426 #
427 LIBRARIES += VMMR3LazyImp
428 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
429 VMMR3LazyImp_INST = $(INST_LIB)
430 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
431 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
432 $$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(PATH_SUB_CURRENT)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
433 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $<
434endif
435
436
437if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
438 #
439 # VMMRC.rc
440 #
441 SYSMODS += VMMRC
442 VMMRC_TEMPLATE = VBoxRc
443 VMMRC_NAME = VMMRC
444
445 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 \
446 $(VMM_COMMON_DEFS)
447 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
448 VMMRC_DEFS += VMM_R0_SWITCH_STACK
449 endif
450
451 VMMRC_INCS := \
452 include \
453 VMMRC \
454 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
455
456 VMMRC_LIBS = \
457 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
458 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
459 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
460 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
461 VMMRC_LIBS += \
462 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
463 endif
464
465 VMMRC_SOURCES = \
466 VBoxVMM.d \
467 VMMRC/VMMRC0.asm \
468 VMMRC/VMMRCDeps.cpp \
469 VMMRC/CPUMRC.cpp \
470 VMMRC/CPUMRCA.asm \
471 VMMRC/CPUMRCPatchHlp.asm \
472 VMMRC/EMRCA.asm \
473 VMMRC/IOMRC.cpp \
474 VMMRC/MMRamRC.cpp \
475 VMMRC/MMRamRCA.asm \
476 VMMRC/PDMRCDevice.cpp \
477 VMMRC/PGMRC.cpp \
478 VMMRC/SELMRC.cpp \
479 VMMRC/TRPMRC.cpp \
480 VMMRC/TRPMRCHandlers.cpp \
481 VMMRC/TRPMRCHandlersA.asm \
482 VMMRC/VMMRC.cpp \
483 VMMRC/VMMRCA.asm \
484 $(if-expr defined(VBOX_WITH_RAW_MODE), \
485 VMMRC/CSAMRC.cpp \
486 VMMRC/PATMRC.cpp \
487 ,) \
488 VMMRZ/CPUMRZ.cpp \
489 VMMRZ/CPUMRZA.asm \
490 VMMRZ/DBGFRZ.cpp \
491 VMMRZ/PGMRZDynMap.cpp \
492 VMMRZ/VMMRZ.cpp \
493 VMMAll/CPUMAllRegs.cpp \
494 VMMAll/CPUMAllMsrs.cpp \
495 VMMAll/DBGFAll.cpp \
496 VMMAll/IEMAll.cpp \
497 VMMAll/IEMAllAImpl.asm \
498 VMMAll/IEMAllAImplC.cpp \
499 VMMAll/IOMAll.cpp \
500 VMMAll/IOMAllMMIO.cpp \
501 VMMAll/EMAll.cpp \
502 VMMAll/EMAllA.asm \
503 VMMAll/FTMAll.cpp \
504 VMMAll/GIMAll.cpp \
505 VMMAll/GIMAllHv.cpp \
506 VMMAll/GIMAllKvm.cpp \
507 VMMAll/MMAll.cpp \
508 VMMAll/MMAllHyper.cpp \
509 VMMAll/PDMAll.cpp \
510 VMMAll/PDMAllCritSect.cpp \
511 VMMAll/PDMAllCritSectRw.cpp \
512 VMMAll/PDMAllCritSectBoth.cpp \
513 VMMAll/PDMAllQueue.cpp \
514 VMMAll/PGMAll.cpp \
515 VMMAll/PGMAllHandler.cpp \
516 VMMAll/PGMAllMap.cpp \
517 VMMAll/PGMAllPhys.cpp \
518 VMMAll/PGMAllPool.cpp \
519 VMMAll/REMAll.cpp \
520 VMMAll/SELMAll.cpp \
521 VMMAll/TMAll.cpp \
522 VMMAll/TMAllCpu.cpp \
523 VMMAll/TMAllReal.cpp \
524 VMMAll/TMAllVirtual.cpp \
525 VMMAll/TRPMAll.cpp \
526 VMMAll/VMAll.cpp \
527 VMMAll/VMMAll.cpp \
528 VMMAll/VMMAllA.asm \
529 $(if-expr defined(VBOX_WITH_RAW_MODE), \
530 VMMAll/CSAMAll.cpp \
531 VMMAll/PATMAll.cpp \
532 ,)
533 ifeq ($(VBOX_LDR_FMT32),pe)
534 VMMRC_SOURCES += VMMRC/VMMRC.def
535 endif
536 ifeq ($(VBOX_LDR_FMT32),lx)
537 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
538 endif
539 ifdef VBOX_WITH_NEW_APIC
540 VMMRC_SOURCES += VMMAll/APICAll.cpp
541 endif
542
543 # the very last one.
544 VMMRC_SOURCES += VMMRC/VMMRC99.asm
545
546 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
547
548 $(call VBOX_SET_VER_INFO_RC,VMMRC,VirtualBox VMM - raw-mode context parts) # Version info / description.
549
550 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
551 VMMRC_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
552 endif
553endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
554
555
556ifndef VBOX_ONLY_EXTPACKS
557 #
558 # VMMR0.r0
559 #
560 SYSMODS += VMMR0
561 VMMR0_TEMPLATE = VBoxR0
562 VMMR0_SYSSUFF = .r0
563
564 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
565 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
566 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
567 ifdef VBOX_WITH_PCI_PASSTHROUGH
568 VMMR0_DEFS += IN_PCIRAW_R0
569 endif
570 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
571 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
572 endif
573 ifdef VBOX_WITH_RAW_MODE
574 VMMR0_DEFS += VBOX_WITH_RAW_MODE
575 endif
576 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
577 VMMR0_DEFS += VMM_R0_SWITCH_STACK
578 endif
579 if1of ($(KBUILD_TARGET), darwin linux win)
580 VMMR0_DEFS += VMM_R0_TOUCH_FPU
581 endif
582 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
583 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
584
585 ifeq ($(VBOX_LDR_FMT),elf)
586 VMMR0_CXXFLAGS += $(filter-out -Wno-unused,$(TEMPLATE_VBoxR0_CXXFLAGS)) -Wunused-variable -Wno-unused-parameter
587 endif
588
589 VMMR0_INCS = \
590 include \
591 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,)
592
593 VMMR0_SOURCES = \
594 VBoxVMM.d \
595 VMMR0/CPUMR0.cpp \
596 VMMR0/CPUMR0A.asm \
597 VMMR0/GIMR0.cpp \
598 VMMR0/GIMR0Hv.cpp \
599 VMMR0/GIMR0Kvm.cpp \
600 VMMR0/GMMR0.cpp \
601 VMMR0/GVMMR0.cpp \
602 VMMR0/HMR0.cpp \
603 VMMR0/HMR0A.asm \
604 VMMR0/HMVMXR0.cpp \
605 VMMR0/HMSVMR0.cpp \
606 VMMR0/PDMR0Device.cpp \
607 VMMR0/PDMR0Driver.cpp \
608 VMMR0/PGMR0.cpp \
609 VMMR0/PGMR0SharedPage.cpp \
610 VMMR0/TRPMR0.cpp \
611 VMMR0/TRPMR0A.asm \
612 VMMR0/VMMR0.cpp \
613 VMMRZ/CPUMRZ.cpp \
614 VMMRZ/CPUMRZA.asm \
615 VMMRZ/DBGFRZ.cpp \
616 VMMRZ/VMMRZ.cpp \
617 VMMAll/CPUMAllRegs.cpp \
618 VMMAll/CPUMAllMsrs.cpp \
619 VMMAll/CPUMStack.cpp \
620 VMMAll/DBGFAll.cpp \
621 VMMAll/EMAll.cpp \
622 VMMAll/EMAllA.asm \
623 VMMAll/FTMAll.cpp \
624 VMMAll/GIMAll.cpp \
625 VMMAll/GIMAllHv.cpp \
626 VMMAll/GIMAllKvm.cpp \
627 VMMAll/HMAll.cpp \
628 VMMAll/IEMAll.cpp \
629 VMMAll/IEMAllAImpl.asm \
630 VMMAll/IEMAllAImplC.cpp \
631 VMMAll/IOMAll.cpp \
632 VMMAll/IOMAllMMIO.cpp \
633 VMMAll/MMAll.cpp \
634 VMMAll/MMAllHyper.cpp \
635 VMMAll/MMAllPagePool.cpp \
636 VMMAll/PDMAll.cpp \
637 VMMAll/PDMAllCritSect.cpp \
638 VMMAll/PDMAllCritSectRw.cpp \
639 VMMAll/PDMAllCritSectBoth.cpp \
640 VMMAll/PDMAllQueue.cpp \
641 VMMAll/PGMAll.cpp \
642 VMMAll/PGMAllHandler.cpp \
643 VMMAll/PGMAllMap.cpp \
644 VMMAll/PGMAllPhys.cpp \
645 VMMAll/PGMAllPool.cpp \
646 VMMAll/REMAll.cpp \
647 VMMAll/SELMAll.cpp \
648 VMMAll/TMAll.cpp \
649 VMMAll/TMAllCpu.cpp \
650 VMMAll/TMAllReal.cpp \
651 VMMAll/TMAllVirtual.cpp \
652 VMMAll/TRPMAll.cpp \
653 VMMAll/VMAll.cpp \
654 VMMAll/VMMAll.cpp \
655 VMMAll/VMMAllA.asm
656 if1of ($(VBOX_LDR_FMT), pe lx)
657 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
658 endif
659 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
660 VMMR0_SOURCES += \
661 VMMR0/VMMR0TripleFaultHack.cpp \
662 VMMR0/VMMR0TripleFaultHackA.asm
663 endif
664 ifdef VBOX_WITH_NETSHAPER
665 VMMR0_SOURCES += \
666 VMMAll/PDMAllNetShaper.cpp
667 endif
668 ifdef VBOX_WITH_NEW_APIC
669 VMMR0_SOURCES += \
670 VMMAll/APICAll.cpp
671 endif
672 VMMR0_SOURCES.amd64 = \
673 VMMR0/VMMR0JmpA-amd64.asm
674 VMMR0_SOURCES.x86 = \
675 VMMR0/VMMR0JmpA-x86.asm
676
677 VMMR0_LIBS = \
678 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
679 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
680 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
681 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
682 VMMR0_LIBS += \
683 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
684 endif
685
686 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
687
688 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
689 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
690 endif
691endif # !VBOX_ONLY_EXTPACKS
692
693
694
695ifndef VBOX_ONLY_EXTPACKS
696 #
697 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
698 #
699 LIBRARIES += SSMStandalone
700 SSMStandalone_TEMPLATE = VBOXR3EXE
701 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
702 SSMStandalone_INCS = include
703 SSMStandalone_SOURCES = \
704 VMMR3/SSM.cpp \
705 VMMR3/CPUMR3Db.cpp
706endif # !VBOX_ONLY_EXTPACKS
707
708
709if !defined(VBOX_ONLY_EXTPACKS) \
710 && ( defined(VBOX_WITH_DTRACE_R3) \
711 || defined(VBOX_WITH_DTRACE_R0) \
712 || defined(VBOX_WITH_DTRACE_RC))
713 #
714 # Install the dtrace library files.
715 #
716 INSTALLS += VMMLibDTrace
717 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
718 VMMLibDTrace_SOURCES = \
719 dtrace/lib/vbox-types.d \
720 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
721 $(VMMLibDTrace_0_OUTDIR)/vm.d \
722 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
723 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
724 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
725 $(VMMLibDTrace_0_OUTDIR)/x86.d \
726
727
728 ##
729 # Turn the header $2 into the DTrace library script $1.
730 #
731 define def_vmm_lib_dtrace_preprocess
732 $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
733 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
734 $$(QUIET)$(VBOX_VBOXCPP) -d \
735 -D VBOX_FOR_DTRACE_LIB \
736 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
737 -D IN_RING0 \
738 -D RT_C_DECLS_BEGIN= \
739 -D RT_C_DECLS_END= \
740 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
741 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
742 -D 'R0PTRTYPE(a_Type)=a_Type' \
743 -D 'AssertCompile(a_Expr)=' \
744 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
745 -D 'bool=uint8_t' \
746 $$(foreach def,\
747 $$(DEFS) \
748 $$(DEFS.$$(KBUILD_TARGET)) \
749 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
750 $$(VMM_COMMON_DEFS) \
751 $$(ARCH_BITS_DEFS)\
752 ,-D '$$(def)') \
753 $$< \
754 $$@
755 $$(QUIET)$$(CHMOD) 644 $$@
756 endef
757 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
758 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
759 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
760 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
761 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
762
763endif
764
765
766
767#
768# For vmmGetSvnRev.
769#
770VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
771
772#
773# Disable annoying warnings about array subscript above array bounds in aPages[]
774#
775ifneq ($(KBUILD_TARGET),win)
776 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
777 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
778 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
779 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
780 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
781endif
782
783#
784# Always optimize the interpreter.
785#
786ifn1of ($(USERNAME),bird)
787if1of ($(KBUILD_TARGET), win)
788 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
789 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
790 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
791 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
792else
793 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
794 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
795 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
796 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?)
797endif
798endif # bird wants good stacks
799
800
801# Alias the CPU database entries.
802$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
803
804
805#
806# Test for undefined symbols.
807#
808if1of ($(SYSMODS),VMMRC)
809 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
810 OTHERS += $(PATH_TARGET)/undef-rc.run
811 CLEANS += $(PATH_TARGET)/undef-rc.run
812 $(PATH_TARGET)/undef-rc.run: \
813 $$(VMMRC_1_TARGET)
814 ifn1of ($(KBUILD_TARGET), linux solaris)
815 else
816 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
817 $(QUIET)$(VBOX_NM) $^ 2> /dev/null \
818 | $(SED) -n \
819 -e '/^ *U .*/!d' \
820 -e 's/ *U //' \
821 \
822 -e '/^g_VM\>/d'\
823 -e '/^g_CPUM\>/d'\
824 -e '/^g_Logger\>/d'\
825 -e '/^g_RelLogger\>/d'\
826 -e '/^g_TRPM\>/d'\
827 -e '/^g_TRPMCPU\>/d'\
828 -e '/^g_pSUPGlobalInfoPage\>/d'\
829 -e '/^g_trpmHyperCtxCore\>/d' \
830 -e '/^g_trpmGuestCtxCore\>/d' \
831 \
832 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
833 -e 'p' \
834 -e 'q 1'
835 endif
836 $(QUIET)$(APPEND) -t $@
837endif
838
839include $(FILE_KBUILD_SUB_FOOTER)
840
841
842# Alias the PGM templates to the object in which they are defined.
843PGMInternal.o \
844PGMBth.o PGMGst.o PGMShw.o \
845PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
846
847PGMAllBth.o PGMAllGst.o PGMAllShw.o \
848PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
849
850PGMRCBth.o PGMRCGst.o PGMRCShw.o \
851PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
852
853PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
854
855PGMInline.o PGMInline.obj: PGMDbg.o
856
857# Alias the IEM templates to the object in which they are instantiated.
858IEMInternal.o \
859IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
860IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
861IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAll.o
862
863# Alias the switcher templates.
864PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
865LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
866AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
867
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