VirtualBox

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

最後變更 在這個檔案從72493是 72493,由 vboxsync 提交於 7 年 前

IEM,REM,++: Removed code related IEM_VERIFICATION_MODE and friends because it (1) adds aditional complexity and mess, (2) suffers bit rot as it's infrequently used, and (3) prevents using pVCpu->cpum.GstCtx directly.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 33.1 KB
 
1# $Id: Makefile.kmk 72493 2018-06-10 16:08:44Z vboxsync $
2## @file
3# Top-level makefile for the VMM.
4#
5
6#
7# Copyright (C) 2006-2017 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.alldomusa.eu.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21# Include sub-makefiles.
22ifndef VBOX_ONLY_EXTPACKS
23 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk
24endif
25include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
26
27
28# Fail on unsupported hosts.
29ifeq ($(KBUILD_TARGET_ARCH),x86)
30 ifeq ($(KBUILD_TARGET),darwin)
31 $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit support.)
32 else ifeq ($(KBUILD_TARGET),solaris)
33 $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit support.)
34 endif
35endif
36
37
38#
39# Globals
40#
41
42## DEFS variable that is picked up by all three VMM targets (R0, R3, RC).
43# Can be prepended to by setting it in LocalConfig.kmk
44VMM_COMMON_DEFS ?= VBOX_IN_VMM
45ifdef VBOX_WITH_2ND_IEM_STEP
46 VMM_COMMON_DEFS += VBOX_WITH_2ND_IEM_STEP
47endif
48ifdef VBOX_WITH_3RD_IEM_STEP
49 VMM_COMMON_DEFS += VBOX_WITH_3RD_IEM_STEP
50endif
51ifdef VBOX_WITH_NESTED_HWVIRT_SVM
52 VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_SVM
53endif
54ifdef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
55 VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM
56endif
57#ifdef VBOX_WITH_IEM
58# VMM_COMMON_DEFS += VBOX_WITH_IEM
59#endif
60# part of global DEFS
61#ifdef VBOX_WITH_REM
62# VMM_COMMON_DEFS += VBOX_WITH_REM
63#endif
64ifdef VBOX_WITH_MULTI_CORE
65 VMM_COMMON_DEFS += VBOX_WITH_MULTI_CORE
66endif
67ifdef VBOX_WITH_R0_LOGGING
68 VMM_COMMON_DEFS += VBOX_WITH_R0_LOGGING
69endif
70ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
71 VMM_COMMON_DEFS += VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
72endif
73ifdef VBOX_WITH_PCI_PASSTHROUGH
74 VMM_COMMON_DEFS += VBOX_WITH_PCI_PASSTHROUGH
75endif
76ifdef VBOX_WITH_DTRACE_RC
77 VMM_COMMON_DEFS += VBOX_WITH_DTRACE_RC
78endif
79ifdef VBOX_WITH_SAFE_STR
80 VMM_COMMON_DEFS += VBOX_WITH_SAFE_STR
81endif
82ifdef VBOX_WITH_RAW_RING1
83 VMM_COMMON_DEFS += VBOX_WITH_RAW_RING1
84endif
85ifdef VBOX_WITH_64ON32_IDT
86 VMM_COMMON_DEFS += VBOX_WITH_64ON32_IDT
87endif
88ifdef VBOX_WITH_64ON32_CMOS_DEBUG
89 VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG
90endif
91ifdef VBOXSTRICTRC_STRICT_ENABLED
92 VMM_COMMON_DEFS += VBOXSTRICTRC_STRICT_ENABLED
93endif
94ifeq ($(KBUILD_TARGET),amd64)
95 VMM_COMMON_DEFS += VBOX_WITH_MORE_RING0_MEM_MAPPINGS
96endif
97
98# VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS
99
100
101
102#
103# The VMM DLL.
104#
105ifndef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
106 DLLS += VBoxVMM
107endif
108VBoxVMM_TEMPLATE = VBoxR3DllNoPic
109VBoxVMM_SONAME.linux = VBoxVMM.so
110
111VBoxVMM_DEFS = IN_VMM_R3 IN_DIS IN_GMM_R3 IN_DBG $(VMM_COMMON_DEFS)
112## @todo eliminate IN_GMM_R3
113ifdef VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
114 VBoxVMM_DEFS += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
115endif
116ifdef VBOX_WITH_VUSB
117 VBoxVMM_DEFS += VBOX_WITH_USB
118endif
119ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
120 VBoxVMM_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
121endif
122ifdef VBOX_WITH_NETSHAPER
123 VBoxVMM_DEFS += VBOX_WITH_NETSHAPER
124endif
125ifdef VBOX_WITH_RAW_MODE
126 VBoxVMM_DEFS += VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0
127endif
128ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
129 VBoxVMM_DEFS += VMM_R0_SWITCH_STACK
130endif
131if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird"
132 VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
133endif
134VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
135
136VBoxVMM_INCS = \
137 include \
138 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
139 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
140VBoxVMM_ASINCS = .
141
142VBoxVMM_SOURCES = \
143 VBoxVMM.d \
144 VMMR3/APIC.cpp \
145 VMMR3/CFGM.cpp \
146 VMMR3/CPUM.cpp \
147 VMMR3/CPUMR3CpuId.cpp \
148 VMMR3/CPUMR3Db.cpp \
149 VMMR3/CPUMDbg.cpp \
150 VMMR3/DBGF.cpp \
151 VMMR3/DBGFAddr.cpp \
152 VMMR3/DBGFAddrSpace.cpp \
153 VMMR3/DBGFBp.cpp \
154 VMMR3/DBGFCoreWrite.cpp \
155 VMMR3/DBGFCpu.cpp \
156 VMMR3/DBGFDisas.cpp \
157 VMMR3/DBGFInfo.cpp \
158 VMMR3/DBGFLog.cpp \
159 VMMR3/DBGFMem.cpp \
160 VMMR3/DBGFOS.cpp \
161 VMMR3/DBGFR3PlugIn.cpp \
162 VMMR3/DBGFReg.cpp \
163 VMMR3/DBGFStack.cpp \
164 VMMR3/DBGFR3Flow.cpp \
165 VMMR3/DBGFR3Trace.cpp \
166 VMMR3/DBGFR3Type.cpp \
167 VMMR3/EM.cpp \
168 VMMR3/EMR3Dbg.cpp \
169 $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
170 VMMR3/EMHM.cpp \
171 VMMR3/EMR3Nem.cpp \
172 VMMR3/FTM.cpp \
173 VMMR3/GIM.cpp \
174 VMMR3/GIMHv.cpp \
175 VMMR3/GIMKvm.cpp \
176 VMMR3/GIMMinimal.cpp \
177 VMMR3/IEMR3.cpp \
178 VMMR3/IOM.cpp \
179 VMMR3/GMM.cpp \
180 VMMR3/MM.cpp \
181 VMMR3/MMHeap.cpp \
182 VMMR3/MMHyper.cpp \
183 VMMR3/MMPagePool.cpp \
184 VMMR3/MMUkHeap.cpp \
185 VMMR3/NEMR3.cpp \
186 VMMR3/PDM.cpp \
187 VMMR3/PDMBlkCache.cpp \
188 VMMR3/PDMDevice.cpp \
189 VMMR3/PDMDevHlp.cpp \
190 VMMR3/PDMDevMiscHlp.cpp \
191 VMMR3/PDMDriver.cpp \
192 VMMR3/PDMLdr.cpp \
193 VMMR3/PDMCritSect.cpp \
194 VMMR3/PDMQueue.cpp \
195 VMMR3/PDMThread.cpp \
196 VMMR3/PGM.cpp \
197 VMMR3/PGMDbg.cpp \
198 VMMR3/PGMR3DbgA.asm \
199 VMMR3/PGMHandler.cpp \
200 VMMR3/PGMMap.cpp \
201 VMMR3/PGMPhys.cpp \
202 VMMR3/PGMPool.cpp \
203 VMMR3/PGMSavedState.cpp \
204 VMMR3/PGMSharedPage.cpp \
205 VMMR3/SELM.cpp \
206 VMMR3/SSM.cpp \
207 VMMR3/STAM.cpp \
208 VMMR3/TM.cpp \
209 VMMR3/TRPM.cpp \
210 VMMR3/VM.cpp \
211 VMMR3/VMEmt.cpp \
212 VMMR3/VMReq.cpp \
213 VMMR3/VMM.cpp \
214 VMMR3/VMMGuruMeditation.cpp \
215 VMMR3/VMMSwitcher.cpp \
216 VMMR3/VMMTests.cpp \
217 VMMR3/HM.cpp \
218 $(if-expr defined(VBOX_WITH_RAW_MODE), \
219 VMMR3/CSAM.cpp \
220 VMMR3/PATM.cpp \
221 VMMR3/PATMPatch.cpp \
222 VMMR3/PATMGuest.cpp \
223 VMMR3/PATMA.asm \
224 VMMR3/PATMSSM.cpp \
225 VMMR3/PATMR3Dbg.cpp \
226 ,) \
227 VMMAll/APICAll.cpp \
228 VMMAll/CPUMAllRegs.cpp \
229 VMMAll/CPUMAllMsrs.cpp \
230 VMMAll/CPUMStack.cpp \
231 VMMAll/DBGFAll.cpp \
232 VMMAll/HMAll.cpp \
233 VMMAll/HMSVMAll.cpp \
234 VMMAll/IEMAll.cpp \
235 VMMAll/IEMAllAImpl.asm \
236 VMMAll/IEMAllAImplC.cpp \
237 VMMAll/IOMAll.cpp \
238 VMMAll/IOMAllMMIO.cpp \
239 VMMAll/MMAll.cpp \
240 VMMAll/MMAllHyper.cpp \
241 VMMAll/MMAllPagePool.cpp \
242 VMMAll/NEMAll.cpp \
243 VMMAll/PDMAll.cpp \
244 VMMAll/PDMAllCritSect.cpp \
245 VMMAll/PDMAllCritSectRw.cpp \
246 VMMAll/PDMAllCritSectBoth.cpp \
247 VMMAll/PDMAllQueue.cpp \
248 VMMAll/PGMAll.cpp \
249 VMMAll/PGMAllHandler.cpp \
250 VMMAll/PGMAllMap.cpp \
251 VMMAll/PGMAllPhys.cpp \
252 VMMAll/PGMAllPool.cpp \
253 VMMAll/SELMAll.cpp \
254 VMMAll/EMAll.cpp \
255 VMMAll/EMAllA.asm \
256 VMMAll/FTMAll.cpp \
257 VMMAll/GIMAll.cpp \
258 VMMAll/GIMAllHv.cpp \
259 VMMAll/GIMAllKvm.cpp \
260 VMMAll/TMAll.cpp \
261 VMMAll/TMAllCpu.cpp \
262 VMMAll/TMAllReal.cpp \
263 VMMAll/TMAllVirtual.cpp \
264 VMMAll/TRPMAll.cpp \
265 VMMAll/VMAll.cpp \
266 VMMAll/VMMAll.cpp \
267 VMMAll/VMMAllA.asm \
268 $(if-expr defined(VBOX_WITH_RAW_MODE), \
269 VMMAll/CSAMAll.cpp \
270 VMMAll/PATMAll.cpp \
271 ,)
272ifdef VBOX_WITH_VUSB
273 VBoxVMM_SOURCES += VMMR3/PDMUsb.cpp
274endif
275ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
276 VBoxVMM_SOURCES += \
277 VMMR3/PDMAsyncCompletion.cpp \
278 VMMR3/PDMAsyncCompletionFile.cpp \
279 VMMR3/PDMAsyncCompletionFileFailsafe.cpp \
280 VMMR3/PDMAsyncCompletionFileNormal.cpp
281endif
282ifdef VBOX_WITH_NETSHAPER
283 VBoxVMM_SOURCES += \
284 VMMR3/PDMNetShaper.cpp \
285 VMMAll/PDMAllNetShaper.cpp
286endif
287ifdef VBOX_WITH_REM
288 VBoxVMM_SOURCES += \
289 VMMAll/REMAll.cpp
290endif
291ifdef VBOX_WITH_RAW_MODE
292 VBoxVMM_SOURCES.x86 += \
293 VMMSwitcher/32BitTo32Bit.asm \
294 VMMSwitcher/32BitToPAE.asm \
295 VMMSwitcher/PAETo32Bit.asm \
296 VMMSwitcher/PAEToPAE.asm
297 VBoxVMM_SOURCES.amd64 = \
298 VMMSwitcher/AMD64To32Bit.asm \
299 VMMSwitcher/AMD64ToPAE.asm
300endif
301VBoxVMM_SOURCES.x86 += \
302 VMMSwitcher/32BitToAMD64.asm \
303 VMMSwitcher/PAEToAMD64.asm \
304 VMMSwitcher/X86Stub.asm
305VBoxVMM_SOURCES.amd64 += \
306 VMMSwitcher/AMD64Stub.asm
307
308if1of ($(USERNAME),bird) # experimental.
309 VBoxVMM_SOURCES.win.amd64 += VMMR3/NEMR3Native-win.cpp
310 VBoxVMM_DEFS.win.amd64 += VBOX_WITH_NATIVE_NEM
311 VBoxVMM_SDKS.win += VBOX_NTDLL
312 VMMR3/NEMR3Native-win.cpp_DEFS.amd64 = _AMD64_
313 VMMR3/NEMR3Native-win.cpp_INCS = \
314 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/um \
315 $(KBUILD_DEVTOOLS)/win.x86/sdk/v10.0.17134.0/include/10.0.17134.0/shared
316endif
317
318VBoxVMM_LIBS = \
319 $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
320ifdef VBOX_WITH_DEBUGGER
321 VBoxVMM_LIBS += \
322 $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
323endif
324VBoxVMM_LIBS += \
325 $(LIB_REM) \
326 $(LIB_RUNTIME)
327
328VBoxVMM_LIBS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
329VBoxVMM_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED)
330VBoxVMM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxVMM.dylib
331VBoxVMM_LDFLAGS.solaris = -mimpure-text
332
333# SSM wish to know the build type, host os and arch.
334VMMR3/SSM.cpp_DEFS += \
335 KBUILD_TYPE=\"$(KBUILD_TYPE)\" \
336 KBUILD_TARGET=\"$(KBUILD_TARGET)\" \
337 KBUILD_TARGET_ARCH=\"$(KBUILD_TARGET_ARCH)\"
338
339ifdef VBOX_WITH_GCC_SANITIZER
340 VMMR3/PGMPool.cpp_CXXFLAGS.linux += -fno-sanitize=address
341endif
342
343#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
344# ifeq ($(KBUILD_HOST), linux)
345#VBoxVMM_LIBS += aio
346# endif
347#endif
348
349if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
350 VBoxVMM_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
351 VBoxVMM_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
352 VBoxVMM_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
353 VBoxVMM_VMMAll/PDMAllCritSect.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
354endif
355
356$(call VBOX_SET_VER_INFO_DLL,VBoxVMM,VirtualBox VMM) # Version info / description.
357
358
359#
360# Generate macro template for IEM instruction statistics.
361#
362$(call KB_FN_DO_PASS0_ON_TARGET,VBoxVMM) # Set VBoxVMM_0_OUTDIR
363VBoxVMM_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
364VBoxVMM_CLEAN += \
365 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
366 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
367$(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts)
368$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h.ts \
369+| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h: \
370 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructions.cpp.h \
371 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsOneByte.cpp.h \
372 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h \
373 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsThree0f38.cpp.h \
374 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsThree0f3a.cpp.h \
375 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap1.cpp.h \
376 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap2.cpp.h \
377 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructionsVexMap3.cpp.h \
378 $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstructions3DNow.cpp.h
379 $(QUIET)$(call MSG_GENERATE,VBoxVMM,$@,VMMAll/IEMAllInstructions*.cpp.h)
380 $(QUIET)$(RM) -f -- "[email protected]" "[email protected]" "[email protected]"
381 $(QUIET)$(MKDIR) -p -- "$(dir $@)"
382 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
383 $(QUIET)$(SED) \
384 -e '/IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/!d' \
385 -e ':look-for-end-of-invocation' \
386 -e '/)/bend-of-invocation' \
387 -e 'N' \
388 -e 'blook-for-end-of-invocation' \
389 -e ':end-of-invocation' \
390 -e 's/\n/ /g' \
391 -e 's/ */ /g' \
392 -e 's/^.*IEMOP_MNEMONIC\(\|[01234]\|[01234]EX\)(/IEM_DO_INSTR_STAT\1(/' \
393 -e 's/;.*$(DOLLAR)//' \
394 --output "[email protected]" $(filter %.cpp.h,$^)
395# Windows sort does some kind of seeking. So, we must use a temporary file and kmk_cat to define and undefine our macros.
396 $(QUIET)$(REDIRECT) -wto "[email protected]" -- sort "[email protected]"
397 $(QUIET)$(APPEND) -nt "$@" \
398 '/* Warning autogenerated by VMM/Makefile.kmk. */ ' \
399 '#define IEM_DO_INSTR_STAT0(f,u,l,fd,fi) IEM_DO_INSTR_STAT(l, #l)' \
400 '#define IEM_DO_INSTR_STAT1(f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1, #l " " #o1)' \
401 '#define IEM_DO_INSTR_STAT2(f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2, #l " " #o1 "," #o2)' \
402 '#define IEM_DO_INSTR_STAT3(f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3, #l " " #o1 "," #o2 "," #o3)' \
403 '#define IEM_DO_INSTR_STAT4(f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(l ## _ ## o1 ## _ ## o2 ## _ ## o3 ## _ ## o4, #l " " #o1 "," #o2 "," #o3 "," #o4)' \
404 '#define IEM_DO_INSTR_STAT0EX(s,m,f,u,l,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
405 '#define IEM_DO_INSTR_STAT1EX(s,m,f,u,l,o1,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
406 '#define IEM_DO_INSTR_STAT2EX(s,m,f,u,l,o1,o2,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
407 '#define IEM_DO_INSTR_STAT3EX(s,m,f,u,l,o1,o2,o3,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
408 '#define IEM_DO_INSTR_STAT4EX(s,m,f,u,l,o1,o2,o3,o4,fd,fi) IEM_DO_INSTR_STAT(s,m)' \
409 ''
410 $(QUIET)$(REDIRECT) -ato "$@" -- $(CAT_EXT) "[email protected]"
411 $(QUIET)$(APPEND) -n "$@" \
412 '' \
413 '#undef IEM_DO_INSTR_STAT0' \
414 '#undef IEM_DO_INSTR_STAT1' \
415 '#undef IEM_DO_INSTR_STAT2' \
416 '#undef IEM_DO_INSTR_STAT3' \
417 '#undef IEM_DO_INSTR_STAT4' \
418 '#undef IEM_DO_INSTR_STAT0EX' \
419 '#undef IEM_DO_INSTR_STAT1EX' \
420 '#undef IEM_DO_INSTR_STAT2EX' \
421 '#undef IEM_DO_INSTR_STAT3EX' \
422 '#undef IEM_DO_INSTR_STAT4EX' \
423 ''
424 $(QUIET)$(RM) -f -- "[email protected]" "[email protected]"
425 $(QUIET)$(CP) -v -f --changed -- "$@" "$(patsubst %.ts,%,$@)"
426
427foobar: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
428
429if "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS)
430 #
431 # Debug type info hack for VMCPU, VM and similar.
432 #
433 # The microsoft linker seems to be using the last occurence of the structures
434 # when writing the module PDB file. So, we put the fully complete structures
435 # in a library which is at the end of the library list.
436 #
437 VBoxVMM_LIBS += $(VBoxVMMPdbTypeHack_1_TARGET)
438 VBoxVMM_LDFLAGS += /Export:PdbTypeHack
439
440 LIBRARIES += VBoxVMMPdbTypeHack
441 VBoxVMMPdbTypeHack_TEMPLATE = $(VBoxVMM_TEMPLATE)
442 VBoxVMMPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
443 VBoxVMMPdbTypeHack_DEFS = $(VBoxVMM_DEFS)
444 VBoxVMMPdbTypeHack_DEFS.win = $(VBoxVMM_DEFS.win)
445 VBoxVMMPdbTypeHack_DEFS.win.x86 = $(VBoxVMM_DEFS.win.x86)
446 VBoxVMMPdbTypeHack_DEFS.win.amd64 = $(VBoxVMM_DEFS.win.amd64)
447 VBoxVMMPdbTypeHack_INCS = $(VBoxVMM_INCS)
448 VBoxVMMPdbTypeHack_INTERMEDIATES = $(VBoxVMM_INTERMEDIATES)
449endif
450
451
452if defined(VBOX_WITH_RAW_MODE) && $(intersects $(VBOX_LDR_FMT32), pe lx)
453
454 #
455 # VMMRCBuiltin.lib
456 #
457 LIBRARIES += VMMRCBuiltin
458 VMMRCBuiltin_TEMPLATE = VBoxRc
459 ifeq ($(VBOX_LDR_FMT32),pe)
460 VMMRCBuiltin_SOURCES = VMMRC/VMMRCBuiltin.def
461 endif
462 ifeq ($(VBOX_LDR_FMT32),lx)
463 VMMRCBuiltin_SOURCES = $(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def
464 $$(VMMRCBuiltin_0_OUTDIR)/VMMRCBuiltin.def: $(PATH_SUB_CURRENT)/VMMRC/VMMRCBuiltin.def | $$(dir $$@)
465 $(SED) -e '/not-os2/d' -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' -e 's/[ \t]DATA[ \t]*/ /' --output $@ $<
466 endif
467
468
469 #
470 # VMMRCImp.lib
471 #
472 LIBRARIES += VMMRCImp
473 VMMRCImp_TEMPLATE = VBoxRc
474 VMMRCImp_SOURCES = $(VMMRCImp_0_OUTDIR)/VMMRC.def
475 VMMRCImp_CLEAN = $(VMMRCImp_0_OUTDIR)/VMMRC.def
476 $(call KB_FN_DO_PASS0_ON_TARGET,VMMRCImp)
477
478 $(call KB_FN_AUTO_CMD_DEPS,$(VMMRCImp_0_OUTDIR)/VMMRC.def)
479 $(VMMRCImp_0_OUTDIR)/VMMRC.def: $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def | $$(dir $$@)
480 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
481 ifeq ($(VBOX_LDR_FMT32),lx)
482 $(SED) \
483 -e '/not-os2/d' \
484 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
485 -e 's/[ \t]DATA[ \t]*/ /' \
486 --output $@ \
487 $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def
488 $(APPEND) "$@" ""
489 $(APPEND) "$@" " ___ehInit"
490 else
491 $(SED) \
492 -e '/not-win/d' \
493 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
494 --output $@ $(VMMRCImp_DEFPATH)/VMMRC/VMMRC.def
495 endif
496
497endif # RC && (pe || lx)
498
499
500if1of ($(VBOX_LDR_FMT), pe lx)
501 #
502 # VMMR0Imp.lib
503 #
504 LIBRARIES += VMMR0Imp
505 VMMR0Imp_TEMPLATE = VBoxR0
506 VMMR0Imp_SOURCES = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
507 VMMR0Imp_CLEAN = $(VMMR0Imp_0_OUTDIR)/VMMR0.def
508 ifeq ($(KBUILD_TARGET),win) # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
509 VMMR0Imp_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
510 endif
511 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR0Imp)
512
513 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR0Imp_0_OUTDIR)/VMMR0.def)
514 $(VMMR0Imp_0_OUTDIR)/VMMR0.def: $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def | $$(dir $$@)
515 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
516 ifeq ($(VBOX_LDR_FMT),lx)
517 $(SED) \
518 -e '/not-os2/d' \
519 -e '/not-amd64/d' \
520 -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
521 -e 's/[ \t]DATA[ \t]*/ /' \
522 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
523 $(APPEND) "$@" ""
524 $(APPEND) "$@" " ___ehInit"
525 else
526 $(SED) \
527 -e '/not-win/d' \
528 -e '/not-$(KBUILD_TARGET_ARCH)/d' \
529 --output $@ $(VMMR0Imp_DEFPATH)/VMMR0/VMMR0.def
530 endif
531endif # R0: pe + lx
532
533
534#
535# VMMR3Imp.lib
536#
537IMPORT_LIBS += VMMR3Imp
538$(call VBOX_GENERATE_IMPORT_TARGET_FN,VMMR3Imp,VBoxVMM,VMMR3/VMMR3.def)
539
540ifneq ($(VBOX_LIB_VMM_LAZY),$(LIB_VMM))
541 #
542 # VMMR3LazyImp.lib (experimental)
543 #
544 LIBRARIES += VMMR3LazyImp
545 VMMR3LazyImp_TEMPLATE = VBoxR3Dll
546 VMMR3LazyImp_INST = $(INST_LIB)
547 VMMR3LazyImp_SOURCES = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
548 VMMR3LazyImp_CLEAN = $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm
549 $(call KB_FN_DO_PASS0_ON_TARGET,VMMR3LazyImp)
550
551 $(call KB_FN_AUTO_CMD_DEPS,$(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm)
552 $(VMMR3LazyImp_0_OUTDIR)/VMMR3LazyLoad.asm: $(VMMR3LazyImp_DEFPATH)/VMMR3/VMMR3.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
553 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
554 $(VBOX_DEF_2_LAZY_LOAD) --output $@ --library VBoxVMM $(VMMR3LazyImp_DEFPATH)/VMMR3/VMMR3.def
555endif
556
557
558if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
559 #
560 # VMMRC.rc
561 #
562 SYSMODS += VMMRC
563 VMMRC_TEMPLATE = VBoxRc
564 VMMRC_NAME = VMMRC
565
566 VMMRC_DEFS = IN_VMM_RC IN_RT_RC IN_DIS DIS_CORE_ONLY VBOX_WITH_RAW_MODE VBOX_WITH_RAW_MODE_NOT_R0 IN_SUP_RC \
567 $(VMM_COMMON_DEFS)
568 VMMRC_DEFS := $(filter-out VBOX_WITH_NESTED_HWVIRT_SVM,$(VMMRC_DEFS))
569 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
570 VMMRC_DEFS += VMM_R0_SWITCH_STACK
571 endif
572
573 VMMRC_INCS = \
574 include \
575 VMMRC \
576 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
577 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
578
579 VMMRC_LIBS = \
580 $(PATH_STAGE_LIB)/DisasmRC$(VBOX_SUFF_LIB) \
581 $(PATH_STAGE_LIB)/RuntimeRC$(VBOX_SUFF_LIB) \
582 $(PATH_STAGE_LIB)/SUPRC$(VBOX_SUFF_LIB)
583 ifneq ($(filter pe lx,$(VBOX_LDR_FMT32)),)
584 VMMRC_LIBS += \
585 $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB)
586 endif
587
588 VMMRC_SOURCES = \
589 VBoxVMM.d \
590 VMMRC/VMMRC0.asm \
591 VMMRC/VMMRCDeps.cpp \
592 VMMRC/CPUMRC.cpp \
593 VMMRC/CPUMRCA.asm \
594 VMMRC/CPUMRCPatchHlp.asm \
595 VMMRC/EMRCA.asm \
596 VMMRC/IOMRC.cpp \
597 VMMRC/MMRamRC.cpp \
598 VMMRC/MMRamRCA.asm \
599 VMMRC/PDMRCDevice.cpp \
600 VMMRC/PGMRC.cpp \
601 VMMRC/SELMRC.cpp \
602 VMMRC/TRPMRC.cpp \
603 VMMRC/TRPMRCHandlers.cpp \
604 VMMRC/TRPMRCHandlersA.asm \
605 VMMRC/VMMRC.cpp \
606 VMMRC/VMMRCA.asm \
607 $(if-expr defined(VBOX_WITH_RAW_MODE), \
608 VMMRC/CSAMRC.cpp \
609 VMMRC/PATMRC.cpp \
610 ,) \
611 VMMRZ/CPUMRZ.cpp \
612 VMMRZ/CPUMRZA.asm \
613 VMMRZ/DBGFRZ.cpp \
614 VMMRZ/PGMRZDynMap.cpp \
615 VMMRZ/VMMRZ.cpp \
616 VMMAll/APICAll.cpp \
617 VMMAll/CPUMAllRegs.cpp \
618 VMMAll/CPUMAllMsrs.cpp \
619 VMMAll/DBGFAll.cpp \
620 VMMAll/IEMAll.cpp \
621 VMMAll/IEMAllAImpl.asm \
622 VMMAll/IEMAllAImplC.cpp \
623 VMMAll/IOMAll.cpp \
624 VMMAll/IOMAllMMIO.cpp \
625 VMMAll/EMAll.cpp \
626 VMMAll/EMAllA.asm \
627 VMMAll/FTMAll.cpp \
628 VMMAll/GIMAll.cpp \
629 VMMAll/GIMAllHv.cpp \
630 VMMAll/GIMAllKvm.cpp \
631 VMMAll/HMAll.cpp \
632 VMMAll/HMSVMAll.cpp \
633 VMMAll/MMAll.cpp \
634 VMMAll/MMAllHyper.cpp \
635 VMMAll/PDMAll.cpp \
636 VMMAll/PDMAllCritSect.cpp \
637 VMMAll/PDMAllCritSectRw.cpp \
638 VMMAll/PDMAllCritSectBoth.cpp \
639 VMMAll/PDMAllQueue.cpp \
640 VMMAll/PGMAll.cpp \
641 VMMAll/PGMAllHandler.cpp \
642 VMMAll/PGMAllMap.cpp \
643 VMMAll/PGMAllPhys.cpp \
644 VMMAll/PGMAllPool.cpp \
645 VMMAll/SELMAll.cpp \
646 VMMAll/TMAll.cpp \
647 VMMAll/TMAllCpu.cpp \
648 VMMAll/TMAllReal.cpp \
649 VMMAll/TMAllVirtual.cpp \
650 VMMAll/TRPMAll.cpp \
651 VMMAll/VMAll.cpp \
652 VMMAll/VMMAll.cpp \
653 VMMAll/VMMAllA.asm \
654 $(if-expr defined(VBOX_WITH_RAW_MODE), \
655 VMMAll/CSAMAll.cpp \
656 VMMAll/PATMAll.cpp \
657 ,)
658 ifeq ($(VBOX_LDR_FMT32),pe)
659 VMMRC_SOURCES += VMMRC/VMMRC.def
660 endif
661 ifeq ($(VBOX_LDR_FMT32),lx)
662 VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
663 endif
664 ifdef VBOX_WITH_REM
665 VMMRC_SOURCES += \
666 VMMAll/REMAll.cpp
667 endif
668
669 # The very last one.
670 VMMRC_SOURCES += \
671 VMMRC/VMMRC99.asm
672
673 VMMRC/VMMRCDeps.cpp_CXXFLAGS.win = -Oi- -TC ## @todo rename VMMRCDeps.cpp to .c
674
675 $(call VBOX_SET_VER_INFO_RC,VMMRC,VirtualBox VMM - raw-mode context parts) # Version info / description.
676
677 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
678 VMMRC_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
679 VMMRC_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
680 VMMRC_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
681 endif
682
683 VMMRC_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
684
685 if "$(KBUILD_TARGET)" == "win"
686 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
687 VMMRC_LIBS += $(VMMRCPdbTypeHack_1_TARGET)
688 VMMRC_LDFLAGS += /Export:PdbTypeHack
689
690 LIBRARIES += VMMRCPdbTypeHack
691 VMMRCPdbTypeHack_TEMPLATE = $(VMMRC_TEMPLATE)
692 VMMRCPdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
693 VMMRCPdbTypeHack_DEFS = $(VMMRC_DEFS)
694 VMMRCPdbTypeHack_DEFS.win = $(VMMRC_DEFS.win)
695 VMMRCPdbTypeHack_DEFS.win.x86 = $(VMMRC_DEFS.win.x86)
696 VMMRCPdbTypeHack_DEFS.win.amd64 = $(VMMRC_DEFS.win.amd64)
697 VMMRCPdbTypeHack_INCS = $(VMMRC_INCS)
698 VMMRCPdbTypeHack_INTERMEDIATES = $(VMMRC_INTERMEDIATES)
699 endif
700
701endif # VBOX_WITH_RAW_MODE && !VBOX_ONLY_EXTPACKS
702
703
704ifndef VBOX_ONLY_EXTPACKS
705 #
706 # VMMR0.r0
707 #
708 SYSMODS += VMMR0
709 VMMR0_TEMPLATE = VBoxR0
710 VMMR0_SYSSUFF = .r0
711
712 VMMR0_DEFS = IN_VMM_R0 IN_RT_R0 IN_DIS DIS_CORE_ONLY IN_GVMM_R0 IN_GMM_R0 IN_INTNET_R0 \
713 $(VMM_COMMON_DEFS) RTASSERT_HAVE_SHOULD_PANIC
714 ## @todo eliminate IN_GVMM_R0 IN_GMM_R0
715 ifdef VBOX_WITH_PCI_PASSTHROUGH
716 VMMR0_DEFS += IN_PCIRAW_R0
717 endif
718 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
719 VMMR0_DEFS += VBOX_WITH_TRIPLE_FAULT_HACK
720 endif
721 ifdef VBOX_WITH_RAW_MODE
722 VMMR0_DEFS += VBOX_WITH_RAW_MODE
723 endif
724 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
725 VMMR0_DEFS += VMM_R0_SWITCH_STACK
726 endif
727 if1of ($(KBUILD_TARGET), darwin linux win)
728 VMMR0_DEFS += VMM_R0_TOUCH_FPU
729 endif
730 VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
731 VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
732
733 ifeq ($(VBOX_LDR_FMT),elf)
734 VMMR0_CXXFLAGS += -Wunused -Wunused-variable -Wno-unused-parameter
735 endif
736
737 VMMR0_INCS = \
738 include \
739 $(if-expr defined(VBOX_WITH_RAW_MODE),PATM,) \
740 $(VBoxVMM_0_OUTDIR)/CommonGenIncs
741
742 VMMR0_SOURCES = \
743 VBoxVMM.d \
744 VMMR0/CPUMR0.cpp \
745 VMMR0/CPUMR0A.asm \
746 VMMR0/GIMR0.cpp \
747 VMMR0/GIMR0Hv.cpp \
748 VMMR0/GIMR0Kvm.cpp \
749 VMMR0/GMMR0.cpp \
750 VMMR0/GVMMR0.cpp \
751 VMMR0/HMR0.cpp \
752 VMMR0/HMR0A.asm \
753 VMMR0/HMVMXR0.cpp \
754 VMMR0/HMSVMR0.cpp \
755 VMMR0/PDMR0Device.cpp \
756 VMMR0/PDMR0Driver.cpp \
757 VMMR0/PGMR0.cpp \
758 VMMR0/PGMR0SharedPage.cpp \
759 VMMR0/TRPMR0.cpp \
760 VMMR0/TRPMR0A.asm \
761 VMMR0/VMMR0.cpp \
762 VMMRZ/CPUMRZ.cpp \
763 VMMRZ/CPUMRZA.asm \
764 VMMRZ/DBGFRZ.cpp \
765 VMMRZ/VMMRZ.cpp \
766 VMMAll/APICAll.cpp \
767 VMMAll/CPUMAllRegs.cpp \
768 VMMAll/CPUMAllMsrs.cpp \
769 VMMAll/CPUMStack.cpp \
770 VMMAll/DBGFAll.cpp \
771 VMMAll/EMAll.cpp \
772 VMMAll/EMAllA.asm \
773 VMMAll/FTMAll.cpp \
774 VMMAll/GIMAll.cpp \
775 VMMAll/GIMAllHv.cpp \
776 VMMAll/GIMAllKvm.cpp \
777 VMMAll/HMAll.cpp \
778 VMMAll/HMSVMAll.cpp \
779 VMMAll/IEMAll.cpp \
780 VMMAll/IEMAllAImpl.asm \
781 VMMAll/IEMAllAImplC.cpp \
782 VMMAll/IOMAll.cpp \
783 VMMAll/IOMAllMMIO.cpp \
784 VMMAll/MMAll.cpp \
785 VMMAll/MMAllHyper.cpp \
786 VMMAll/MMAllPagePool.cpp \
787 VMMAll/NEMAll.cpp \
788 VMMAll/PDMAll.cpp \
789 VMMAll/PDMAllCritSect.cpp \
790 VMMAll/PDMAllCritSectRw.cpp \
791 VMMAll/PDMAllCritSectBoth.cpp \
792 VMMAll/PDMAllQueue.cpp \
793 VMMAll/PGMAll.cpp \
794 VMMAll/PGMAllHandler.cpp \
795 VMMAll/PGMAllMap.cpp \
796 VMMAll/PGMAllPhys.cpp \
797 VMMAll/PGMAllPool.cpp \
798 VMMAll/SELMAll.cpp \
799 VMMAll/TMAll.cpp \
800 VMMAll/TMAllCpu.cpp \
801 VMMAll/TMAllReal.cpp \
802 VMMAll/TMAllVirtual.cpp \
803 VMMAll/TRPMAll.cpp \
804 VMMAll/VMAll.cpp \
805 VMMAll/VMMAll.cpp \
806 VMMAll/VMMAllA.asm
807 if1of ($(VBOX_LDR_FMT), pe lx)
808 VMMR0_SOURCES += $(VMMR0Imp_0_OUTDIR)/VMMR0.def
809 endif
810 ifdef VBOX_WITH_TRIPLE_FAULT_HACK
811 VMMR0_SOURCES += \
812 VMMR0/VMMR0TripleFaultHack.cpp \
813 VMMR0/VMMR0TripleFaultHackA.asm
814 endif
815 ifdef VBOX_WITH_NETSHAPER
816 VMMR0_SOURCES += \
817 VMMAll/PDMAllNetShaper.cpp
818 endif
819 ifdef VBOX_WITH_REM
820 VMMR0_SOURCES += \
821 VMMAll/REMAll.cpp
822 endif
823 VMMR0_SOURCES.amd64 = \
824 VMMR0/VMMR0JmpA-amd64.asm
825 VMMR0_SOURCES.x86 = \
826 VMMR0/VMMR0JmpA-x86.asm
827
828 VMMR0_LIBS = \
829 $(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
830 $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \
831 $(PATH_STAGE_LIB)/DisasmR0$(VBOX_SUFF_LIB)
832 ifneq ($(filter pe lx,$(VBOX_LDR_FMT)),)
833 VMMR0_LIBS += \
834 $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)
835 endif
836 if1of ($(USERNAME),bird) # experimental.
837 VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-win.cpp
838 VMMR0_DEFS.win.amd64 += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
839 VMMR0/NEMR0Native-win.cpp_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
840 endif
841
842 $(call VBOX_SET_VER_INFO_R0,VMMR0,VirtualBox VMM - ring-0 context parts) # Version info / description.
843
844 if "$(USERNAME)" == "bird" && "$(KBUILD_TARGET)" == "win"
845 VMMR0_VMMAll/IEMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
846 VMMR0_VMMAll/IEMAllAImplC.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
847 VMMR0_VMMAll/PGMAll.cpp_CXXFLAGS = /FAcs /Fa$(subst /,\\,$(outbase).cod)
848 endif
849
850 VMMR0_INTERMEDIATES += $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMInstructionStatisticsTmpl.h
851
852 if "$(KBUILD_TARGET)" == "win"
853 # Debug type info hack for VMCPU, VM and similar. See VBoxVMM for details.
854 VMMR0_LIBS += $(VMMR0PdbTypeHack_1_TARGET)
855 VMMR0_LDFLAGS += /Export:PdbTypeHack
856
857 LIBRARIES += VMMR0PdbTypeHack
858 VMMR0PdbTypeHack_TEMPLATE = $(VMMR0_TEMPLATE)
859 VMMR0PdbTypeHack_SOURCES = VMMAll/AllPdbTypeHack.cpp
860 VMMR0PdbTypeHack_DEFS = $(VMMR0_DEFS)
861 VMMR0PdbTypeHack_DEFS.win = $(VMMR0_DEFS.win)
862 VMMR0PdbTypeHack_DEFS.win.x86 = $(VMMR0_DEFS.win.x86)
863 VMMR0PdbTypeHack_DEFS.win.amd64 = $(VMMR0_DEFS.win.amd64)
864 VMMR0PdbTypeHack_INCS = $(VMMR0_INCS)
865 VMMR0PdbTypeHack_INTERMEDIATES = $(VMMR0_INTERMEDIATES)
866 endif
867
868endif # !VBOX_ONLY_EXTPACKS
869
870
871
872ifndef VBOX_ONLY_EXTPACKS
873 #
874 # SSMStandalone.lib/a for linking with VBoxSVC and other executables.
875 #
876 LIBRARIES += SSMStandalone
877 SSMStandalone_TEMPLATE = VBOXR3EXE
878 SSMStandalone_DEFS = IN_VMM_R3 IN_VMM_STATIC SSM_STANDALONE CPUM_DB_STANDALONE
879 SSMStandalone_INCS = include
880 SSMStandalone_SOURCES = \
881 VMMR3/SSM.cpp \
882 VMMR3/CPUMR3Db.cpp
883endif # !VBOX_ONLY_EXTPACKS
884
885
886if !defined(VBOX_ONLY_EXTPACKS) \
887 && ( defined(VBOX_WITH_DTRACE_R3) \
888 || defined(VBOX_WITH_DTRACE_R0) \
889 || defined(VBOX_WITH_DTRACE_RC))
890 #
891 # Install the dtrace library files.
892 #
893 INSTALLS += VMMLibDTrace
894 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/
895 VMMLibDTrace_SOURCES = \
896 dtrace/lib/vbox-types.d \
897 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \
898 $(VMMLibDTrace_0_OUTDIR)/vm.d \
899 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \
900 $(VMMLibDTrace_0_OUTDIR)/cpum.d \
901 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \
902 $(VMMLibDTrace_0_OUTDIR)/x86.d
903 $(call KB_FN_DO_PASS0_ON_TARGET,VMMLibDTrace)
904
905
906 ##
907 # Turn the header $2 into the DTrace library script $1.
908 #
909 define def_vmm_lib_dtrace_preprocess
910 $$(call KB_FN_AUTO_CMD_DEPS,$$(VMMLibDTrace_0_OUTDIR)/$1)
911 $$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
912 $$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
913 $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$2)
914 $$(QUIET)$(VBOX_VBOXCPP) -d \
915 -D VBOX_FOR_DTRACE_LIB \
916 -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
917 -D IN_RING0 \
918 -D RT_C_DECLS_BEGIN= \
919 -D RT_C_DECLS_END= \
920 -D 'RCPTRTYPE(a_Type)=RTRCPTR' \
921 -D 'R3PTRTYPE(a_Type)=RTR3PTR' \
922 -D 'R0PTRTYPE(a_Type)=a_Type' \
923 -D 'AssertCompile(a_Expr)=' \
924 -D 'AssertCompileSize(a_Stuct, a_Size)=' \
925 -D 'bool=uint8_t' \
926 $$(foreach def,\
927 $$(DEFS) \
928 $$(DEFS.$$(KBUILD_TARGET)) \
929 $$(DEFS.$(KBUILD_TARGET_ARCH)) \
930 $$(VMM_COMMON_DEFS) \
931 $$(ARCH_BITS_DEFS)\
932 ,-D '$$(def)') \
933 $2 \
934 $$@
935 $$(QUIET)$$(CHMOD) 644 $$@
936 endef
937 $(evalcall2 def_vmm_lib_dtrace_preprocess,vm.d,$(PATH_ROOT)/include/VBox/vmm/vm.h)
938 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpumctx.d,$(PATH_ROOT)/include/VBox/vmm/cpumctx.h)
939 $(evalcall2 def_vmm_lib_dtrace_preprocess,cpum.d,$(PATH_ROOT)/include/VBox/vmm/cpum.h)
940 $(evalcall2 def_vmm_lib_dtrace_preprocess,CPUMInternal.d,$(PATH_SUB_CURRENT)/include/CPUMInternal.h)
941 $(evalcall2 def_vmm_lib_dtrace_preprocess,x86.d,$(PATH_ROOT)/include/iprt/x86.h)
942
943endif
944
945
946
947#
948# For vmmGetSvnRev.
949#
950VMMAll/VMMAll.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
951
952#
953# Disable annoying warnings about array subscript above array bounds in aPages[]
954#
955ifneq ($(KBUILD_TARGET),win)
956 VMMR3/PGMPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
957 VMMAll/PGMAllPool.cpp_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds)
958 VMMAll/PGMAll.cpp_CXXFLAGS = -Wno-unused-function
959 VMMAll/IEMAll.cpp_CXXFLAGS = -Wno-unused-function
960 VMMR0/GMMR0.cpp_CXXFLAGS = -Wno-unused-value
961endif
962
963#
964# Always optimize the interpreter.
965#
966if $(USERNAME) != "bird" || "$(KBUILD_TYPE)" == "release" #|| "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64"
967 if1of ($(KBUILD_TARGET), win)
968 # -noover is recognized despite the statement saying otherwise. It silences these warnings:
969 # cl : Command line warning D9025 : overriding '/Od' with '/O2'
970 # cl : Command line warning D9025 : overriding '/Oy-' with '/Oy'
971 VMMAll/IEMAll.cpp_CXXFLAGS += -noover -O2xy
972 else
973 VMMAll/IEMAll.cpp_CXXFLAGS += -O2
974 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-align-functions -fno-align-jumps -fno-align-loops # Saves a few of percents, not worth it.
975 #VMMAll/IEMAll.cpp_CXXFLAGS += -fno-reorder-blocks # Saves one or two percent ... never mind.
976 VMMAll/IEMAll.cpp_CXXFLAGS += -fomit-frame-pointer # Omitting the frame pointer results in larger code, but it might be worth it. (esp addressing vs ebp?)
977 endif
978endif # bird wants good stacks
979
980
981# Alias the CPU database entries.
982$(foreach base,$(notdir $(basename $(wildcard $(PATH_SUB_CURRENT)/VMMR3/cpus/*.h))), $(eval $(base).o $(base).obj: CPUMR3Db.o))
983
984
985#
986# Process python source(s).
987#
988BLDDIRS += $(PATH_TARGET)/pylint
989
990define def_vbox_vmm_py_check
991$(eval name:=$(basename $(notdir $(py))))
992
993pylint:: $(name)-py-phony.o
994$(name).o: $(name)-py-phony.o
995$(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
996ifdef VBOX_WITH_PYLINT
997 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
998 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -- \
999 $(VBOX_PYLINT) --rcfile=$(PATH_TARGET)/no-such-pylintrc \
1000 $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
1001endif
1002 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
1003
1004TESTING += $(name)-py-phony.o
1005endef # def_vbox_vmm_py_check
1006
1007$(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstructionsPython.py ) , $(eval $(def_vbox_vmm_py_check)))
1008
1009
1010#
1011# Test for undefined symbols.
1012#
1013if1of ($(SYSMODS),VMMRC)
1014 test-undef-rc:: $(PATH_TARGET)/undef-rc.run
1015 OTHERS += $(PATH_TARGET)/undef-rc.run
1016 CLEANS += $(PATH_TARGET)/undef-rc.run
1017 $(call KB_FN_AUTO_CMD_DEPS,$(PATH_TARGET)/undef-rc.run)
1018 $(PATH_TARGET)/undef-rc.run: $$(VMMRC_1_TARGET)
1019 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1020 ifn1of ($(KBUILD_TARGET), linux solaris)
1021 else
1022 $(call MSG_L1,VMM: Testing for undefined symbols in VMMRC using nm...)
1023 $(QUIET)$(VBOX_NM) $^ 2> /dev/null \
1024 | $(SED) -n \
1025 -e '/^ *U .*/!d' \
1026 -e 's/ *U //' \
1027 \
1028 -e '/^g_VM\>/d'\
1029 -e '/^g_CPUM\>/d'\
1030 -e '/^g_Logger\>/d'\
1031 -e '/^g_RelLogger\>/d'\
1032 -e '/^g_TRPM\>/d'\
1033 -e '/^g_TRPMCPU\>/d'\
1034 -e '/^g_pSUPGlobalInfoPage\>/d'\
1035 -e '/^g_trpmHyperCtxCore\>/d' \
1036 -e '/^g_trpmGuestCtxCore\>/d' \
1037 \
1038 -e 's/\(.*\)$(DOLLAR)/ Undefined symbol: \1/' \
1039 -e 'p' \
1040 -e 'q 1'
1041 endif
1042 $(QUIET)$(APPEND) -t $@
1043endif
1044
1045include $(FILE_KBUILD_SUB_FOOTER)
1046
1047
1048# Alias the PGM templates to the object in which they are defined.
1049PGMInternal.o \
1050PGMBth.o PGMGst.o PGMShw.o \
1051PGMBth.obj PGMGst.obj PGMShw.obj: PGM.o
1052
1053PGMAllBth.o PGMAllGst.o PGMAllShw.o \
1054PGMAllBth.obj PGMAllGst.obj PGMAllShw.obj: PGMAll.o
1055
1056PGMRCBth.o PGMRCGst.o PGMRCShw.o \
1057PGMRCBth.obj PGMRCGst.obj PGMRCShw.obj: PGMRC.o
1058
1059PGMPhysRWTmpl.o PGMPhysRWTmpl.obj: PGMPhys.o
1060
1061PGMInline.o PGMInline.obj: PGMDbg.o
1062
1063# Alias the IEM templates to the object in which they are instantiated.
1064IEMInternal.o \
1065IEMAllInstructions.cpp.o IEMAllInstructions.cpp.obj \
1066IEMAllInstructionsOneByte.cpp.o IEMAllInstructionsOneByte.cpp.obj \
1067IEMAllInstructionsTwoByte0f.cpp.o IEMAllInstructionsTwoByte0f.cpp.obj \
1068IEMAllInstructionsThree0f38.cpp.o IEMAllInstructionsThree0f38.cpp.obj \
1069IEMAllInstructionsThree0f3a.cpp.o IEMAllInstructionsThree0f3a.cpp.obj \
1070IEMAllInstructionsVexMap1.cpp.o IEMAllInstructionsVexMap1.cpp.obj \
1071IEMAllInstructionsVexMap2.cpp.o IEMAllInstructionsVexMap2.cpp.obj \
1072IEMAllInstructionsVexMap3.cpp.o IEMAllInstructionsVexMap3.cpp.obj \
1073IEMAllInstructions3DNow.cpp.o IEMAllInstructions3DNow.cpp.obj \
1074IEMAllCImpl.cpp.o IEMAllCImpl.cpp.obj \
1075IEMAllCImplStrInstr.cpp.o IEMAllCImplStrInstr.cpp.obj \
1076IEMAllCImplSvmInstr.cpp.o IEMAllCImplSvmInstr.cpp.obj \
1077IEMAllCImplVmxInstr.cpp.o IEMAllCImplVmxInstr.cpp.obj: IEMAll.o
1078
1079# Alias the NEM template to the objects where it is used:
1080NEMAllNativeTemplate-win.cpp.o: NEMR3Native-win.o NEMR0Native-win.o
1081
1082# Alias the switcher templates.
1083PAEand32Bit.o PAEand32Bit.obj: PAETo32Bit.o PAEToPAE.o 32BitTo32Bit.o PAETo32Bit.o
1084LegacyandAMD64.o LegacyandAMD64.obj: 32BitToAMD64.o PAEToAMD64.o
1085AMD64andLegacy.o AMD64andLegacy.obj: AMD64To32Bit.o AMD64ToPAE.o
1086
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette