31056 Commits

Author SHA1 Message Date
Marvin Häuser
9ef906f695 MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-05-09 18:24:29 +03:00
Marvin Häuser
91f0ea84f1 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-05-09 18:24:29 +03:00
Marvin Häuser
581e3aa89a EmulatorPkg/Host: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
4c8f3ef802 MdePkg: Introduce CommonMemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
91775aef7f MdeModulePkg: Manage MemoryProfileLib separately 2023-05-09 18:24:29 +03:00
Marvin Häuser
dcce25f5f6 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-05-09 18:24:29 +03:00
Marvin Häuser
1efda6d0c8 EmulatorPkg/Host: Remove orphaned GetImageReadFunction() 2023-05-09 18:24:29 +03:00
Marvin Häuser
365039693c MdeModulePkg/CorePei: Remove unused ShadowedImageRead member 2023-05-09 18:24:29 +03:00
Marvin Häuser
124e8a5ec2 BaseTools/GenFvInternalLib: Remove unused BaseOfCode parameter 2023-05-09 18:24:29 +03:00
Marvin Häuser
a521baefbd EmulatorPkg: Fix some image loader related issues 2023-05-09 18:24:29 +03:00
Marvin Häuser
d1ba5a8064 EmulatorPkg: Fix Thunk PPI/Protocol library types 2023-05-09 18:24:29 +03:00
Marvin Häuser
ca3235b347 EmulatorPkg/Host: Remove orphaned SecImageRead() 2023-05-09 18:24:29 +03:00
Marvin Häuser
ad21bf30bc BaseTools/GenFv: Remove duplicated alignment macros 2023-05-09 18:24:29 +03:00
Marvin Häuser
414fd1789b MdeModulePkg/PiSmmCore: Fix fixed address loading 2023-05-09 18:24:29 +03:00
Marvin Häuser
03b44331ec EmulatorPkg/Host: Fix XCODE5 build 2023-05-09 18:24:29 +03:00
Marvin Häuser
d67c631c7c 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-05-09 18:24:28 +03:00
Marvin Häuser
52aff92912 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-05-09 18:24:28 +03:00
Marvin Häuser
e21683c782 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-05-09 18:24:28 +03:00
Marvin Häuser
1aae1df13e 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-05-09 18:24:28 +03:00
Marvin Häuser
1ae00e9036 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-05-09 18:24:28 +03:00
Marvin Häuser
cfee123a4e 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-05-09 18:24:28 +03:00
Mikhail Krichanov
360279542d 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-05-09 18:24:28 +03:00
Savva Mitrofanov
0d533c0293 UefiCpuPkg/CpuExceptionHandlerLib: Creates unified ExceptionHandlerAsm
This change removes Xcode5ExceptionHandlerAsm and merge it's
functionality into ExceptionHandlerAsm.
Also decreases number of vectors to 32 for:
- 64-bit PeiCpuExceptionHandlerLib
- 32-bit PeiCpuExceptionHandlerLib, SecPeiCpuExceptionHandlerLib

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
73ff8aa3c9 UefiCpuPkg: Removes Xcode5SecPeiCpuExceptionHandlerLib
We don't need this XCODE5-specific lib anymore due to recent rodata
changes

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
7c6f401593 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-05-09 18:24:28 +03:00
Savva Mitrofanov
20e7a9319f 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-05-09 18:24:28 +03:00
Mike Beaton
0f3b3460b4 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-05-09 18:24:28 +03:00
Mikhail Krichanov
9da98d0e8c CI: Constructed separate workflows for common, arm, x86 packages and CodeQL.
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Mikhail Krichanov
a564d55862 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-05-09 18:24:28 +03:00
Mikhail Krichanov
c189dd0bd0 Build: Renamed XIPFLAGS as SECPEIFLAGS, added comment in build_rule.template on its usage. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
9c3595f1bd BaseTools: Removed GCC48/49 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
05c47cd0d1 Conf: Remove unused IPHONE_TOOLS, SOURCERY_CYGWIN_TOOLS defs and EBC (EFI Byte Code) compiler definitions. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
1ed79bc4df BaseTools: Removed VS2008-VS2013 toolchains. 2023-05-09 18:24:28 +03:00
Mikhail Krichanov
6ef394d429 Conf: Removed CLANG35/38 toolchains. 2023-05-09 18:24:28 +03:00
Savva Mitrofanov
d5c3d01897 UnitTestFrameworkPkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
d529951a8e 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-05-09 18:24:28 +03:00
Savva Mitrofanov
def7e8e70a MdePkg/UnitTest: Fixes CLANGPDB build
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
32ed66677a MdePkg/Include: Corrects ALIGNOF macro in Base.h for MSVC
This change should correct compatibility with MSVC if the compiler flags undefines _MSC_VER, for example, like OpensslLib

Signed-off-by: Savva Mitrofanov
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
043b6eaf84 MdeModulePkg/DebugSupportDxe: Corrects MSVC build
Fixes 6c974ab21e212c1867c871f989f6f1df5786e99e by supressing type cast
warning for MSVC

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:28 +03:00
Savva Mitrofanov
01095d2f68 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-05-09 18:24:28 +03:00
Savva Mitrofanov
eb83f5d891 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-05-09 18:24:28 +03:00
Mikhail Krichanov
db34228ae5 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-05-09 18:24:28 +03:00
Mikhail Krichanov
c132468d39 MdePkg: Defined DEBUG_RAISE() to facilitate fuzzing. 2023-05-09 18:23:23 +03:00
Mikhail Krichanov
c3c2c17378 MdePkg: Added BaseOverflowLib library. 2023-05-09 18:21:10 +03:00
Mikhail Krichanov
1e0cdd036d BaseTools: Replaced GenFw with ImageTool and MicroTool. 2023-05-09 18:19:07 +03:00
Mikhail Krichanov
29ab261538 SecurePE: Replaced old PE loader with Secure one. 2023-05-09 18:18:43 +03:00
Savva Mitrofanov
526a5ef3e6 MdeModulePkg/CapsuleApp: Add missing EFIAPI modifier in CapsuleDump
Fixes calling conventions by defining CompareFileNameInAlphabet with
ms_abi

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00
Savva Mitrofanov
23f2919974 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-04-28 16:55:39 +03:00
Savva Mitrofanov
cc22ecbdb3 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-04-28 16:55:39 +03:00
Savva Mitrofanov
b87abe0acf NetworkPkg/WifiConnectionManagerDxe: Removes unused variable
Removes unused variable in WifiMgrRefreshNetworkList routine to correct
build

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-04-28 16:55:39 +03:00