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