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