-
Notifications
You must be signed in to change notification settings - Fork 12
/
Emulator.dsc
213 lines (204 loc) · 8.77 KB
/
Emulator.dsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
## @file
#
# Copyright (c) 2017, Linaro, Ltd. <ard.biesheuvel@linaro.org>
# Copyright (c) 2022-2023, Intel Corporation. All rights reserved.<BR>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
##
[Defines]
PLATFORM_NAME = Emulator
PLATFORM_GUID = 62ad1d2c-27bf-4021-b32d-268d0e71c032
PLATFORM_VERSION = 0.98
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/MultiArchUefiPkg
SUPPORTED_ARCHITECTURES = AARCH64|RISCV64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
#
# How do you want to log?
# - SERIAL: use EFI_SERIAL_IO_PROTOCOL. This is the most versatile
# choice, which works equally well for direct-included
# firmware builds and for side-loading the driver, but
# it assumes the presence of a single UART.
# - CONOUT: use Console Output device from EFI_SYSTEM_TABLE. Only
# useful for side-loading, not for direct-included
# firmware builds.
# - SBI: use SBI console services. Only for RISC-V.
# - NONE: use nothing. Logging is for wimps - optimize for size
# and performance!
#
MAU_STANDALONE_LOGGING = SERIAL
#
# Use a dedicated native stack for handling emulation.
#
MAU_ON_PRIVATE_STACK = NO
#
# Attempt some operation on UEFI implementations without
# an enabled MMU, by relying on the illegal instruction
# handler. It won't work well and is only supported on RISC-V.
# Implies MAU_WRAPPED_ENTRY_POINTS=YES.
#
# On by default in RISC-V builds (via INF file).
#
MAU_TRY_WITHOUT_MMU = NO
#
# Use an emulated entry point, instead of relying on
# exception-driven thunking of native to emulated code.
#
# On by default in RISC-V builds (via INF file).
#
MAU_WRAPPED_ENTRY_POINTS = NO
#
# Handle unexpected/non-linear control flow by native code,
# that can result in a resource leak inside the emulator.
# On by default in DEBUG builds (via INF file).
#
MAU_CHECK_ORPHAN_CONTEXTS = NO
#
# For maximum performance, don't periodically bail out
# of emulation. This is only useful for situations where
# you know the executed code won't do tight loops polling
# on some memory location updated by an event.
#
MAU_EMU_TIMEOUT_NONE = NO
#
# If you want to support x64 UEFI boot service drivers
# and applications, say YES. Saying NO doesn't make sense
# for the AARCH64 build.
#
MAU_SUPPORTS_X64_BINS = YES
#
# If you want to support AArch64 UEFI boot service drivers
# and applications, say YES. Not available for the AARCH64
# build.
#
MAU_SUPPORTS_AARCH64_BINS = NO
#
# Say YES if you want to ignore all port I/O writes (reads
# returning zero), instead of forwarding to EFI_CPU_IO2_PROTOCOL.
#
# Useful for testing on UEFI DEBUG builds that use the
# BaseIoLibIntrinsic (IoLibNoIo.c) implementation.
#
MAU_EMU_X64_RAZ_WI_PIO = NO
#
# Seems to work well even when building on small machines.
#
UC_LTO_JOBS = auto
!include MultiArchUefiPkg.dsc.inc
[PcdsFixedAtBuild.common]
# DEBUG_ASSERT_ENABLED 0x01
# DEBUG_PRINT_ENABLED 0x02
# DEBUG_CODE_ENABLED 0x04
# CLEAR_MEMORY_ENABLED 0x08
# ASSERT_BREAKPOINT_ENABLED 0x10
# ASSERT_DEADLOOP_ENABLED 0x20
!if $(TARGET) == RELEASE
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x23
!else
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
!endif
# DEBUG_INIT 0x00000001 // Initialization
# DEBUG_WARN 0x00000002 // Warnings
# DEBUG_LOAD 0x00000004 // Load events
# DEBUG_FS 0x00000008 // EFI File system
# DEBUG_POOL 0x00000010 // Alloc & Free (pool)
# DEBUG_PAGE 0x00000020 // Alloc & Free (page)
# DEBUG_INFO 0x00000040 // Informational debug messages
# DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers
# DEBUG_VARIABLE 0x00000100 // Variable
# DEBUG_BM 0x00000400 // Boot Manager
# DEBUG_BLKIO 0x00001000 // BlkIo Driver
# DEBUG_NET 0x00004000 // SNP Driver
# DEBUG_UNDI 0x00010000 // UNDI Driver
# DEBUG_LOADFILE 0x00020000 // LoadFile
# DEBUG_EVENT 0x00080000 // Event messages
# DEBUG_GCD 0x00100000 // Global Coherency Database changes
# DEBUG_CACHE 0x00200000 // Memory range cachability changes
# DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may
# // significantly impact boot performance
# DEBUG_ERROR 0x80000000 // Error
!if $(TARGET) == RELEASE
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
!else
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
!endif
[LibraryClasses.common]
#
# Entry point
#
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
#
# Basic
#
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
#
# UEFI & PI
#
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
#
# Since software stack checking may be heuristically enabled by the compiler
# include BaseStackCheckLib unconditionally.
#
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
#
# Misc.
#
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
#
# Logging choices.
#
!if $(MAU_STANDALONE_LOGGING) == SERIAL
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
SerialPortLib|MultiArchUefiPkg/Library/BaseSerialPortLibSerialIoProtocol/BaseSerialPortLibSerialIoProtocol.inf
!endif
!if $(MAU_STANDALONE_LOGGING) == CONOUT
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
!endif
!if $(MAU_STANDALONE_LOGGING) == SBI
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
SerialPortLib|MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLibRam.inf
RiscVSbiLib|MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.inf
!endif
!if $(MAU_STANDALONE_LOGGING) == NONE
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!endif
[LibraryClasses.AARCH64]
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
#
# It is not possible to prevent ARM compiler calls to generic intrinsic functions.
# This library provides the instrinsic functions generated by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
[LibraryClasses.RISCV64]
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/BaseRiscV64CpuExceptionHandlerLib.inf
TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
[BuildOptions]
!if $(ARCH) == RISCV64
*_*_*_CC_FLAGS = -Os
!endif