VirtualBox

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

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

VMM/ARM: Make the control flow graph generator work with ARMv8 A64 to some extent, bugref:10393

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 44.8 KB
Line 
1# $Id: Makefile.kmk 106743 2024-10-28 11:43:04Z 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_DIS_WITH_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 # Note! The windows rule is using the .obj rather than the -obj.pdb file as
691 # dependency, as the latter isn't listed as an output file for some reason.
692 #
693 if1of ($(KBUILD_TARGET_ARCH), arm64)
694 VBoxVMM_CLEAN += \
695 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
696 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
697 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts)
698 ifeq ($(KBUILD_TARGET),win)
699 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
700 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h: \
701 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veRecompiler.obj \
702 $(PATH_SUB_CURRENT)/pdbutil-to-offsets.sed
703 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,IEMAllN8veRecompiler-obj.pdb)
704 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
705 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
706 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
707 $(QUIET)$(REDIRECT) -0 /dev/null -o "$@.tmp" -- \
708 $(TOOL_VCC143-CLANGXX_PREFIX2)pdbutil$(TOOL_VCC143-CLANGXX_SUFFIX2) \
709 pretty --with-name=VMCPU --with-name=IEMCPU "$(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veRecompiler-obj.pdb"
710 $(QUIET)$(SED) -n -f "$(filter %.sed,$^)" --output "$@" "$@.tmp"
711 $(QUIET)$(RM) -f "$@.tmp"
712 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
713 else
714 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h.ts \
715 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h: \
716 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veRecompiler.o \
717 $(PATH_SUB_CURRENT)/dwarfdump-to-offsets.sed
718 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,IEMAllN8veRecompiler.o)
719 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
720 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
721 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
722 $(QUIET)$(REDIRECT) -0 /dev/null -o "$@.tmp" -- \
723 dwarfdump --regex --name='^(VMCPU|IEMCPU)$(DOLLAR)' --show-children --recurse-depth=1 "$<"
724 $(QUIET)$(SED) -n -f "$(filter %.sed,$^)" --output "$@" "$@.tmp"
725 $(QUIET)$(RM) -f "$@.tmp"
726 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
727 endif
728
729 # Set up the dependencies.
730 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veHlpA-arm64.o: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
731 $(VBoxVMM_0_OUTDIR)/VMMAll/IEMAllN8veHlpA-arm64.obj: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMAssemblyOffsets.h
732 endif
733
734 #
735 # Generate member offsets for selected structures for use from ARM64 assembly.
736 #
737 if1of ($(KBUILD_TARGET_ARCH), amd64)
738 VBoxVMM_CLEAN += \
739 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
740 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac \
741 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
742 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
743
744 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac
745 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts)
746 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac.ts \
747 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInternal.mac: \
748 $(PATH_SUB_CURRENT)/include/IEMInternal.h \
749 $(PATH_ROOT)/include/VBox/various.sed
750 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
751 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
752 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
753 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
754 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
755
756 VBoxVMM_INTERMEDIATES.amd64 += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac
757 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts)
758 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac.ts \
759 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMN8veRecompiler.mac: \
760 $(PATH_SUB_CURRENT)/include/IEMN8veRecompiler.h \
761 $(PATH_ROOT)/include/VBox/various.sed
762 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,$<)
763 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
764 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
765 $(QUIET)$(SED) -f "$(filter %.sed,$^)" --output "$@" "$<"
766 $(QUIET)$(CP) -v -f --changed -- "$@" "$(basename $@)"
767 endif
768
769endif # VBOX_WITH_IEM_RECOMPILER
770
771if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
772 #
773 # Debug type info hack for VMCPU, VM and similar.
774 #
775 # The microsoft linker seems to be using the last occurence of the structures
776 # when writing the module PDB file. So, we put the fully complete structures
777 # in a library which is at the end of the library list.
778 #
779 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
780 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
781
782 LIBRARIES += VBoxVMMPdbTypeHack
783 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
784 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
785 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
786 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
787 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
788 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
789 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
790 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
791endif
792
793
794if1of ($(VBOX_LDR_FMT), pe lx)
795 #
796 # VMMR0Imp.lib
797 #
798 LIBRARIES += VMMR0Imp
799 VMMR0Imp_TEMPLATE = VBoxR0
800 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
801 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
802 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
803 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
804 endif
805 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR0Imp)
806
807 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR0Imp_0_OUTDIR)/VMMR0.def)
808 $(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def | $$(dir $$@)
809 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
810 ifeq ($(VBOX_LDR_FMT),lx)
811 $(SED) \
812 -e '/not-os2/d' \
813 -e '/not-amd64/d' \
814 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
815 -e 's/[ \t]DATA[ \t]*/ /' \
816 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
817 $(APPEND) "$@" ""
818 $(APPEND) "$@" " ___ehInit"
819 else
820 $(SED) \
821 -e '/not-win/d' \
822 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
823 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
824 endif
825endif # R0: pe + lx
826
827
828#
829# VMMR3Imp.lib
830#
831IMPORT_LIBS += VMMR3Imp
832$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
833
834
835#
836# VMMR0.r0
837#
838if defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
839 ifdef VBOX_WITH_VBOXR0_AS_DLL
840 DLLS += VMMR0
841 else
842 SYSMODS += VMMR0
843 endif
844 VMMR0_TEMPLATE = VBoxR0
845 VMMR0_SYSSUFF = .r0
846
847 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 \
848 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
849 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
850 ifdef VBOX_WITH_PCI_PASSTHROUGH
851 VMMR0_DEFS += IN_PCIRAW_R0
852 endif
853 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
854 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
855 endif
856 ifdef VBOX_WITH_IOMMU_AMD
857 VMMR0_DEFS += VBOX_WITH_IOMMU_AMD
858 endif
859 ifdef VBOX_WITH_DBGF_TRACING
860 VMMR0_DEFS += VBOX_WITH_DBGF_TRACING
861 endif
862 if1of ($(KBUILD_TARGET), darwin linux win)
863 VMMR0_DEFS += VMM_R0_TOUCH_FPU
864 endif
865 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
866
867 ifeq ($(VBOX_LDR_FMT),elf)
868 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
869 endif
870
871 # yasm versions not knowing about -Wno-segreg-in-64bit (including vanilla 1.3.0) would cause build failure.
872 if "$(VBOX_ASTOOL)" != "YASM" || defined("VBOX_YASM_Wno-segreg-in-64bit")
873 VMMR0_ASFLAGS.amd64 := -Werror
874 endif
875 VMMR0_ASFLAGS.x86 := -Werror
876
877 VMMR0_SDKS = VBoxSoftFloatR0
878
879 VMMR0_INCS = \
880 include \
881 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
882
883 VMMR0_SOURCES = \
884 VBoxVMM.d \
885 VMMR0/CPUMR0.cpp \
886 VMMR0/CPUMR0A.asm \
887 VMMR0/DBGFR0.cpp \
888 VMMR0/DBGFR0Bp.cpp \
889 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/DBGFR0Tracer.cpp,) \
890 VMMR0/GIMR0.cpp \
891 VMMR0/GIMR0Hv.cpp \
892 VMMR0/GMMR0.cpp \
893 VMMR0/GVMMR0.cpp \
894 VMMR0/EMR0.cpp \
895 VMMR0/HMR0.cpp \
896 VMMR0/HMR0A.asm \
897 VMMR0/HMR0UtilA.asm \
898 VMMR0/HMVMXR0.cpp \
899 VMMR0/HMSVMR0.cpp \
900 VMMR0/IEMR0.cpp \
901 VMMR0/IOMR0.cpp \
902 VMMR0/IOMR0IoPort.cpp \
903 VMMR0/IOMR0Mmio.cpp \
904 VMMR0/PDMR0Device.cpp \
905 VMMR0/PDMR0DevHlp.cpp \
906 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/PDMR0DevHlpTracing.cpp,) \
907 VMMR0/PDMR0Driver.cpp \
908 VMMR0/PDMR0Queue.cpp \
909 VMMR0/PGMR0.cpp \
910 VMMR0/PGMR0Pool.cpp \
911 VMMR0/PGMR0SharedPage.cpp \
912 VMMR0/TMR0.cpp \
913 VMMR0/VMMR0.cpp \
914 VMMRZ/CPUMRZ.cpp \
915 VMMRZ/CPUMRZA.asm \
916 VMMRZ/VMMRZ.cpp \
917 VMMAll/APICAll.cpp \
918 VMMAll/CPUMAllCpuId.cpp \
919 VMMAll/CPUMAllRegs.cpp \
920 VMMAll/CPUMAllMsrs.cpp \
921 VMMAll/DBGFAll.cpp \
922 VMMAll/DBGFAllBp.cpp \
923 $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
924 VMMAll/EMAll.cpp \
925 VMMAll/GCMAll.cpp \
926 VMMAll/GIMAll.cpp \
927 VMMAll/GIMAllHv.cpp \
928 VMMAll/GIMAllKvm.cpp \
929 VMMAll/HMAll.cpp \
930 VMMAll/HMSVMAll.cpp \
931 VMMAll/HMVMXAll.cpp \
932 VMMAll/IEMAll.cpp \
933 VMMAll/IEMAllIntprTables1.cpp \
934 VMMAll/IEMAllIntprTables2.cpp \
935 VMMAll/IEMAllIntprTables3.cpp \
936 VMMAll/IEMAllIntprTables4.cpp \
937 $(if-expr !defined(IEM_WITHOUT_ASSEMBLY),VMMAll/IEMAllAImpl.asm,) \
938 VMMAll/IEMAllAImplC.cpp \
939 VMMAll/IEMAllCImpl.cpp \
940 VMMAll/IEMAllCImplSvmInstr.cpp \
941 VMMAll/IEMAllCImplVmxInstr.cpp \
942 VMMAll/IEMAllDbg.cpp \
943 VMMAll/IOMAll.cpp \
944 VMMAll/IOMAllMmioNew.cpp \
945 VMMAll/MMAll.cpp \
946 VMMAll/NEMAll.cpp \
947 VMMAll/PDMAll.cpp \
948 VMMAll/PDMAllCritSect.cpp \
949 VMMAll/PDMAllCritSectRw.cpp \
950 VMMAll/PDMAllCritSectBoth.cpp \
951 $(if-expr defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL), VMMAll/PDMAllIommu.cpp,) \
952 VMMAll/PDMAllQueue.cpp \
953 VMMAll/PDMAllTask.cpp \
954 VMMAll/PGMAll.cpp \
955 VMMAll/PGMAllHandler.cpp \
956 VMMAll/PGMAllPhys.cpp \
957 VMMAll/PGMAllPool.cpp \
958 VMMAll/SELMAll.cpp \
959 VMMAll/TMAll.cpp \
960 VMMAll/TMAllCpu.cpp \
961 VMMAll/TMAllReal.cpp \
962 VMMAll/TMAllVirtual.cpp \
963 VMMAll/TRPMAll.cpp \
964 VMMAll/VMAll.cpp \
965 VMMAll/VMMAll.cpp \
966 VMMAll/VMMAllA.asm
967 if1of ($(VBOX_LDR_FMT), pe lx)
968 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
969 endif
970 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
971 VMMR0_SOURCES += \
972 VMMR0/VMMR0TripleFaultHack.cpp \
973 VMMR0/VMMR0TripleFaultHackA.asm
974 endif
975 ifdef VBOX_WITH_NETSHAPER
976 VMMR0_SOURCES += \
977 VMMAll/PDMAllNetShaper.cpp
978 endif
979 VMMR0_SOURCES.amd64 = \
980 VMMR0/VMMR0JmpA-amd64.asm
981 VMMR0_SOURCES.x86 = \
982 VMMR0/VMMR0JmpA-x86.asm
983
984 VMMR0_LIBS = \
985 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
986 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
987 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB) \
988 $(VBOX_LIB_SUPR0)
989 ifdef VBOX_WITH_NATIVE_NEM
990 VMMR0_SOURCES.linux.amd64 += VMMR0/NEMR0Native-stubs.cpp
991 VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-stubs.cpp
992 VMMR0_SOURCES.darwin.amd64 += VMMR0/NEMR0Native-stubs.cpp
993 VMMR0_DEFS.darwin.amd64 += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
994 endif
995
996 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
997
998 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
999 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
1000 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
1001 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
1002 VMMR0_CLEAN += $(addprefix $(VMMR0_0_OUTDIR)/VMMAll/, IEMAll.cod IEMAllAImplC.cod PGMAll.cod)
1003 endif
1004
1005 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
1006
1007 if "$(KBUILD_TARGET)" == "win"
1008 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
1009 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
1010 VMMR0_LDFLAGS += /Export:PdbTypeHack
1011
1012 LIBRARIES += VMMR0PdbTypeHack
1013 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
1014 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
1015 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
1016 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
1017 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
1018 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
1019 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
1020 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
1021 endif
1022
1023 ifdef VBOX_WITH_KMOD_WRAPPED_R0_MODS
1024 # Wrapper kmod for VMMR0.r0
1025 INSTALLS.linux += vbox_vmmr0-src
1026 vbox_vmmr0-src_INST = bin/src/vbox_vmmr0/
1027 vbox_vmmr0-src_SYMLINKS = \
1028 SUPWrapperMod-linux.c=>../common/SUPWrapperMod-linux.c \
1029 Makefile-wrapper.gmk=>../common/Makefile-wrapper.gmk
1030 vbox_vmmr0-src_SOURCES = \
1031 $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/Makefile-vbox_vmmr0.gmk=>Makefile \
1032 $(VMMR0_0_OUTDIR)/VMMR0.r0=>VMMR0.r0 \
1033 $(VMMR0_0_OUTDIR)/VMMR0.debug=>VMMR0.debug
1034 endif
1035
1036endif # defined(VBOX_WITH_R0_MODULES) && !defined(VBOX_ONLY_EXTPACKS)
1037
1038
1039
1040ifndef VBOX_ONLY_EXTPACKS
1041 #
1042 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
1043 #
1044 LIBRARIES += SSMStandalone
1045 SSMStandalone_TEMPLATE = VBoxR3Exe
1046 SSMStandalone_DEFS = VBOX_IN_VMM IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE $(VMM_COMMON_DEFS)
1047 SSMStandalone_INCS = include
1048 SSMStandalone_SOURCES = \
1049 VMMR3/SSM.cpp \
1050 VMMR3/CPUMR3Db.cpp
1051endif # !VBOX_ONLY_EXTPACKS
1052
1053
1054if !defined(VBOX_ONLY_EXTPACKS) \
1055 && ( defined(VBOX_WITH_DTRACE_R3) \
1056 || defined(VBOX_WITH_DTRACE_R0) \
1057 || defined(VBOX_WITH_DTRACE_RC))
1058 #
1059 # Install the dtrace library files.
1060 #
1061 INSTALLS += VMMLibDTrace
1062 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
1063 VMMLibDTrace_SOURCES = \
1064 dtrace/lib/vbox-types.d \
1065 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
1066 $(VMMLibDTrace_0_OUTDIR)/vm.d \
1067 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
1068 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
1069 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
1070 $(VMMLibDTrace_0_OUTDIR)/x86.d
1071 $(call KB_FN_DO_PASS0_ON_TARGET,VMMLibDTrace)
1072
1073
1074 ##
1075 # Turn the header $2 into the DTrace library script $1.
1076 #
1077 define def_vmm_lib_dtrace_preprocess
1078 $$(call KB_FN_AUTO_CMD_DEPS,$$(VMMLibDTrace_0_OUTDIR)/$1)
1079 $$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
1080 $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1081 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$2)
1082 $$(QUIET)$(VBOX_VBOXCPP) -d \
1083 -D VBOX_FOR_DTRACE_LIB \
1084 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
1085 -D IN_RING0 \
1086 -D RT_C_DECLS_BEGIN= \
1087 -D RT_C_DECLS_END= \
1088 -D RT_GCC_EXTENSION= \
1089 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
1090 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
1091 -D 'R0PTRTYPE(a_Type)=a_Type' \
1092 -D 'AssertCompile(a_Expr)=' \
1093 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
1094 -D 'bool=uint8_t' \
1095 $$(foreach def,\
1096 $$(DEFS) \
1097 $$(DEFS.$$(KBUILD_TARGET)) \
1098 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
1099 $$(VMM_COMMON_DEFS) \
1100 $$(ARCH_BITS_DEFS)\
1101 ,-D '$$(def)') \
1102 $2 \
1103 $$@
1104 $$(QUIET)$$(CHMOD) 644 $$@
1105
1106 VMMLibDTrace_CLEAN += $(VMMLibDTrace_0_OUTDIR)/$1
1107 endef
1108 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
1109 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
1110 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
1111 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
1112 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
1113
1114endif
1115
1116
1117
1118#
1119# For vmmGetSvnRev.
1120#
1121VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
1122
1123#
1124# Disable annoying warnings about array subscript above array bounds in aPages[]
1125#
1126ifneq ($(KBUILD_TARGET),win)
1127 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1128 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
1129 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
1130 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
1131 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
1132endif
1133
1134#
1135# Always optimize the interpreter.
1136#
1137#if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "bird" && $(USERNAME) != "aeichner")
1138if "$(KBUILD_TYPE)" == "release" || ($(USERNAME) != "aeichner")
1139 if1of ($(KBUILD_TARGET), win)
1140 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
1141 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
1142 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
1143 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
1144 VMMAll/IEMAllAImplC.cpp_CXXFLAGS += -noover -O2xy
1145 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -noover -O2xy
1146 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -noover -O2xy
1147 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -noover -O2xy
1148 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -noover -O2xy
1149 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -noover -O2xy
1150 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -noover -O2xy
1151 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -noover -O2xy
1152 else
1153 # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
1154 VMMAll/IEMAll.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1155 VMMAll/IEMAllCImpl.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1156 VMMAll/IEMAllCImplSvmInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1157 VMMAll/IEMAllCImplVmxInstr.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1158 VMMAll/IEMAllIntprTables1.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1159 VMMAll/IEMAllIntprTables2.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1160 VMMAll/IEMAllIntprTables3.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1161 VMMAll/IEMAllIntprTables4.cpp_CXXFLAGS += -O2 -fomit-frame-pointer
1162 endif
1163endif # bird wants good stacks (aeichner as well)
1164
1165
1166# Alias the CPU database entries.
1167$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
1168
1169
1170#
1171# Process python source(s).
1172#
1173BLDDIRS += $(PATH_TARGET)/pylint
1174
1175define def_vbox_vmm_py_check
1176 $(eval name:=$(basename $(notdir $(py))))
1177
1178 pylint: $(name)-py-phony.o
1179 $(name).o: $(name)-py-phony.o
1180 $(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
1181 ifdef VBOX_WITH_PYLINT
1182 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
1183 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -- \
1184 $(VBOX_PYLINT) --rcfile=$(PATH_TARGET)/no-such-pylintrc \
1185 $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
1186 endif
1187 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
1188
1189 TESTING += $(name)-py-phony.o
1190endef # def_vbox_vmm_py_check
1191
1192$(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstPython.py IEMAllThrdPython.py IEMAllN8vePython.py ) \
1193, $(eval $(def_vbox_vmm_py_check)))
1194
1195
1196include $(FILE_KBUILD_SUB_FOOTER)
1197
1198
1199# Alias the PGM templates to the object in which they are defined.
1200PGMInternal.o: PGM.o
1201
1202PGMAllBth.o PGMAllGst.o PGMAllShw.o \
1203PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
1204
1205PGMRCBth.o PGMRCGst.o PGMRCShw.o \
1206PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
1207
1208PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
1209
1210PGMInline.o PGMInline.obj: PGMDbg.o
1211
1212# Alias the IEM templates to the object in which they are instantiated.
1213IEMAllInst.cpp.o IEMAllInst.cpp.obj \
1214IEMAllInstCommon.cpp.o IEMAllInstCommon.cpp.obj \
1215IEMAllInstOneByte.cpp.o IEMAllInstOneByte.cpp.obj \
1216IEMAllInstTwoByte0f.cpp.o IEMAllInstTwoByte0f.cpp.obj \
1217IEMAllInstThree0f38.cpp.o IEMAllInstThree0f38.cpp.obj \
1218IEMAllInstThree0f3a.cpp.o IEMAllInstThree0f3a.cpp.obj \
1219IEMAllInstVexMap1.cpp.o IEMAllInstVexMap1.cpp.obj \
1220IEMAllInstVexMap2.cpp.o IEMAllInstVexMap2.cpp.obj \
1221IEMAllInstVexMap3.cpp.o IEMAllInstVexMap3.cpp.obj \
1222IEMAllInst3DNow.cpp.o IEMAllInst3DNow.cpp.obj: IEMAllInstInterpretOnly.o
1223
1224IEMInternal.o IEMInternal.obj: IEMAll.o
1225
1226IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj: IEMAllCImpl.o
1227
1228# Alias the NEM template to the objects where it is used:
1229NEMAllNativeTemplate-win.cpp.o: NEMR3Native-win.o
1230
1231# Alias the VMX template onto HMVMXR0 or darwin specific NEM object:
1232ifeq ($(KBUILD_TARGET),darwin)
1233 VMXAllTemplate.cpp.o: NEMR3Native-darwin.o
1234else
1235 VMXAllTemplate.cpp.o: HMVMXR0.o
1236endif
1237
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