31409 Commits

Author SHA1 Message Date
Mikhail Krichanov
96ec1c3f4b BaseTools/CommonLib: Consume MemoryAllocationLib 2023-07-07 09:44:53 +03:00
Marvin Häuser
bff9ccd041 EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-07-07 09:44:52 +03:00
Marvin Häuser
43fff71ccd EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-07-07 09:44:52 +03:00
Marvin Häuser
4b17f3031c MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-07-07 09:44:52 +03:00
Mikhail Krichanov
000ec64cbb MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-07-07 09:41:57 +03:00
Marvin Häuser
d8d1594eab EmulatorPkg/Host: Consume MemoryAllocationLib 2023-07-07 09:40:00 +03:00
Mikhail Krichanov
7887a8a2e7 MdePkg: Introduce CommonMemoryAllocationLib 2023-07-07 09:39:09 +03:00
Marvin Häuser
574dc7aa64 MdeModulePkg: Manage MemoryProfileLib separately 2023-07-07 09:38:00 +03:00
Marvin Häuser
8cd1fcbfe4 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-07-07 09:38:00 +03:00
Marvin Häuser
c2a1aba688 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-07-07 09:38:00 +03:00
Marvin Häuser
9449729dba MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-07-07 09:38:00 +03:00
Marvin Häuser
adf1673ece BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-07-07 09:38:00 +03:00
Marvin Häuser
64a6723cdc EmulatorPkg: Fix some image loader related issues 2023-07-07 09:38:00 +03:00
Marvin Häuser
b44e3da5ea EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-07-07 09:38:00 +03:00
Marvin Häuser
405799494f EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-07-07 09:38:00 +03:00
Marvin Häuser
ee9d30f774 BaseTools/GenFv: Remove duplicated alignment macros 2023-07-07 09:38:00 +03:00
Marvin Häuser
d7eb301e17 MdeModulePkg/PiSmmCore: Fix fixed address loading 2023-07-07 09:38:00 +03:00
Marvin Häuser
3a5ff7daee EmulatorPkg/Host: Fix XCODE5 build 2023-07-07 09:38:00 +03:00
Marvin Häuser
7a3d964d6b 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-07-07 09:38:00 +03:00
Marvin Häuser
6dcbb98d37 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-07-07 09:37:59 +03:00
Marvin Häuser
d82181f8c6 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-07-07 09:37:59 +03:00
Marvin Häuser
2fbf070521 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-07-07 09:37:59 +03:00
Marvin Häuser
635c09d6cb 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-07-07 09:37:59 +03:00
Mikhail Krichanov
671ee277b0 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-07-07 09:37:59 +03:00
Savva Mitrofanov
2849e25902 UefiCpuPkg/CpuPageTableLib: Add intrinsic lib to fix MSVC build
For the bitfield access, MSVC apparently uses a right shift of the base type of the bitfield member. In our case, is is cased by IA32_PTE_4K and
IA32_PAGE_LEAF_ENTRY_BIG_PAGESIZE and other structures which uses uint64
bitfields and 32-bit x86 doesn't have a 64-bit integer shift (except using MMX or SSE2). With -Od (NOOPT) even for constant counts it puts
the data in EDX:EAX, the shift count in cl and calls __aullshr.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
5b772e12ce CryptoPkg/IntrinsicLib: Corrects __ashrdi3 and adds __lshrdi3
The ashrdi3 function should do arithmetic shift instead of logic using
sar instruction. Also adds __lshrdi3 implementation to correct build
using LLVM

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Mike Beaton
cb770afa2b GenSec: Support TianoCompress
Allows .fdf files to define a compressed .ffs section which can be read
by legacy EFI firmware (such as found on Apple Mac).
Use `COMPRESS TIANO`.
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
496bb5c965 CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
09057a1a5b MdePkg: Add PCD to remove X perm from image sections with WX perms
This feature is useful for images created by old Apple mtoc utility.

Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com>
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
6ca8a30461 Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-07-07 09:37:59 +03:00
Mikhail Krichanov
ded02fa331 BaseTools: Removed GCC48/49 toolchains, refactored tools_def.template. 2023-07-07 09:37:59 +03:00
Savva Mitrofanov
f49ebbe84e UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
4b95233c0d UefiCpuPkg/UnitTest: Fixes CLANGDWARF build
Adds missing EFIAPI modifiers. Fixes calling conventions by defining as
ms_abi

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
8efe81d86c MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
c369efdac6 MdeModulePkg/DebugSupportDxe: Corrects MSVC build
Fixes 6c974ab21e212c1867c871f989f6f1df5786e99e by supressing type cast
warning for MSVC

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
bece933575 IntelFsp2WrapperPkg/FspWrapperMultiPhaseProcessLib: Fix CLANGPDB build
Silences "sometimes-uninitialized" warning by initializing the variable FspMultiPhaseApiOffset and corrects build using LLVM 15 toolchain

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Savva Mitrofanov
22495c101c MdeModulePkg/BrotliCustomDecompressLib: Disable C4559 MSVC warning
Disables redefinition warning due to win 10 sdk to fix build using MSVC
toolchain

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
847e66910c BaseTools, MdeModulePkg: Update brotli submodule
Update the brotli submodule to the latest commit (ed1995b6bda1)
so that the build isn't broken in GCC 12 compilers.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-07-07 09:37:59 +03:00
Mikhail Krichanov
26da6e5ec6 MdePkg: Defined DEBUG_RAISE() to facilitate fuzzing. 2023-07-07 09:37:59 +03:00
Mikhail Krichanov
42c7b1aeb3 MdePkg: Added BaseOverflowLib library. 2023-07-07 09:37:59 +03:00
Mikhail Krichanov
62757820c3 BaseTools: Replaced GenFw with ImageTool and MicroTool. 2023-07-07 09:37:59 +03:00
Mikhail Krichanov
9e5601b1f4 SecurePE: Replaced old PE loader with Secure one. 2023-07-07 09:35:48 +03:00
Savva Mitrofanov
8a74d515e2 MdeModulePkg/DebugSupportDxe: Adds callback function prototypes in
caller

Adds EFI_EXCEPTION_CALLBACK and EFI_PERIODIC_CALLBACK casts to
RegisteredCallback call in InterruptDistributionHub to suppress
deprecated non-prototype LLVM 15 warning

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
b3e2c98bf2 MdeModulePkg/CapsuleOnDiskLoadPei: Removes unused Index variable
Removes unused Index local variable in RetrieveRelocatedCapsule to
suppress compiler warning in LLVM 15

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
f5364a3e78 NetworkPkg/WifiConnectionManagerDxe: Removes unused variable
Removes unused variable in WifiMgrRefreshNetworkList routine to correct
build

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
a519365b75 CryptoPkg/BaseCryptLib: Removes unused variable in CryptX509
Removes unused local variable in X509ConstructCertificateStackV

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Mikhail Krichanov
41578931ef MdeModulePkg/RegularExpressionDxe: Corrects onigurama build with LLVM 15
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
0a23c42964 MdeModulePkg/VarCheckHiiLib: Remove unused variable FfsIndex
Corrects compiler warning due to unused variable in VarCheckHiiGenFromFv

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
c0f8aaa6ef MdeModulePkg/SmbiosMeasurementDxe: Removes unused local variable
Removes unused local variable Size in GetSmbiosStringById

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00
Savva Mitrofanov
4fc976cc48 MdeModulePkg/BrotliCustomDecompressLib: Correct BrotliDecompress
We need to pass DestSize as pointer, because we assign this output var
to TotalOut value inside BrotliDecompress routine

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-06-26 12:58:21 +03:00