30824 Commits

Author SHA1 Message Date
Marvin Häuser
f9750fd19b .gitmodules: Track main OpenCorePkg branch 2023-03-28 00:38:11 +02:00
Marvin Häuser
db6d6cd55f devcontainer: Initial import 2023-03-28 00:36:41 +02:00
Marvin Häuser
2329159b11 Docker: Extend OpenCorePkg docker-compose 2023-03-28 00:36:34 +02:00
Marvin Häuser
1e71ff04c4 EmulatorPkg/Host: Fix XCODE5 build 2023-03-28 00:29:29 +02:00
Marvin Häuser
e30809d363 UefiCpuPkg/CpuExceptionHandlerLib: Fix wrong use of relative addressing
HookAfterStubHeader is copied before execution. Thus, relative
addressing cannot safely be used for anything outside the copy range.
Fix the reference of HookAfterStubHeaderEnd to be absolute.

This change alone violates an undocumented requirement that
HookAfterStubHeader and AsmIdtVector are structurally equivalent (their
respective sizes in particular). Resolve this by treating them (and in
particular their sizes) independently.
2023-03-22 16:13:25 +01:00
Marvin Häuser
e958f25835 BaseTools/DevicePath: Consume MdePkg/UefiDevicePathLib
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Marvin Häuser
d24e8eb64a BaseTools/CommonLib: Consume MdePkg and MdeModulePkg
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Marvin Häuser
d1dd8c16ce UefiCpuPkg/MtrrLib: Add missing PcdLib.h include
MtrrLib does not include PcdLib.h despite explicitly using its
definitions. Add the include to fix compilation for modules that do not
utilize AutoGen.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Marvin Häuser
12f18049cc MdePkg/Base.h: Add support for C++ alignof
In preparation of including Base.h in C++ BaseTools programs, support
the C++ 11 alignof operator. The C _Alignof operator is not universally
supported in C++ mode across compiler toolchains and thus the current
definition may lead to compilation errors with said programs.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Marvin Häuser
21737743ca MdePkg/Base.h: Only use C++ static_assert when supported
To support GoogleTest, 933b4c3 added support for C++ static_assert.
However, this is not a mandatory or universally supported C++ feature.
Guard its usage by the __cpp_static_assert support flag.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Savva Mitrofanov
113f3d8f6e ArmPkg/DebugUefiImageExtraActionLib: Fix DEBUG statements
Ref: 57480bd8ae3b4dbda588a1fd108e826faebc28e5
2023-03-16 15:33:03 +03:00
Mikhail Krichanov
789aa9ded5 BaseTools: Returned -march=armv7-a -mthumb for ARM compilation, removed useless ARCHASM_FLAGS. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
26a4d6faf2 MdeModulePkg: Removed ASSERT to facilitate boot of AARCH64 firmware. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
be0b5fc5da MdeModulePkg: Fixed code style. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
aba1c68ac1 ImageTool: Fixed compilation for AARCH64. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
9b440f29ea BaseTools: Removed useless OBJCOPY_FLAGS, ARCHCC_FLAGS and PLATFORM_FLAGS, defined OBJCOPY_PATH for ARM, AARCH64. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
75fcf75121 BaseTools: Added draft of ARM, AARCH64 support. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
730a27d321 MdePkg: Added CONST to fix ArmVirtPkg compilation. 2023-03-16 15:33:03 +03:00
Mikhail Krichanov
a0f5b70883 ImageTool: Made SizeOfImage equal maximum virtual address. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
860dcd18cd MdePkg: Returned some #includes. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
b4a313ea05 MdePkg: Cleaned up BaseLib.h already included in DebugLib.h. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
30d425b06f MdePkg: Included BaseLib.h in DebugLib.h as it's needed for CpuBreakpoint(). Reverted minor changes. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
c9e1823fbc BaseTools: Placed MdeBuildOptions.dsc.inc into tools_def.txt. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
2a18a22be4 BaseTools: Made !ifdef-choice configurable on command line. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
adfdda5fca Build: Removed unnecessary !include MdePkg/MdeBuildOptions.dsc.inc. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
1d0697c7ab BaseTools: Added support for !ifdef constructions inside tools_def.txt. 2023-03-16 12:20:13 +03:00
Marvin Häuser
daca49e23f ImageTool/PeScan: Drop redundant size clamping 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
8978439c82 ImageTool: Returned ImageBuffer for section, reloc parsing. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
1bb6e60e7d ImageTool: Removed corruption tolerant DebugInfo search assuming mtoc is fixed. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
8eaa875cc4 MdePkg: Placed import of PcdLib.h into DebugLib.h. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
8a6da01b9b MdePkg: Moved DEBUG_RAISE() to DebugLib.h. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
526c4b13ab ImageTool: Refactored out Pointer. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
aa526e42c7 OvmfPkg: Increased X64 PEIFV size to fix NOOPT builds. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
c9b10ce0c1 MdePkg: Redefined DEBUG_RAISE() to facilitate fuzzing. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
2bb2e22db8 BaseTools: Reduced minimal alignment to 32 bytes. 2023-03-16 12:20:13 +03:00
Mikhail Krichanov
6117177c2e BaseTools: Added MDEPKG_REDUCE_FW_SIZE and MDEPKG_MERGE_RODATA_INTO_TEXT build options. 2023-03-16 12:20:13 +03:00
Savva Mitrofanov
fe193d6384 .github/workflows: Uploads OvmfPkg artifacts and test them using QEMU
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-03-13 20:48:55 +06:00
Mikhail Krichanov
fc981b0891 UefiPayloadPkg: Increased FD_SIZE to fix VS2019 NOOPT build. 2023-03-13 20:48:55 +06:00
Mikhail Krichanov
7836cea3bd BaseTools: Fixed VS2019 build by removing EFI_IMAGE_SCN_MEM_DISCARDABLE flag from .xdata and .pdata sections and as a result correcting DataRVA inside .hii. 2023-03-13 20:48:55 +06:00
Savva Mitrofanov
9c0a615470
Corrects ocbuild branch in docker-compose.yml 2023-03-09 21:21:18 +06:00
Savva Mitrofanov
3f8cfa4d44
OvmfPkg: Corrects default values in OvmfPkgIa32X64.dsc
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-03-09 17:12:10 +06:00
Marvin Häuser
9f35d83d71 BaseTools/tools_def: Introduce MTOC_PREFIX environment variable
Most compiler toolchains and tools have support for PREFIX environment
variables to specify their location, but Apple mtoc does not. While
it used to be in a stable install location, it has recently been
deprecated and ocmtoc is maintained as a fork. Homebrew has accepted
ocmtoc into its repository, including its ARM version. As Homebrew on
ARM does not install its packages into /usr/local, XCODE5 currently
does not work on Apple silicon with ocmtoc installed via Homebrew.

