VirtualBox

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

Last change on this file since 107194 was 107194, checked in by vboxsync, 7 weeks ago

VMM: More adjustments for VBOX_WITH_ONLY_PGM_NEM_MODE, VBOX_WITH_MINIMAL_R0, VBOX_WITH_HWVIRT and such. jiraref:VBP-1466

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