VirtualBox

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

Last change on this file since 106683 was 106533, checked in by vboxsync, 6 weeks ago

VMM/Makefile.kmk: scm fix. bugref:10720

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 43.7 KB
Line 
1# $Id: Makefile.kmk 106533 2024-10-21 00:11:57Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
4#
5
6#
7# Copyright (C) 2006-2024 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31# Include our Config.kmk if kmk is invoked from a parent directory.
32ifndef VBOX_VMM_CONFIG_KMK_INCLUDED
33 include $(PATH_SUB_CURRENT)/Config.kmk
34endif
35
36# Include sub-makefiles.
37ifndef VBOX_ONLY_EXTPACKS
38 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
39 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
40endif
41
42
43# Fail on unsupported hosts.
44ifeq ($(KBUILD_TARGET_ARCH),x86)
45 ifeq ($(KBUILD_TARGET),darwin)
46 $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit host support.)
47 else ifeq ($(KBUILD_TARGET),solaris)
48 $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit host support.)
49 else ifn1of ($(KBUILD_TARGET_ARCH), $(VBOX_SUPPORTED_HOST_ARCHS))
50 $(error 32-bit builds of the VirtualBox host are no longer supported. Go back to 6.0 or older for 32-bit host support.)
51 endif
52endif
53
54
55#
56# The VMM DLL.
57#
58ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
59 DLLS += VBoxVMM
60endif
61VBoxVMM_TEMPLATE = VBoxR3DllNoPic
62VBoxVMM_SONAME.linux = VBoxVMM.so
63
64VBoxVMM_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
65## @todo eliminate IN_GMM_R3
66ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
67 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
68endif
69ifdef VBOX_WITH_VUSB
70 VBoxVMM_DEFS += VBOX_WITH_USB
71endif
72ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
73 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
74endif
75ifdef VBOX_WITH_NETSHAPER
76 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
77endif
78ifdef VBOX_WITH_IOMMU_AMD
79 VBoxVMM_DEFS += VBOX_WITH_IOMMU_AMD
80endif
81ifdef VBOX_WITH_IOMMU_INTEL
82 VBoxVMM_DEFS += VBOX_WITH_IOMMU_INTEL
83endif
84ifdef VBOX_WITH_DBGF_TRACING
85 VBoxVMM_DEFS += VBOX_WITH_DBGF_TRACING
86endif
87ifdef VBOX_WITH_DBGF_FLOW_TRACING
88 VBoxVMM_DEFS += VBOX_WITH_DBGF_FLOW_TRACING
89endif
90if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird" && 0
91 VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
92endif
93
94VBoxVMM_SDKS = VBoxSoftFloatR3Shared
95
96VBoxVMM_INCS = \
97 include \
98 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
99VBoxVMM_ASINCS = .
100VBoxVMM_ASFLAGS.amd64 = -Werror
101VBoxVMM_ASFLAGS.x86 = -Werror
102if "$(VBOX_VCC_TOOL_STEM)" >= "VCC142" && "$(KBUILD_TYPE)" != "debug" # Agressive inlining for IEM performance. Adds ~2.6 MB.
103 VBoxVMM_CXXFLAGS.win = -Ob3
104endif
105
106VBoxVMM_SOURCES = \
107 VBoxVMM.d \
108 VMMR3/VMMR3VTable.cpp \
109 VMMR3/APIC.cpp \
110 VMMR3/CFGM.cpp \
111 VMMR3/CPUM.cpp \
112 VMMR3/CPUMR3CpuId.cpp \
113 VMMR3/CPUMR3Db.cpp \
114 VMMR3/CPUMDbg.cpp \
115 VMMR3/DBGF.cpp \
116 VMMR3/DBGFAddr.cpp \
117 VMMR3/DBGFAddrSpace.cpp \
118 VMMR3/DBGFR3Bp.cpp \
119 VMMR3/DBGFR3BugCheck.cpp \
120 VMMR3/DBGFCoreWrite.cpp \
121 VMMR3/DBGFCpu.cpp \
122 VMMR3/DBGFDisas.cpp \
123 VMMR3/DBGFInfo.cpp \
124 VMMR3/DBGFLog.cpp \
125 VMMR3/DBGFMem.cpp \
126 VMMR3/DBGFR3ModInMem.cpp \
127 VMMR3/DBGFOS.cpp \
128 VMMR3/DBGFR3PlugIn.cpp \
129 VMMR3/DBGFReg.cpp \
130 VMMR3/DBGFStack.cpp \
131 VMMR3/DBGFR3Flow.cpp \
132 $(if-expr defined(VBOX_WITH_DBGF_FLOW_TRACING), VMMR3/DBGFR3FlowTrace.cpp,) \
133 VMMR3/DBGFR3Trace.cpp \
134 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR3/DBGFR3Tracer.cpp,) \
135 VMMR3/DBGFR3SampleReport.cpp \
136 VMMR3/DBGFR3Type.cpp \
137 VMMR3/EM.cpp \
138 VMMR3/EMR3Dbg.cpp \
139 VMMR3/EMHM.cpp \
140 VMMR3/EMR3Nem.cpp \
141 VMMR3/GCM.cpp \
142 VMMR3/GIM.cpp \
143 VMMR3/GIMHv.cpp \
144 VMMR3/GIMKvm.cpp \
145 VMMR3/GIMMinimal.cpp \
146 VMMR3/IEMR3.cpp \
147 VMMR3/IOM.cpp \
148 VMMR3/IOMR3IoPort.cpp \
149 VMMR3/IOMR3Mmio.cpp \
150 VMMR3/GMM.cpp \
151 VMMR3/GVMMR3.cpp \
152 VMMR3/MM.cpp \
153 VMMR3/MMHeap.cpp \
154 VMMR3/NEMR3.cpp \
155 VMMR3/PDM.cpp \
156 VMMR3/PDMBlkCache.cpp \
157 VMMR3/PDMDevice.cpp \
158 VMMR3/PDMDevHlp.cpp \
159 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR3/PDMDevHlpTracing.cpp,) \
160 VMMR3/PDMDevMiscHlp.cpp \
161 VMMR3/PDMDriver.cpp \
162 VMMR3/PDMLdr.cpp \
163 VMMR3/PDMCritSect.cpp \
164 VMMR3/PDMQueue.cpp \
165 VMMR3/PDMR3Task.cpp \
166 VMMR3/PDMThread.cpp \
167 VMMR3/PGM.cpp \
168 VMMR3/PGMDbg.cpp \
169 VMMR3/PGMHandler.cpp \
170 VMMR3/PGMPhys.cpp \
171 VMMR3/PGMPool.cpp \
172 VMMR3/PGMSavedState.cpp \
173 VMMR3/PGMSharedPage.cpp \
174 VMMR3/SELM.cpp \
175 VMMR3/SSM.cpp \
176 VMMR3/STAM.cpp \
177 VMMR3/TM.cpp \
178 VMMR3/TRPM.cpp \
179 VMMR3/VM.cpp \
180 VMMR3/VMEmt.cpp \
181 VMMR3/VMReq.cpp \
182 VMMR3/VMM.cpp \
183 VMMR3/VMMGuruMeditation.cpp \
184 VMMR3/VMMTests.cpp \
185 VMMR3/HM.cpp \
186 VMMAll/APICAll.cpp \
187 VMMAll/CPUMAllCpuId.cpp \
188 VMMAll/CPUMAllRegs.cpp \
189 VMMAll/CPUMAllMsrs.cpp \
190 VMMAll/DBGFAll.cpp \
191 VMMAll/DBGFAllBp.cpp \
192 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
193 VMMAll/HMAll.cpp \
194 VMMAll/HMSVMAll.cpp \
195 VMMAll/HMVMXAll.cpp \
196 VMMAll/IEMAll.cpp \
197 VMMAll/IEMAllIntprTables1.cpp \
198 VMMAll/IEMAllIntprTables2.cpp \
199 VMMAll/IEMAllIntprTables3.cpp \
200 VMMAll/IEMAllIntprTables4.cpp \
201 VMMAll/IEMAllAImplC.cpp \
202 VMMAll/IEMAllCImpl.cpp \
203 VMMAll/IEMAllCImplSvmInstr.cpp \
204 VMMAll/IEMAllCImplVmxInstr.cpp \
205 VMMAll/IEMAllDbg.cpp \
206 VMMAll/IOMAll.cpp \
207 VMMAll/IOMAllMmioNew.cpp \
208 VMMAll/MMAll.cpp \
209 VMMAll/NEMAll.cpp \
210 VMMAll/PDMAll.cpp \
211 VMMAll/PDMAllCritSect.cpp \
212 VMMAll/PDMAllCritSectRw.cpp \
213 VMMAll/PDMAllCritSectBoth.cpp \
214 $(if-expr defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL), VMMAll/PDMAllIommu.cpp,) \
215 VMMAll/PDMAllQueue.cpp \
216 VMMAll/PDMAllTask.cpp \
217 VMMAll/PGMAll.cpp \
218 VMMAll/PGMAllHandler.cpp \
219 VMMAll/PGMAllPhys.cpp \
220 VMMAll/PGMAllPool.cpp \
221 VMMAll/SELMAll.cpp \
222 VMMAll/EMAll.cpp \
223 VMMAll/GCMAll.cpp \
224 VMMAll/GIMAll.cpp \
225 VMMAll/GIMAllHv.cpp \
226 VMMAll/GIMAllKvm.cpp \
227 VMMAll/TMAll.cpp \
228 VMMAll/TMAllCpu.cpp \
229 VMMAll/TMAllReal.cpp \
230 VMMAll/TMAllVirtual.cpp \
231 VMMAll/TRPMAll.cpp \
232 VMMAll/VMAll.cpp \
233 VMMAll/VMMAll.cpp
234VBoxVMM_SOURCES.amd64 += \
235 VMMR3/PGMR3DbgA.asm \
236 $(if-expr !defined(IEM_WITHOUT_ASSEMBLY),VMMAll/IEMAllAImpl.asm,) \
237 VMMAll/VMMAllA.asm
238VBoxVMM_SOURCES.arm64 += \
239 VMMAll/IEMAllAImpl-arm64.S
240ifdef VBOX_WITH_VUSB
241 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
242endif
243ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
244 VBoxVMM_SOURCES += \
245 VMMR3/PDMAsyncCompletion.cpp \
246 VMMR3/PDMAsyncCompletionFile.cpp \
247 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
248 VMMR3/PDMAsyncCompletionFileNormal.cpp
249endif
250ifdef VBOX_WITH_NETSHAPER
251 VBoxVMM_SOURCES += \
252 VMMR3/PDMNetShaper.cpp \
253 VMMAll/PDMAllNetShaper.cpp
254endif
255
256ifdef VBOX_WITH_IEM_RECOMPILER
257 VBoxVMM_SOURCES += \
258 VMMAll/IEMAllThrdRecompiler.cpp \
259 VMMAll/IEMAllThrdTables1.cpp \
260 VMMAll/IEMAllThrdTables2.cpp \
261 VMMAll/IEMAllThrdTables3.cpp \
262 VMMAll/IEMAllThrdTables4.cpp \
263 VMMAll/IEMAllThrdFuncs.cpp \
264 VMMAll/IEMAllThrdFuncsBltIn.cpp
265 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
266 VBoxVMM_SOURCES += \
267 VMMAll/IEMAllN8veExecMem.cpp \
268 VMMAll/IEMAllN8veRecompiler.cpp \
269 VMMAll/IEMAllN8veRecompFuncs1.cpp \
270 VMMAll/IEMAllN8veRecompFuncs2.cpp \
271 VMMAll/IEMAllN8veRecompFuncs3.cpp \
272 VMMAll/IEMAllN8veRecompFuncs4.cpp \
273 VMMAll/IEMAllN8veRecompFuncs5.cpp \
274 VMMAll/IEMAllN8veRecompFuncs6.cpp \
275 VMMAll/IEMAllN8veRecompBltIn.cpp \
276 VMMAll/IEMAllN8veLiveness1.cpp \
277 VMMAll/IEMAllN8veLiveness2.cpp \
278 VMMAll/IEMAllN8veLiveness3.cpp \
279 VMMAll/IEMAllN8veLiveness4.cpp \
280 VMMAll/IEMAllN8veLiveness5.cpp \
281 VMMAll/IEMAllN8veLiveness6.cpp
282 VBoxVMM_SOURCES.amd64 += \
283 VMMAll/IEMAllN8veHlpA.asm
284 VBoxVMM_SOURCES.arm64 += \
285 VMMAll/IEMAllN8veHlpA-arm64.S
286 if "$(KBUILD_TARGET_ARCH)" == "arm64" && defined(VBOX_WITH_IEM_USING_CAPSTONE_DISASSEMBLER) # temp hack
287 VBoxVMM_DEFS += VBOX_WITH_IEM_USING_CAPSTONE_DISASSEMBLER
288 VBoxVMM_LIBS.darwin += /opt/local/lib/libcapstone.dylib
289 VBoxVMM_LIBS.linux += capstone
290 endif
291 VMMAll/IEMAllN8veRecompiler.cpp_CXXFLAGS.win := -bigobj
292 endif
293 VMMAll/IEMAllThrdFuncs.cpp_CXXFLAGS.win := -bigobj
294endif
295
296ifdef VBOX_WITH_NATIVE_NEM
297 VBoxVMM_SOURCES.linux.amd64 += VMMR3/NEMR3Native-linux.cpp
298
299 VBoxVMM_SOURCES.win.amd64 += VMMR3/NEMR3Native-win.cpp
300 VBoxVMM_DEFS.win.amd64 += VBOX_WITH_NATIVE_NEM
301 VBoxVMM_SDKS.win += VBoxNtDll
302 VMMR3/NEMR3Native-win.cpp_DEFS.amd64 = _AMD64_
303 VMMR3/NEMR3Native-win.cpp_INCS = \
304 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
305 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
306
307 VBoxVMM_SOURCES.darwin.amd64 += \
308 VMMR3/NEMR3Native-darwin.cpp
309 VBoxVMM_DEFS.darwin.amd64 += VBOX_WITH_NATIVE_NEM
310endif
311
312VBoxVMM_LIBS = \
313 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
314ifdef VBOX_WITH_DEBUGGER
315 VBoxVMM_LIBS += \
316 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
317endif
318VBoxVMM_LIBS += \
319 $(LIB_REM) \
320 $(LIB_RUNTIME)
321
322VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
323VBoxVMM_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED)
324VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
325VBoxVMM_LDFLAGS.solaris = -mimpure-text
326
327# SSM wish to know the build type, host os and arch.
328ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
329 VMMR3/SSM.cpp_DEFS += \
330 KBUILD_TYPE="$(KBUILD_TYPE)" \
331 KBUILD_TARGET="$(KBUILD_TARGET)" \
332 KBUILD_TARGET_ARCH="$(KBUILD_TARGET_ARCH)"
333else
334 VMMR3/SSM.cpp_DEFS += \
335 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
336 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
337 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
338endif
339
340ifdef VBOX_WITH_GCC_SANITIZER
341 VMMR3/PGMPool.cpp_CXXFLAGS.linux += -fno-sanitize=address
342endif
343
344#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
345# ifeq ($(KBUILD_HOST), linux)
346#VBoxVMM_LIBS += aio
347# endif
348#endif
349
350if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
351 VBoxVMM_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
352 VBoxVMM_VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
353 VBoxVMM_VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
354 #VBoxVMM_VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
355 #VBoxVMM_VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
356 VBoxVMM_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
357 VBoxVMM_VMMAll/IEMAllN8veExecMem.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
358 VBoxVMM_VMMAll/IEMAllN8veRecompiler.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
359 VBoxVMM_VMMAll/IEMAllN8veRecompFuncs1.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
360 #VBoxVMM_VMMAll/IEMAllN8veRecompFuncs2.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
361 VBoxVMM_VMMAll/IEMAllN8veRecompBltIn.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
362 VBoxVMM_VMMAll/IEMAllN8veLiveness1.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
363 #VBoxVMM_VMMAll/IEMAllN8veLiveness2.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
364 VBoxVMM_VMMAll/IEMAllThrdRecompiler.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
365 VBoxVMM_VMMAll/IEMAllThrdFuncsBltIn.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
366 VBoxVMM_VMMAll/IEMAllThrdTables1.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
367 #VBoxVMM_VMMAll/IEMAllThrdFuncs.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
368 VBoxVMM_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
369 VBoxVMM_VMMAll/PDMAllCritSect.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
370
371 VBoxVMM_CLEAN += $(addprefix $(VBoxVMM_0_OUTDIR)/VMMAll/, \
372 IEMAll.cod IEMAllIntprTables1.cod IEMAllIntprTables2.cod IEMAllIntprTables3.cod IEMAllIntprTables4.cod IEMAllAImplC.cod \
373 IEMAllN8veExecMem.cod IEMAllN8veRecompiler.cod IEMAllN8veRecompFuncs1.cod IEMAllN8veRecompFuncs2.cod \
374 IEMAllThrdRecompiler.cod IEMAllThrdFuncsBltIn.cod IEMAllThrdTables1.cod IEMAllThrdFuncs.cod \
375 IEMAllN8veRecompBltIn.cod IEMAllN8veLiveness1.cod IEMAllN8veLiveness2.cod PGMAll.cod PDMAllCritSect.cod)
376endif
377
378$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
379
380ifdef VBOX_WITH_VIRT_ARMV8
381 #
382 # The VMM DLL - ARMv8 variant.
383 #
384 ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
385 DLLS += VBoxVMMArm
386 endif
387 VBoxVMMArm_TEMPLATE = VBoxR3DllNoPic
388 VBoxVMMArm_SONAME.linux = VBoxVMMArm.so
389
390 VBoxVMMArm_DEFS = VBOX_VMM_TARGET_ARMV8 VBOX_IN_VMM IN_VMM_R3 IN_DIS IN_DBG IN_GMM_R3 \
391 $(filter-out VBOX_WITH_IEM_RECOMPILER VBOX_WITH_IEM_NATIVE_RECOMPILER,$(VMM_COMMON_DEFS))
392 ifdef VBOX_WITH_VUSB
393 VBoxVMMArm_DEFS += VBOX_WITH_USB
394 endif
395 ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
396 VBoxVMMArm_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
397 endif
398 ifdef VBOX_WITH_NETSHAPER
399 VBoxVMMArm_DEFS += VBOX_WITH_NETSHAPER
400 endif
401 #ifdef VBOX_WITH_DBGF_TRACING
402 # VBoxVMMArm_DEFS += VBOX_WITH_DBGF_TRACING
403 #endif
404 #ifdef VBOX_WITH_DBGF_FLOW_TRACING @todo Later
405 # VBoxVMMArm_DEFS += VBOX_WITH_DBGF_FLOW_TRACING
406 #endif
407
408 VBoxVMMArm_INCS = \
409 include \
410 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
411 VBoxVMMArm_SOURCES = \
412 VBoxVMM.d \
413 VMMR3/VMMR3VTable.cpp \
414 VMMR3/CFGM.cpp \
415 VMMR3/CPUM-armv8.cpp \
416 VMMR3/CPUMDbg-armv8.cpp \
417 VMMR3/CPUMR3CpuId-armv8.cpp \
418 VMMR3/CPUMR3Db-armv8.cpp \
419 VMMR3/DBGF.cpp \
420 VMMR3/DBGFAddr.cpp \
421 VMMR3/DBGFAddrSpace.cpp \
422 VMMR3/DBGFR3Bp.cpp \
423 VMMR3/DBGFR3BugCheck.cpp \
424 VMMR3/DBGFCoreWrite.cpp \
425 VMMR3/DBGFCpu.cpp \
426 VMMR3/DBGFDisas.cpp \
427 VMMR3/DBGFInfo.cpp \
428 VMMR3/DBGFLog.cpp \
429 VMMR3/DBGFMem.cpp \
430 VMMR3/DBGFR3ModInMem.cpp \
431 VMMR3/DBGFOS.cpp \
432 VMMR3/DBGFR3PlugIn.cpp \
433 VMMR3/DBGFReg.cpp \
434 VMMR3/DBGFStack.cpp \
435 VMMR3/DBGFR3Flow.cpp \
436 VMMR3/DBGFR3FlowTrace.cpp \
437 VMMR3/DBGFR3Trace.cpp \
438 VMMR3/DBGFR3SampleReport.cpp \
439 VMMR3/DBGFR3Type.cpp \
440 VMMR3/EM.cpp \
441 VMMR3/EMR3Dbg.cpp \
442 VMMR3/EMR3Nem.cpp \
443 VMMR3/GICR3.cpp \
444 VMMR3/GIM.cpp \
445 VMMR3/IEMR3.cpp \
446 VMMR3/IOM.cpp \
447 VMMR3/IOMR3IoPort.cpp \
448 VMMR3/IOMR3Mmio.cpp \
449 VMMR3/GMM.cpp \
450 VMMR3/GVMMR3.cpp \
451 VMMR3/MM.cpp \
452 VMMR3/MMHeap.cpp \
453 VMMR3/NEMR3.cpp \
454 VMMR3/PDM.cpp \
455 VMMR3/PDMBlkCache.cpp \
456 VMMR3/PDMDevice.cpp \
457 VMMR3/PDMDevHlp.cpp \
458 VMMR3/PDMDevMiscHlp.cpp \
459 VMMR3/PDMDriver.cpp \
460 VMMR3/PDMLdr.cpp \
461 VMMR3/PDMCritSect.cpp \
462 VMMR3/PDMQueue.cpp \
463 VMMR3/PDMR3Task.cpp \
464 VMMR3/PDMThread.cpp \
465 VMMR3/PGM-armv8.cpp \
466 VMMR3/PGMDbg.cpp \
467 VMMR3/PGMHandler.cpp \
468 VMMR3/PGMPhys.cpp \
469 VMMR3/PGMPool.cpp \
470 VMMR3/PGMSavedState.cpp \
471 VMMR3/PGMSharedPage.cpp \
472 VMMR3/PMUR3.cpp \
473 VMMR3/SSM.cpp \
474 VMMR3/STAM.cpp \
475 VMMR3/TM.cpp \
476 VMMR3/TRPM.cpp \
477 VMMR3/VM.cpp \
478 VMMR3/VMEmt.cpp \
479 VMMR3/VMReq.cpp \
480 VMMR3/VMM.cpp \
481 VMMR3/VMMGuruMeditation.cpp \
482 VMMR3/VMMTests.cpp \
483 VMMR3/HM-armv8.cpp \
484 VMMAll/CPUMAllRegs-armv8.cpp \
485 VMMAll/CPUMAllSysRegs-armv8.cpp \
486 VMMAll/DBGFAll.cpp \
487 VMMAll/DBGFAllBp.cpp \
488 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
489 VMMAll/IEMAll-armv8.cpp \
490 VMMAll/IOMAll.cpp \
491 VMMAll/IOMAllMmioNew.cpp \
492 VMMAll/MMAll.cpp \
493 VMMAll/NEMAll.cpp \
494 VMMAll/PDMAll.cpp \
495 VMMAll/PDMAllCritSect.cpp \
496 VMMAll/PDMAllCritSectRw.cpp \
497 VMMAll/PDMAllCritSectBoth.cpp \
498 VMMAll/PDMAllQueue.cpp \
499 VMMAll/PDMAllTask.cpp \
500 VMMAll/PGMAllHandler.cpp \
501 VMMAll/PGMAllPhys.cpp \
502 VMMAll/PGMAllPool.cpp \
503 VMMAll/EMAll.cpp \
504 VMMAll/GICAll.cpp \
505 VMMAll/GIMAll.cpp \
506 VMMAll/PMUAll.cpp \
507 VMMAll/TMAll.cpp \
508 VMMAll/TMAllCpu.cpp \
509 VMMAll/TMAllReal.cpp \
510 VMMAll/TMAllVirtual.cpp \
511 VMMAll/TRPMAll.cpp \
512 VMMAll/VMAll.cpp \
513 VMMAll/VMMAll.cpp
514 ifdef VBOX_WITH_VUSB
515 VBoxVMMArm_SOURCES += VMMR3/PDMUsb.cpp
516 endif
517 ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
518 VBoxVMMArm_SOURCES += \
519 VMMR3/PDMAsyncCompletion.cpp \
520 VMMR3/PDMAsyncCompletionFile.cpp \
521 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
522 VMMR3/PDMAsyncCompletionFileNormal.cpp
523 endif
524 ifdef VBOX_WITH_NETSHAPER
525 VBoxVMMArm_SOURCES += \
526 VMMR3/PDMNetShaper.cpp \
527 VMMAll/PDMAllNetShaper.cpp
528 endif
529
530 VBoxVMMArm_SOURCES.darwin.arm64 += \
531 VMMR3/NEMR3Native-darwin-armv8.cpp \
532 VMMR3/GICR3Nem-darwin.cpp
533 VBoxVMMArm_DEFS.darwin.arm64 += VBOX_WITH_NATIVE_NEM
534 VBoxVMMArm_LDFLAGS.darwin.arm64 = -framework Hypervisor
535
536 VBoxVMMArm_SOURCES.linux.arm64 += \
537 VMMR3/NEMR3Native-linux-armv8.cpp \
538 VMMR3/GICR3Nem-linux.cpp
539 VBoxVMMArm_DEFS.linux.arm64 += VBOX_WITH_NATIVE_NEM
540
541 VBoxVMMArm_SOURCES.win.arm64 += \
542 VMMR3/NEMR3Native-win-armv8.cpp \
543 VMMR3/GICR3Nem-win.cpp
544 VBoxVMMArm_DEFS.win.arm64 += VBOX_WITH_NATIVE_NEM
545
546 VBoxVMMArm_LIBS = \
547 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
548 ifdef VBOX_WITH_DEBUGGER
549 VBoxVMMArm_LIBS += \
550 $(PATH_STAGE_LIB)/Debugger-armv8$(VBOX_SUFF_LIB)
551 endif
552 VBoxVMMArm_LIBS += \
553 $(LIB_RUNTIME)
554
555 VBoxVMMArm_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMMArm.dylib
556endif
557
558$(call KB_FN_DO_PASS0_ON_TARGET,VBoxVMM)
559$(evalcall2 def_VBoxGenIEMInstructionStatisticsTmpl_Header,VBoxVMM,$(VBoxVMM_0_OUTDIR)/CommonGenIncs)
560foobar: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
561
562
563ifdef VBOX_WITH_IEM_RECOMPILER
564 #
565 # Generate functions for the threaded recompiler and a modified instruction decoded.
566 # Note! Dependency order matters!
567 #
568 VBOX_IEM_NATIVE_GEN_SRC_PARTS := 1 2 3 4 5 6
569 VBoxVMM_INTERMEDIATES += \
570 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
571 $(foreach x, 1 2 3 4, $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h)
572 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
573 VBoxVMM_INTERMEDIATES += \
574 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \
575 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h \
576 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h) \
577 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h)
578 endif
579 VBoxVMM_CLEAN += \
580 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \
581 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
582 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \
583 $(foreach x, 1 2 3 4, $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h) \
584 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \
585 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h \
586 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h) \
587 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h)
588 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts)
589 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \
590 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
591 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \
592 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h,) \
593 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h,) \
594 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions1.cpp.h,) \
595 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions2.cpp.h,) \
596 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions3.cpp.h,) \
597 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions4.cpp.h,) \
598 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions5.cpp.h,) \
599 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions6.cpp.h,) \
600 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness1.cpp.h,) \
601 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness2.cpp.h,) \
602 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness3.cpp.h,) \
603 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness4.cpp.h,) \
604 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness5.cpp.h,) \
605 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness6.cpp.h,) \
606 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h \
607 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h \
608 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h \
609 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h: \
610 $(PATH_SUB_CURRENT)/VMMAll/IEMAllThrdPython.py \
611 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstPython.py \
612 $(PATH_SUB_CURRENT)/VMMAll/IEMAllN8vePython.py \
613 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstCommon.cpp.h \
614 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstCommonBodyMacros.h \
615 $(if-expr !defined(IEM_WITHOUT_3DNOW) ,$(PATH_SUB_CURRENT)/VMMAll/IEMAllInst3DNow.cpp.h,) \
616 $(if-expr !defined(IEM_WITHOUT_THREE_0F_38),$(PATH_SUB_CURRENT)/VMMAll/IEMAllInstThree0f38.cpp.h,) \
617 $(if-expr !defined(IEM_WITHOUT_THREE_0F_3A),$(PATH_SUB_CURRENT)/VMMAll/IEMAllInstThree0f3a.cpp.h,) \
618 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstTwoByte0f.cpp.h \
619 $(if-expr !defined(IEM_WITHOUT_VEX), \
620 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap1.cpp.h \
621 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap2.cpp.h \
622 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap3.cpp.h,) \
623 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstOneByte.cpp.h
624 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,VMMAll/IEMAllInst*.cpp.h)
625 $(QUIET)$(RM) -f -- \
626 $(foreach x, 1 2 3 4,"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h.ts") \
627 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
628 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
629 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
630 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
631 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts")
632 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
633 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
634 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $< $(filter %.cpp.h,$^) \
635 --host-arch "$(KBUILD_TARGET_ARCH)" \
636 --out-thrd-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \
637 --out-thrd-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
638 --out-mod-input1 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
639 --out-mod-input2 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
640 --out-mod-input3 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
641 --out-mod-input4 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
642 $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), \
643 --native \
644 --out-n8ve-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
645 --out-n8ve-liveness-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
646 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS) \
647 ,--out-n8ve-funcs-cpp${x} "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
648 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS) \
649 ,--out-n8ve-liveness-cpp${x} "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts") \
650 ,)
651 $(foreach x, 1 2 3 4, $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
652 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h.ts" \
653 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h")
654 $(QUIET)$(CP) -v -f --changed -- \
655 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
656 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h"
657 $(QUIET)$(CP) -v -f --changed -- \
658 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \
659 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h"
660 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
661 $(QUIET)$(CP) -v -f --changed -- \
662 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
663 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h"
664 $(QUIET)$(CP) -v -f --changed -- \
665 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
666 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h"
667 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
668 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts" \
669 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h")
670 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
671 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts" \
672 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h")
673 endif
674 $(QUIET)$(RM) -f -- \
675 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
676 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
677 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
678 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
679 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
680 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
681 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
682 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
683 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts") \
684
685 foobared: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts
686
687 #
688 # Generate member offsets for selected structures for use from ARM64 assembly.
689 #
690 if1of ($(KBUILD_TARGET_ARCH), arm64)
691 VBoxVMM_CLEAN += \
692 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
693 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
694 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts)
695 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
696 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h: \
697 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veRecompiler.o \
698 $(PATH_SUB_CURRENT)/dwarfdump-to-offsets.sed
699 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,IEMAllN8veRecompiler.o)
700 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
701 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
702 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
703 $(QUIET)$(REDIRECT) -0 /dev/null -o "$@.tmp" -- \
704 dwarfdump --regex --name='^(VMCPU|IEMCPU)$(DOLLAR)' --show-children --recurse-depth=1 "$<"
705 $(QUIET)$(SED) -n -f "$(filter %.sed,$^)" --output "$@" "$@.tmp"
706 $(QUIET)$(RM) -f "$@.tmp"
707 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
708
709 # Set up the dependencies.
710 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veHlpA-arm64.o: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
711 endif
712
713 #
714 # Generate member offsets for selected structures for use from ARM64 assembly.
715 #
716 if1of ($(KBUILD_TARGET_ARCH), amd64)
717 VBoxVMM_CLEAN += \
718 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
719 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac \
720 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
721 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
722
723 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac
724 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts)
725 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
726 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac: \
727 $(PATH_SUB_CURRENT)/include/IEMInternal.h \
728 $(PATH_ROOT)/include/VBox/various.sed
729 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
730 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
731 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
732 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
733 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
734
735 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
736 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts)
737 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
738 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac: \
739 $(PATH_SUB_CURRENT)/include/IEMN8veRecompiler.h \
740 $(PATH_ROOT)/include/VBox/various.sed
741 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
742 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
743 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
744 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
745 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
746 endif
747
748endif # VBOX_WITH_IEM_RECOMPILER
749
750if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
751 #
752 # Debug type info hack for VMCPU, VM and similar.
753 #
754 # The microsoft linker seems to be using the last occurence of the structures
755 # when writing the module PDB file. So, we put the fully complete structures
756 # in a library which is at the end of the library list.
757 #
758 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
759 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
760
761 LIBRARIES += VBoxVMMPdbTypeHack
762 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
763 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
764 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
765 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
766 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
767 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
768 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
769 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
770endif
771
772
773if1of ($(VBOX_LDR_FMT), pe lx)
774 #
775 # VMMR0Imp.lib
776 #
777 LIBRARIES += VMMR0Imp
778 VMMR0Imp_TEMPLATE = VBoxR0
779 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
780 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
781 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
782 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
783 endif
784 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR0Imp)
785
786 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR0Imp_0_OUTDIR)/VMMR0.def)
787 $(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def | $$(dir $$@)
788 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
789 ifeq ($(VBOX_LDR_FMT),lx)
790 $(SED) \
791 -e '/not-os2/d' \
792 -e '/not-amd64/d' \
793 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
794 -e 's/[ \t]DATA[ \t]*/ /' \
795 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
796 $(APPEND) "$@" ""
797 $(APPEND) "$@" " ___ehInit"
798 else
799 $(SED) \
800 -e '/not-win/d' \
801 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
802 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
803 endif
804endif # R0: pe + lx
805
806
807#
808# VMMR3Imp.lib
809#
810IMPORT_LIBS += VMMR3Imp
811$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
812
813
814#
815# VMMR0.r0
816#
817if defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
818 ifdef VBOX_WITH_VBOXR0_AS_DLL
819 DLLS += VMMR0
820 else
821 SYSMODS += VMMR0
822 endif
823 VMMR0_TEMPLATE = VBoxR0
824 VMMR0_SYSSUFF = .r0
825
826 VMMR0_DEFS = VBOX_IN_VMM IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
827 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
828 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
829 ifdef VBOX_WITH_PCI_PASSTHROUGH
830 VMMR0_DEFS += IN_PCIRAW_R0
831 endif
832 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
833 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
834 endif
835 ifdef VBOX_WITH_IOMMU_AMD
836 VMMR0_DEFS += VBOX_WITH_IOMMU_AMD
837 endif
838 ifdef VBOX_WITH_DBGF_TRACING
839 VMMR0_DEFS += VBOX_WITH_DBGF_TRACING
840 endif
841 if1of ($(KBUILD_TARGET), darwin linux win)
842 VMMR0_DEFS += VMM_R0_TOUCH_FPU
843 endif
844 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
845
846 ifeq ($(VBOX_LDR_FMT),elf)
847 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
848 endif
849
850 # yasm versions not knowing about -Wno-segreg-in-64bit (including vanilla 1.3.0) would cause build failure.
851 if "$(VBOX_ASTOOL)" != "YASM" || defined("VBOX_YASM_Wno-segreg-in-64bit")
852 VMMR0_ASFLAGS.amd64 := -Werror
853 endif
854 VMMR0_ASFLAGS.x86 := -Werror
855
856 VMMR0_SDKS = VBoxSoftFloatR0
857
858 VMMR0_INCS = \
859 include \
860 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
861
862 VMMR0_SOURCES = \
863 VBoxVMM.d \
864 VMMR0/CPUMR0.cpp \
865 VMMR0/CPUMR0A.asm \
866 VMMR0/DBGFR0.cpp \
867 VMMR0/DBGFR0Bp.cpp \
868 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/DBGFR0Tracer.cpp,) \
869 VMMR0/GIMR0.cpp \
870 VMMR0/GIMR0Hv.cpp \
871 VMMR0/GMMR0.cpp \
872 VMMR0/GVMMR0.cpp \
873 VMMR0/EMR0.cpp \
874 VMMR0/HMR0.cpp \
875 VMMR0/HMR0A.asm \
876 VMMR0/HMR0UtilA.asm \
877 VMMR0/HMVMXR0.cpp \
878 VMMR0/HMSVMR0.cpp \
879 VMMR0/IEMR0.cpp \
880 VMMR0/IOMR0.cpp \
881 VMMR0/IOMR0IoPort.cpp \
882 VMMR0/IOMR0Mmio.cpp \
883 VMMR0/PDMR0Device.cpp \
884 VMMR0/PDMR0DevHlp.cpp \
885 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/PDMR0DevHlpTracing.cpp,) \
886 VMMR0/PDMR0Driver.cpp \
887 VMMR0/PDMR0Queue.cpp \
888 VMMR0/PGMR0.cpp \
889 VMMR0/PGMR0Pool.cpp \
890 VMMR0/PGMR0SharedPage.cpp \
891 VMMR0/TMR0.cpp \
892 VMMR0/VMMR0.cpp \
893 VMMRZ/CPUMRZ.cpp \
894 VMMRZ/CPUMRZA.asm \
895 VMMRZ/VMMRZ.cpp \
896 VMMAll/APICAll.cpp \
897 VMMAll/CPUMAllCpuId.cpp \
898 VMMAll/CPUMAllRegs.cpp \
899 VMMAll/CPUMAllMsrs.cpp \
900 VMMAll/DBGFAll.cpp \
901 VMMAll/DBGFAllBp.cpp \
902 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
903 VMMAll/EMAll.cpp \
904 VMMAll/GCMAll.cpp \
905 VMMAll/GIMAll.cpp \
906 VMMAll/GIMAllHv.cpp \
907 VMMAll/GIMAllKvm.cpp \
908 VMMAll/HMAll.cpp \
909 VMMAll/HMSVMAll.cpp \
910 VMMAll/HMVMXAll.cpp \
911 VMMAll/IEMAll.cpp \
912 VMMAll/IEMAllIntprTables1.cpp \
913 VMMAll/IEMAllIntprTables2.cpp \
914 VMMAll/IEMAllIntprTables3.cpp \
915 VMMAll/IEMAllIntprTables4.cpp \
916 $(if-expr !defined(IEM_WITHOUT_ASSEMBLY),VMMAll/IEMAllAImpl.asm,) \
917 VMMAll/IEMAllAImplC.cpp \
918 VMMAll/IEMAllCImpl.cpp \
919 VMMAll/IEMAllCImplSvmInstr.cpp \
920 VMMAll/IEMAllCImplVmxInstr.cpp \
921 VMMAll/IEMAllDbg.cpp \
922 VMMAll/IOMAll.cpp \
923 VMMAll/IOMAllMmioNew.cpp \
924 VMMAll/MMAll.cpp \
925 VMMAll/NEMAll.cpp \
926 VMMAll/PDMAll.cpp \
927 VMMAll/PDMAllCritSect.cpp \
928 VMMAll/PDMAllCritSectRw.cpp \
929 VMMAll/PDMAllCritSectBoth.cpp \
930 $(if-expr defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL), VMMAll/PDMAllIommu.cpp,) \
931 VMMAll/PDMAllQueue.cpp \
932 VMMAll/PDMAllTask.cpp \
933 VMMAll/PGMAll.cpp \
934 VMMAll/PGMAllHandler.cpp \
935 VMMAll/PGMAllPhys.cpp \
936 VMMAll/PGMAllPool.cpp \
937 VMMAll/SELMAll.cpp \
938 VMMAll/TMAll.cpp \
939 VMMAll/TMAllCpu.cpp \
940 VMMAll/TMAllReal.cpp \
941 VMMAll/TMAllVirtual.cpp \
942 VMMAll/TRPMAll.cpp \
943 VMMAll/VMAll.cpp \
944 VMMAll/VMMAll.cpp \
945 VMMAll/VMMAllA.asm
946 if1of ($(VBOX_LDR_FMT), pe lx)
947 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
948 endif
949 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
950 VMMR0_SOURCES += \
951 VMMR0/VMMR0TripleFaultHack.cpp \
952 VMMR0/VMMR0TripleFaultHackA.asm
953 endif
954 ifdef VBOX_WITH_NETSHAPER
955 VMMR0_SOURCES += \
956 VMMAll/PDMAllNetShaper.cpp
957 endif
958 VMMR0_SOURCES.amd64 = \
959 VMMR0/VMMR0JmpA-amd64.asm
960 VMMR0_SOURCES.x86 = \
961 VMMR0/VMMR0JmpA-x86.asm
962
963 VMMR0_LIBS = \
964 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
965 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
966 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB) \
967 $(VBOX_LIB_SUPR0)
968 ifdef VBOX_WITH_NATIVE_NEM
969 VMMR0_SOURCES.linux.amd64 += VMMR0/NEMR0Native-stubs.cpp
970 VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-stubs.cpp
971 VMMR0_SOURCES.darwin.amd64 += VMMR0/NEMR0Native-stubs.cpp
972 VMMR0_DEFS.darwin.amd64 += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
973 endif
974
975 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
976
977 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
978 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
979 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
980 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
981 VMMR0_CLEAN += $(addprefix $(VMMR0_0_OUTDIR)/VMMAll/, IEMAll.cod IEMAllAImplC.cod PGMAll.cod)
982 endif
983
984 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
985
986 if "$(KBUILD_TARGET)" == "win"
987 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
988 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
989 VMMR0_LDFLAGS += /Export:PdbTypeHack
990
991 LIBRARIES += VMMR0PdbTypeHack
992 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
993 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
994 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
995 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
996 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
997 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
998 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
999 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
1000 endif
1001
1002 ifdef VBOX_WITH_KMOD_WRAPPED_R0_MODS
1003 # Wrapper kmod for VMMR0.r0
1004 INSTALLS.linux += vbox_vmmr0-src
1005 vbox_vmmr0-src_INST = bin/src/vbox_vmmr0/
1006 vbox_vmmr0-src_SYMLINKS = \
1007 SUPWrapperMod-linux.c=>../common/SUPWrapperMod-linux.c \
1008 Makefile-wrapper.gmk=>../common/Makefile-wrapper.gmk
1009 vbox_vmmr0-src_SOURCES = \
1010 $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/Makefile-vbox_vmmr0.gmk=>Makefile \
1011 $(VMMR0_0_OUTDIR)/VMMR0.r0=>VMMR0.r0 \
1012 $(VMMR0_0_OUTDIR)/VMMR0.debug=>VMMR0.debug
1013 endif
1014
1015endif # defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
1016
1017
1018
1019ifndef VBOX_ONLY_EXTPACKS
1020 #
1021 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
1022 #
1023 LIBRARIES += SSMStandalone
1024 SSMStandalone_TEMPLATE = VBoxR3Exe
1025 SSMStandalone_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE $(VMM_COMMON_DEFS)
1026 SSMStandalone_INCS = include
1027 SSMStandalone_SOURCES = \
1028 VMMR3/SSM.cpp \
1029 VMMR3/CPUMR3Db.cpp
1030endif # !VBOX_ONLY_EXTPACKS
1031
1032
1033if !defined(VBOX_ONLY_EXTPACKS) \
1034 && ( defined(VBOX_WITH_DTRACE_R3) \
1035 || defined(VBOX_WITH_DTRACE_R0) \
1036 || defined(VBOX_WITH_DTRACE_RC))
1037 #
1038 # Install the dtrace library files.
1039 #
1040 INSTALLS += VMMLibDTrace
1041 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
1042 VMMLibDTrace_SOURCES = \
1043 dtrace/lib/vbox-types.d \
1044 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
1045 $(VMMLibDTrace_0_OUTDIR)/vm.d \
1046 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
1047 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
1048 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
1049 $(VMMLibDTrace_0_OUTDIR)/x86.d
1050 $(call KB_FN_DO_PASS0_ON_TARGET,VMMLibDTrace)
1051
1052
1053 ##
1054 # Turn the header $2 into the DTrace library script $1.
1055 #
1056 define def_vmm_lib_dtrace_preprocess
1057 $$(call KB_FN_AUTO_CMD_DEPS,$$(VMMLibDTrace_0_OUTDIR)/$1)
1058 $$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
1059 $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1060 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$2)
1061 $$(QUIET)$(VBOX_VBOXCPP) -d \
1062 -D VBOX_FOR_DTRACE_LIB \
1063 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
1064 -D IN_RING0 \
1065 -D RT_C_DECLS_BEGIN= \
1066 -D RT_C_DECLS_END= \
1067 -D RT_GCC_EXTENSION= \
1068 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
1069 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
1070 -D 'R0PTRTYPE(a_Type)=a_Type' \
1071 -D 'AssertCompile(a_Expr)=' \
1072 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
1073 -D 'bool=uint8_t' \
1074 $$(foreach def,\
1075 $$(DEFS) \
1076 $$(DEFS.$$(KBUILD_TARGET)) \
1077 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
1078 $$(VMM_COMMON_DEFS) \
1079 $$(ARCH_BITS_DEFS)\
1080 ,-D '$$(def)') \
1081 $2 \
1082 $$@
1083 $$(QUIET)$$(CHMOD) 644 $$@
1084
1085 VMMLibDTrace_CLEAN += $(VMMLibDTrace_0_OUTDIR)/$1
1086 endef
1087 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
1088 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
1089 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
1090 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
1091 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
1092
1093endif
1094
1095
1096
1097#
1098# For vmmGetSvnRev.
1099#
1100VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
1101
1102#
1103# Disable annoying warnings about array subscript above array bounds in aPages[]
1104#
1105ifneq ($(KBUILD_TARGET),win)
1106 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1107 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1108 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
1109 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
1110 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
1111endif
1112
1113#
1114# Always optimize the interpreter.
1115#
1116#if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "bird" && $(USERNAME) != "aeichner")
1117if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "aeichner")
1118 if1of ($(KBUILD_TARGET), win)
1119 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
1120 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
1121 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
1122 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
1123 VMMAll/IEMAllAImplC.cpp_CXXFLAGS += -noover -O2xy
1124 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -noover -O2xy
1125 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -noover -O2xy
1126 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -noover -O2xy
1127 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -noover -O2xy
1128 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -noover -O2xy
1129 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -noover -O2xy
1130 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -noover -O2xy
1131 else
1132 # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
1133 VMMAll/IEMAll.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1134 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1135 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1136 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1137 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1138 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1139 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1140 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1141 endif
1142endif # bird wants good stacks (aeichner as well)
1143
1144
1145# Alias the CPU database entries.
1146$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
1147
1148
1149#
1150# Process python source(s).
1151#
1152BLDDIRS += $(PATH_TARGET)/pylint
1153
1154define def_vbox_vmm_py_check
1155 $(eval name:=$(basename $(notdir $(py))))
1156
1157 pylint: $(name)-py-phony.o
1158 $(name).o: $(name)-py-phony.o
1159 $(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
1160 ifdef VBOX_WITH_PYLINT
1161 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
1162 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -- \
1163 $(VBOX_PYLINT) --rcfile=$(PATH_TARGET)/no-such-pylintrc \
1164 $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
1165 endif
1166 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
1167
1168 TESTING += $(name)-py-phony.o
1169endef # def_vbox_vmm_py_check
1170
1171$(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstPython.py IEMAllThrdPython.py IEMAllN8vePython.py ) \
1172, $(eval $(def_vbox_vmm_py_check)))
1173
1174
1175include $(FILE_KBUILD_SUB_FOOTER)
1176
1177
1178# Alias the PGM templates to the object in which they are defined.
1179PGMInternal.o: PGM.o
1180
1181PGMAllBth.o PGMAllGst.o PGMAllShw.o \
1182PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
1183
1184PGMRCBth.o PGMRCGst.o PGMRCShw.o \
1185PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
1186
1187PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
1188
1189PGMInline.o PGMInline.obj: PGMDbg.o
1190
1191# Alias the IEM templates to the object in which they are instantiated.
1192IEMAllInst.cpp.o IEMAllInst.cpp.obj \
1193IEMAllInstCommon.cpp.o IEMAllInstCommon.cpp.obj \
1194IEMAllInstOneByte.cpp.o IEMAllInstOneByte.cpp.obj \
1195IEMAllInstTwoByte0f.cpp.o IEMAllInstTwoByte0f.cpp.obj \
1196IEMAllInstThree0f38.cpp.o IEMAllInstThree0f38.cpp.obj \
1197IEMAllInstThree0f3a.cpp.o IEMAllInstThree0f3a.cpp.obj \
1198IEMAllInstVexMap1.cpp.o IEMAllInstVexMap1.cpp.obj \
1199IEMAllInstVexMap2.cpp.o IEMAllInstVexMap2.cpp.obj \
1200IEMAllInstVexMap3.cpp.o IEMAllInstVexMap3.cpp.obj \
1201IEMAllInst3DNow.cpp.o IEMAllInst3DNow.cpp.obj: IEMAllInstInterpretOnly.o
1202
1203IEMInternal.o IEMInternal.obj: IEMAll.o
1204
1205IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAllCImpl.o
1206
1207# Alias the NEM template to the objects where it is used:
1208NEMAllNativeTemplate-win.cpp.o: NEMR3Native-win.o
1209
1210# Alias the VMX template onto HMVMXR0 or darwin specific NEM object:
1211ifeq ($(KBUILD_TARGET),darwin)
1212 VMXAllTemplate.cpp.o: NEMR3Native-darwin.o
1213else
1214 VMXAllTemplate.cpp.o: HMVMXR0.o
1215endif
1216
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