Introduce the MTOC_PREFIX environment variable to customize the
installation location of Apple mtoc or ocmtoc.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-06 20:16:39 +01:00
Savva Mitrofanov
85989f6bf7
Build: Updated OpenCore submodule to current master branch
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-28 18:53:13 +06:00
Savva Mitrofanov
7052c3badf
FatPkg: Corrects FatDelete exit logic if PcdFatReadOnlyMode is set
The FatDelete routine closes the file even it write protected

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-28 18:37:36 +06:00
Savva Mitrofanov
18722f129f FatPkg: Don't try to open file for write/create for RO mode
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-23 00:47:34 +03:00
Savva Mitrofanov
acfb8ae13a FatPkg: Early-exit from writing functions when enforced RO mode
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-23 00:47:34 +03:00
Savva Mitrofanov
5b09f83e0c FatPkg: Adds support for read-only mode
Implements gEfiFatPkgTokenSpaceGuid token space and adds token which
disables write operations. By default driver still supports read-write
mode

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-23 00:47:34 +03:00
Savva Mitrofanov
c8a9df31b3
Build: Updated OpenCore submodule to current master branch. 2023-02-22 17:55:25 +06:00
Savva Mitrofanov
b78e1e0e5a
BaseTools: Fix MSVC build due to missing Crc32 symbols
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-22 17:39:14 +06:00
Savva Mitrofanov
b96cbb7cfa
.github/workflows: Update build workflow
Doesn't rebuild basetools on every package

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-20 15:58:44 +06:00