VirtualBox

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

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

VMM/Makefile.kmk: Enable agressive inlining for VC++ 2019 for VBoxVMM as it speeds up the native recompilation a bit. Updated my private assembly listing hack to include a sample of the native recompiler code. 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 106475 2024-10-18 12:38:26Z 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/SSM.cpp \
473 VMMR3/STAM.cpp \
474 VMMR3/TM.cpp \
475 VMMR3/TRPM.cpp \
476 VMMR3/VM.cpp \
477 VMMR3/VMEmt.cpp \
478 VMMR3/VMReq.cpp \
479 VMMR3/VMM.cpp \
480 VMMR3/VMMGuruMeditation.cpp \
481 VMMR3/VMMTests.cpp \
482 VMMR3/HM-armv8.cpp \
483 VMMAll/CPUMAllRegs-armv8.cpp \
484 VMMAll/CPUMAllSysRegs-armv8.cpp \
485 VMMAll/DBGFAll.cpp \
486 VMMAll/DBGFAllBp.cpp \
487 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
488 VMMAll/IEMAll-armv8.cpp \
489 VMMAll/IOMAll.cpp \
490 VMMAll/IOMAllMmioNew.cpp \
491 VMMAll/MMAll.cpp \
492 VMMAll/NEMAll.cpp \
493 VMMAll/PDMAll.cpp \
494 VMMAll/PDMAllCritSect.cpp \
495 VMMAll/PDMAllCritSectRw.cpp \
496 VMMAll/PDMAllCritSectBoth.cpp \
497 VMMAll/PDMAllQueue.cpp \
498 VMMAll/PDMAllTask.cpp \
499 VMMAll/PGMAllHandler.cpp \
500 VMMAll/PGMAllPhys.cpp \
501 VMMAll/PGMAllPool.cpp \
502 VMMAll/EMAll.cpp \
503 VMMAll/GICAll.cpp \
504 VMMAll/GIMAll.cpp \
505 VMMAll/TMAll.cpp \
506 VMMAll/TMAllCpu.cpp \
507 VMMAll/TMAllReal.cpp \
508 VMMAll/TMAllVirtual.cpp \
509 VMMAll/TRPMAll.cpp \
510 VMMAll/VMAll.cpp \
511 VMMAll/VMMAll.cpp
512 ifdef VBOX_WITH_VUSB
513 VBoxVMMArm_SOURCES += VMMR3/PDMUsb.cpp
514 endif
515 ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
516 VBoxVMMArm_SOURCES += \
517 VMMR3/PDMAsyncCompletion.cpp \
518 VMMR3/PDMAsyncCompletionFile.cpp \
519 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
520 VMMR3/PDMAsyncCompletionFileNormal.cpp
521 endif
522 ifdef VBOX_WITH_NETSHAPER
523 VBoxVMMArm_SOURCES += \
524 VMMR3/PDMNetShaper.cpp \
525 VMMAll/PDMAllNetShaper.cpp
526 endif
527
528 VBoxVMMArm_SOURCES.darwin.arm64 += \
529 VMMR3/NEMR3Native-darwin-armv8.cpp \
530 VMMR3/GICR3Nem-darwin.cpp
531 VBoxVMMArm_DEFS.darwin.arm64 += VBOX_WITH_NATIVE_NEM
532 VBoxVMMArm_LDFLAGS.darwin.arm64 = -framework Hypervisor
533
534 VBoxVMMArm_SOURCES.linux.arm64 += \
535 VMMR3/NEMR3Native-linux-armv8.cpp \
536 VMMR3/GICR3Nem-linux.cpp
537 VBoxVMMArm_DEFS.linux.arm64 += VBOX_WITH_NATIVE_NEM
538
539 VBoxVMMArm_SOURCES.win.arm64 += \
540 VMMR3/NEMR3Native-win-armv8.cpp \
541 VMMR3/GICR3Nem-win.cpp
542 VBoxVMMArm_DEFS.win.arm64 += VBOX_WITH_NATIVE_NEM
543
544 VBoxVMMArm_LIBS = \
545 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
546 ifdef VBOX_WITH_DEBUGGER
547 VBoxVMMArm_LIBS += \
548 $(PATH_STAGE_LIB)/Debugger-armv8$(VBOX_SUFF_LIB)
549 endif
550 VBoxVMMArm_LIBS += \
551 $(LIB_RUNTIME)
552
553 VBoxVMMArm_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMMArm.dylib
554endif
555
556$(call KB_FN_DO_PASS0_ON_TARGET,VBoxVMM)
557$(evalcall2 def_VBoxGenIEMInstructionStatisticsTmpl_Header,VBoxVMM,$(VBoxVMM_0_OUTDIR)/CommonGenIncs)
558foobar: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
559
560
561ifdef VBOX_WITH_IEM_RECOMPILER
562 #
563 # Generate functions for the threaded recompiler and a modified instruction decoded.
564 # Note! Dependency order matters!
565 #
566 VBOX_IEM_NATIVE_GEN_SRC_PARTS := 1 2 3 4 5 6
567 VBoxVMM_INTERMEDIATES += \
568 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
569 $(foreach x, 1 2 3 4, $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h)
570 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
571 VBoxVMM_INTERMEDIATES += \
572 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \
573 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h \
574 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h) \
575 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h)
576 endif
577 VBoxVMM_CLEAN += \
578 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \
579 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
580 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \
581 $(foreach x, 1 2 3 4, $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h) \
582 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \
583 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h \
584 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h) \
585 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h)
586 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts)
587 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \
588 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
589 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \
590 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h,) \
591 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h,) \
592 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions1.cpp.h,) \
593 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions2.cpp.h,) \
594 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions3.cpp.h,) \
595 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions4.cpp.h,) \
596 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions5.cpp.h,) \
597 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions6.cpp.h,) \
598 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness1.cpp.h,) \
599 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness2.cpp.h,) \
600 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness3.cpp.h,) \
601 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness4.cpp.h,) \
602 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness5.cpp.h,) \
603 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness6.cpp.h,) \
604 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h \
605 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h \
606 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h \
607 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h: \
608 $(PATH_SUB_CURRENT)/VMMAll/IEMAllThrdPython.py \
609 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstPython.py \
610 $(PATH_SUB_CURRENT)/VMMAll/IEMAllN8vePython.py \
611 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstCommon.cpp.h \
612 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstCommonBodyMacros.h \
613 $(if-expr !defined(IEM_WITHOUT_3DNOW) ,$(PATH_SUB_CURRENT)/VMMAll/IEMAllInst3DNow.cpp.h,) \
614 $(if-expr !defined(IEM_WITHOUT_THREE_0F_38),$(PATH_SUB_CURRENT)/VMMAll/IEMAllInstThree0f38.cpp.h,) \
615 $(if-expr !defined(IEM_WITHOUT_THREE_0F_3A),$(PATH_SUB_CURRENT)/VMMAll/IEMAllInstThree0f3a.cpp.h,) \
616 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstTwoByte0f.cpp.h \
617 $(if-expr !defined(IEM_WITHOUT_VEX), \
618 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap1.cpp.h \
619 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap2.cpp.h \
620 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstVexMap3.cpp.h,) \
621 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstOneByte.cpp.h
622 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,VMMAll/IEMAllInst*.cpp.h)
623 $(QUIET)$(RM) -f -- \
624 $(foreach x, 1 2 3 4,"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h.ts") \
625 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
626 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
627 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
628 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
629 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts")
630 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
631 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
632 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $< $(filter %.cpp.h,$^) \
633 --host-arch "$(KBUILD_TARGET_ARCH)" \
634 --out-thrd-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \
635 --out-thrd-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
636 --out-mod-input1 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
637 --out-mod-input2 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
638 --out-mod-input3 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
639 --out-mod-input4 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
640 $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), \
641 --native \
642 --out-n8ve-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
643 --out-n8ve-liveness-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
644 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS) \
645 ,--out-n8ve-funcs-cpp${x} "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
646 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS) \
647 ,--out-n8ve-liveness-cpp${x} "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts") \
648 ,)
649 $(foreach x, 1 2 3 4, $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
650 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h.ts" \
651 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions${x}.cpp.h")
652 $(QUIET)$(CP) -v -f --changed -- \
653 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
654 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h"
655 $(QUIET)$(CP) -v -f --changed -- \
656 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \
657 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h"
658 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER
659 $(QUIET)$(CP) -v -f --changed -- \
660 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
661 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h"
662 $(QUIET)$(CP) -v -f --changed -- \
663 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
664 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h"
665 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
666 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts" \
667 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h")
668 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS), $(NLTAB)$(QUIET)$(CP) -v -f --changed -- \
669 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts" \
670 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h")
671 endif
672 $(QUIET)$(RM) -f -- \
673 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
674 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
675 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
676 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
677 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
678 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \
679 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness.h.ts" \
680 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions${x}.cpp.h.ts") \
681 $(foreach x, $(VBOX_IEM_NATIVE_GEN_SRC_PARTS),"$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeLiveness${x}.cpp.h.ts") \
682
683 foobared: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts
684
685 #
686 # Generate member offsets for selected structures for use from ARM64 assembly.
687 #
688 if1of ($(KBUILD_TARGET_ARCH), arm64)
689 VBoxVMM_CLEAN += \
690 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
691 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
692 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts)
693 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
694 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h: \
695 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veRecompiler.o \
696 $(PATH_SUB_CURRENT)/dwarfdump-to-offsets.sed
697 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,IEMAllN8veRecompiler.o)
698 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
699 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
700 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
701 $(QUIET)$(REDIRECT) -0 /dev/null -o "$@.tmp" -- \
702 dwarfdump --regex --name='^(VMCPU|IEMCPU)$(DOLLAR)' --show-children --recurse-depth=1 "$<"
703 $(QUIET)$(SED) -n -f "$(filter %.sed,$^)" --output "$@" "$@.tmp"
704 $(QUIET)$(RM) -f "$@.tmp"
705 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
706
707 # Set up the dependencies.
708 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veHlpA-arm64.o: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
709 endif
710
711 #
712 # Generate member offsets for selected structures for use from ARM64 assembly.
713 #
714 if1of ($(KBUILD_TARGET_ARCH), amd64)
715 VBoxVMM_CLEAN += \
716 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
717 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac \
718 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
719 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
720
721 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac
722 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts)
723 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
724 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac: \
725 $(PATH_SUB_CURRENT)/include/IEMInternal.h \
726 $(PATH_ROOT)/include/VBox/various.sed
727 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
728 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
729 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
730 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
731 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
732
733 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
734 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts)
735 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
736 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac: \
737 $(PATH_SUB_CURRENT)/include/IEMN8veRecompiler.h \
738 $(PATH_ROOT)/include/VBox/various.sed
739 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
740 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
741 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
742 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
743 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
744 endif
745
746endif # VBOX_WITH_IEM_RECOMPILER
747
748if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
749 #
750 # Debug type info hack for VMCPU, VM and similar.
751 #
752 # The microsoft linker seems to be using the last occurence of the structures
753 # when writing the module PDB file. So, we put the fully complete structures
754 # in a library which is at the end of the library list.
755 #
756 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
757 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
758
759 LIBRARIES += VBoxVMMPdbTypeHack
760 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
761 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
762 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
763 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
764 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
765 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
766 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
767 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
768endif
769
770
771if1of ($(VBOX_LDR_FMT), pe lx)
772 #
773 # VMMR0Imp.lib
774 #
775 LIBRARIES += VMMR0Imp
776 VMMR0Imp_TEMPLATE = VBoxR0
777 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
778 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
779 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
780 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
781 endif
782 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR0Imp)
783
784 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR0Imp_0_OUTDIR)/VMMR0.def)
785 $(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def | $$(dir $$@)
786 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
787 ifeq ($(VBOX_LDR_FMT),lx)
788 $(SED) \
789 -e '/not-os2/d' \
790 -e '/not-amd64/d' \
791 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
792 -e 's/[ \t]DATA[ \t]*/ /' \
793 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
794 $(APPEND) "$@" ""
795 $(APPEND) "$@" " ___ehInit"
796 else
797 $(SED) \
798 -e '/not-win/d' \
799 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
800 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
801 endif
802endif # R0: pe + lx
803
804
805#
806# VMMR3Imp.lib
807#
808IMPORT_LIBS += VMMR3Imp
809$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
810
811
812#
813# VMMR0.r0
814#
815if defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
816 ifdef VBOX_WITH_VBOXR0_AS_DLL
817 DLLS += VMMR0
818 else
819 SYSMODS += VMMR0
820 endif
821 VMMR0_TEMPLATE = VBoxR0
822 VMMR0_SYSSUFF = .r0
823
824 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 \
825 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
826 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
827 ifdef VBOX_WITH_PCI_PASSTHROUGH
828 VMMR0_DEFS += IN_PCIRAW_R0
829 endif
830 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
831 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
832 endif
833 ifdef VBOX_WITH_IOMMU_AMD
834 VMMR0_DEFS += VBOX_WITH_IOMMU_AMD
835 endif
836 ifdef VBOX_WITH_DBGF_TRACING
837 VMMR0_DEFS += VBOX_WITH_DBGF_TRACING
838 endif
839 if1of ($(KBUILD_TARGET), darwin linux win)
840 VMMR0_DEFS += VMM_R0_TOUCH_FPU
841 endif
842 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
843
844 ifeq ($(VBOX_LDR_FMT),elf)
845 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
846 endif
847
848 # yasm versions not knowing about -Wno-segreg-in-64bit (including vanilla 1.3.0) would cause build failure.
849 if "$(VBOX_ASTOOL)" != "YASM" || defined("VBOX_YASM_Wno-segreg-in-64bit")
850 VMMR0_ASFLAGS.amd64 := -Werror
851 endif
852 VMMR0_ASFLAGS.x86 := -Werror
853
854 VMMR0_SDKS = VBoxSoftFloatR0
855
856 VMMR0_INCS = \
857 include \
858 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
859
860 VMMR0_SOURCES = \
861 VBoxVMM.d \
862 VMMR0/CPUMR0.cpp \
863 VMMR0/CPUMR0A.asm \
864 VMMR0/DBGFR0.cpp \
865 VMMR0/DBGFR0Bp.cpp \
866 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/DBGFR0Tracer.cpp,) \
867 VMMR0/GIMR0.cpp \
868 VMMR0/GIMR0Hv.cpp \
869 VMMR0/GMMR0.cpp \
870 VMMR0/GVMMR0.cpp \
871 VMMR0/EMR0.cpp \
872 VMMR0/HMR0.cpp \
873 VMMR0/HMR0A.asm \
874 VMMR0/HMR0UtilA.asm \
875 VMMR0/HMVMXR0.cpp \
876 VMMR0/HMSVMR0.cpp \
877 VMMR0/IEMR0.cpp \
878 VMMR0/IOMR0.cpp \
879 VMMR0/IOMR0IoPort.cpp \
880 VMMR0/IOMR0Mmio.cpp \
881 VMMR0/PDMR0Device.cpp \
882 VMMR0/PDMR0DevHlp.cpp \
883 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/PDMR0DevHlpTracing.cpp,) \
884 VMMR0/PDMR0Driver.cpp \
885 VMMR0/PDMR0Queue.cpp \
886 VMMR0/PGMR0.cpp \
887 VMMR0/PGMR0Pool.cpp \
888 VMMR0/PGMR0SharedPage.cpp \
889 VMMR0/TMR0.cpp \
890 VMMR0/VMMR0.cpp \
891 VMMRZ/CPUMRZ.cpp \
892 VMMRZ/CPUMRZA.asm \
893 VMMRZ/VMMRZ.cpp \
894 VMMAll/APICAll.cpp \
895 VMMAll/CPUMAllCpuId.cpp \
896 VMMAll/CPUMAllRegs.cpp \
897 VMMAll/CPUMAllMsrs.cpp \
898 VMMAll/DBGFAll.cpp \
899 VMMAll/DBGFAllBp.cpp \
900 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
901 VMMAll/EMAll.cpp \
902 VMMAll/GCMAll.cpp \
903 VMMAll/GIMAll.cpp \
904 VMMAll/GIMAllHv.cpp \
905 VMMAll/GIMAllKvm.cpp \
906 VMMAll/HMAll.cpp \
907 VMMAll/HMSVMAll.cpp \
908 VMMAll/HMVMXAll.cpp \
909 VMMAll/IEMAll.cpp \
910 VMMAll/IEMAllIntprTables1.cpp \
911 VMMAll/IEMAllIntprTables2.cpp \
912 VMMAll/IEMAllIntprTables3.cpp \
913 VMMAll/IEMAllIntprTables4.cpp \
914 $(if-expr !defined(IEM_WITHOUT_ASSEMBLY),VMMAll/IEMAllAImpl.asm,) \
915 VMMAll/IEMAllAImplC.cpp \
916 VMMAll/IEMAllCImpl.cpp \
917 VMMAll/IEMAllCImplSvmInstr.cpp \
918 VMMAll/IEMAllCImplVmxInstr.cpp \
919 VMMAll/IEMAllDbg.cpp \
920 VMMAll/IOMAll.cpp \
921 VMMAll/IOMAllMmioNew.cpp \
922 VMMAll/MMAll.cpp \
923 VMMAll/NEMAll.cpp \
924 VMMAll/PDMAll.cpp \
925 VMMAll/PDMAllCritSect.cpp \
926 VMMAll/PDMAllCritSectRw.cpp \
927 VMMAll/PDMAllCritSectBoth.cpp \
928 $(if-expr defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL), VMMAll/PDMAllIommu.cpp,) \
929 VMMAll/PDMAllQueue.cpp \
930 VMMAll/PDMAllTask.cpp \
931 VMMAll/PGMAll.cpp \
932 VMMAll/PGMAllHandler.cpp \
933 VMMAll/PGMAllPhys.cpp \
934 VMMAll/PGMAllPool.cpp \
935 VMMAll/SELMAll.cpp \
936 VMMAll/TMAll.cpp \
937 VMMAll/TMAllCpu.cpp \
938 VMMAll/TMAllReal.cpp \
939 VMMAll/TMAllVirtual.cpp \
940 VMMAll/TRPMAll.cpp \
941 VMMAll/VMAll.cpp \
942 VMMAll/VMMAll.cpp \
943 VMMAll/VMMAllA.asm
944 if1of ($(VBOX_LDR_FMT), pe lx)
945 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
946 endif
947 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
948 VMMR0_SOURCES += \
949 VMMR0/VMMR0TripleFaultHack.cpp \
950 VMMR0/VMMR0TripleFaultHackA.asm
951 endif
952 ifdef VBOX_WITH_NETSHAPER
953 VMMR0_SOURCES += \
954 VMMAll/PDMAllNetShaper.cpp
955 endif
956 VMMR0_SOURCES.amd64 = \
957 VMMR0/VMMR0JmpA-amd64.asm
958 VMMR0_SOURCES.x86 = \
959 VMMR0/VMMR0JmpA-x86.asm
960
961 VMMR0_LIBS = \
962 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
963 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
964 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB) \
965 $(VBOX_LIB_SUPR0)
966 ifdef VBOX_WITH_NATIVE_NEM
967 VMMR0_SOURCES.linux.amd64 += VMMR0/NEMR0Native-stubs.cpp
968 VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-stubs.cpp
969 VMMR0_SOURCES.darwin.amd64 += VMMR0/NEMR0Native-stubs.cpp
970 VMMR0_DEFS.darwin.amd64 += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
971 endif
972
973 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
974
975 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
976 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
977 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
978 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
979 VMMR0_CLEAN += $(addprefix $(VMMR0_0_OUTDIR)/VMMAll/, IEMAll.cod IEMAllAImplC.cod PGMAll.cod)
980 endif
981
982 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
983
984 if "$(KBUILD_TARGET)" == "win"
985 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
986 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
987 VMMR0_LDFLAGS += /Export:PdbTypeHack
988
989 LIBRARIES += VMMR0PdbTypeHack
990 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
991 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
992 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
993 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
994 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
995 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
996 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
997 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
998 endif
999
1000 ifdef VBOX_WITH_KMOD_WRAPPED_R0_MODS
1001 # Wrapper kmod for VMMR0.r0
1002 INSTALLS.linux += vbox_vmmr0-src
1003 vbox_vmmr0-src_INST = bin/src/vbox_vmmr0/
1004 vbox_vmmr0-src_SYMLINKS = \
1005 SUPWrapperMod-linux.c=>../common/SUPWrapperMod-linux.c \
1006 Makefile-wrapper.gmk=>../common/Makefile-wrapper.gmk
1007 vbox_vmmr0-src_SOURCES = \
1008 $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/Makefile-vbox_vmmr0.gmk=>Makefile \
1009 $(VMMR0_0_OUTDIR)/VMMR0.r0=>VMMR0.r0 \
1010 $(VMMR0_0_OUTDIR)/VMMR0.debug=>VMMR0.debug
1011 endif
1012
1013endif # defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
1014
1015
1016
1017ifndef VBOX_ONLY_EXTPACKS
1018 #
1019 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
1020 #
1021 LIBRARIES += SSMStandalone
1022 SSMStandalone_TEMPLATE = VBoxR3Exe
1023 SSMStandalone_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE $(VMM_COMMON_DEFS)
1024 SSMStandalone_INCS = include
1025 SSMStandalone_SOURCES = \
1026 VMMR3/SSM.cpp \
1027 VMMR3/CPUMR3Db.cpp
1028endif # !VBOX_ONLY_EXTPACKS
1029
1030
1031if !defined(VBOX_ONLY_EXTPACKS) \
1032 && ( defined(VBOX_WITH_DTRACE_R3) \
1033 || defined(VBOX_WITH_DTRACE_R0) \
1034 || defined(VBOX_WITH_DTRACE_RC))
1035 #
1036 # Install the dtrace library files.
1037 #
1038 INSTALLS += VMMLibDTrace
1039 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
1040 VMMLibDTrace_SOURCES = \
1041 dtrace/lib/vbox-types.d \
1042 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
1043 $(VMMLibDTrace_0_OUTDIR)/vm.d \
1044 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
1045 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
1046 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
1047 $(VMMLibDTrace_0_OUTDIR)/x86.d
1048 $(call KB_FN_DO_PASS0_ON_TARGET,VMMLibDTrace)
1049
1050
1051 ##
1052 # Turn the header $2 into the DTrace library script $1.
1053 #
1054 define def_vmm_lib_dtrace_preprocess
1055 $$(call KB_FN_AUTO_CMD_DEPS,$$(VMMLibDTrace_0_OUTDIR)/$1)
1056 $$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
1057 $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1058 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$2)
1059 $$(QUIET)$(VBOX_VBOXCPP) -d \
1060 -D VBOX_FOR_DTRACE_LIB \
1061 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
1062 -D IN_RING0 \
1063 -D RT_C_DECLS_BEGIN= \
1064 -D RT_C_DECLS_END= \
1065 -D RT_GCC_EXTENSION= \
1066 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
1067 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
1068 -D 'R0PTRTYPE(a_Type)=a_Type' \
1069 -D 'AssertCompile(a_Expr)=' \
1070 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
1071 -D 'bool=uint8_t' \
1072 $$(foreach def,\
1073 $$(DEFS) \
1074 $$(DEFS.$$(KBUILD_TARGET)) \
1075 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
1076 $$(VMM_COMMON_DEFS) \
1077 $$(ARCH_BITS_DEFS)\
1078 ,-D '$$(def)') \
1079 $2 \
1080 $$@
1081 $$(QUIET)$$(CHMOD) 644 $$@
1082
1083 VMMLibDTrace_CLEAN += $(VMMLibDTrace_0_OUTDIR)/$1
1084 endef
1085 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
1086 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
1087 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
1088 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
1089 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
1090
1091endif
1092
1093
1094
1095#
1096# For vmmGetSvnRev.
1097#
1098VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
1099
1100#
1101# Disable annoying warnings about array subscript above array bounds in aPages[]
1102#
1103ifneq ($(KBUILD_TARGET),win)
1104 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1105 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1106 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
1107 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
1108 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
1109endif
1110
1111#
1112# Always optimize the interpreter.
1113#
1114#if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "bird" && $(USERNAME) != "aeichner")
1115if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "aeichner")
1116 if1of ($(KBUILD_TARGET), win)
1117 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
1118 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
1119 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
1120 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
1121 VMMAll/IEMAllAImplC.cpp_CXXFLAGS += -noover -O2xy
1122 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -noover -O2xy
1123 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -noover -O2xy
1124 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -noover -O2xy
1125 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -noover -O2xy
1126 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -noover -O2xy
1127 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -noover -O2xy
1128 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -noover -O2xy
1129 else
1130 # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
1131 VMMAll/IEMAll.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1132 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1133 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1134 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1135 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1136 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1137 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1138 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1139 endif
1140endif # bird wants good stacks (aeichner as well)
1141
1142
1143# Alias the CPU database entries.
1144$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
1145
1146
1147#
1148# Process python source(s).
1149#
1150BLDDIRS += $(PATH_TARGET)/pylint
1151
1152define def_vbox_vmm_py_check
1153 $(eval name:=$(basename $(notdir $(py))))
1154
1155 pylint: $(name)-py-phony.o
1156 $(name).o: $(name)-py-phony.o
1157 $(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
1158 ifdef VBOX_WITH_PYLINT
1159 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
1160 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -- \
1161 $(VBOX_PYLINT) --rcfile=$(PATH_TARGET)/no-such-pylintrc \
1162 $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
1163 endif
1164 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
1165
1166 TESTING += $(name)-py-phony.o
1167endef # def_vbox_vmm_py_check
1168
1169$(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstPython.py IEMAllThrdPython.py IEMAllN8vePython.py ) \
1170, $(eval $(def_vbox_vmm_py_check)))
1171
1172
1173include $(FILE_KBUILD_SUB_FOOTER)
1174
1175
1176# Alias the PGM templates to the object in which they are defined.
1177PGMInternal.o: PGM.o
1178
1179PGMAllBth.o PGMAllGst.o PGMAllShw.o \
1180PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
1181
1182PGMRCBth.o PGMRCGst.o PGMRCShw.o \
1183PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
1184
1185PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
1186
1187PGMInline.o PGMInline.obj: PGMDbg.o
1188
1189# Alias the IEM templates to the object in which they are instantiated.
1190IEMAllInst.cpp.o IEMAllInst.cpp.obj \
1191IEMAllInstCommon.cpp.o IEMAllInstCommon.cpp.obj \
1192IEMAllInstOneByte.cpp.o IEMAllInstOneByte.cpp.obj \
1193IEMAllInstTwoByte0f.cpp.o IEMAllInstTwoByte0f.cpp.obj \
1194IEMAllInstThree0f38.cpp.o IEMAllInstThree0f38.cpp.obj \
1195IEMAllInstThree0f3a.cpp.o IEMAllInstThree0f3a.cpp.obj \
1196IEMAllInstVexMap1.cpp.o IEMAllInstVexMap1.cpp.obj \
1197IEMAllInstVexMap2.cpp.o IEMAllInstVexMap2.cpp.obj \
1198IEMAllInstVexMap3.cpp.o IEMAllInstVexMap3.cpp.obj \
1199IEMAllInst3DNow.cpp.o IEMAllInst3DNow.cpp.obj: IEMAllInstInterpretOnly.o
1200
1201IEMInternal.o IEMInternal.obj: IEMAll.o
1202
1203IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAllCImpl.o
1204
1205# Alias the NEM template to the objects where it is used:
1206NEMAllNativeTemplate-win.cpp.o: NEMR3Native-win.o
1207
1208# Alias the VMX template onto HMVMXR0 or darwin specific NEM object:
1209ifeq ($(KBUILD_TARGET),darwin)
1210 VMXAllTemplate.cpp.o: NEMR3Native-darwin.o
1211else
1212 VMXAllTemplate.cpp.o: HMVMXR0.o
1213endif
1214
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