From be94902c9a272de1a75b29116b459971c9908ee7 Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Fri, 27 Oct 2023 16:19:23 +0300 Subject: [PATCH] UE: Made UE the only supported format outside FVs. --- MdeModulePkg/Core/Dxe/Image/Image.c | 6 +++--- MdePkg/Include/Library/UefiImageLib.h | 4 ++-- MdePkg/Library/BaseUefiImageLib/UefiImageLib.c | 2 +- MdePkg/MdePkg.dec | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 467374e3dc..784ea71965 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -1225,7 +1225,7 @@ CoreLoadImageCommon ( &ImageContext, FHand.Source, (UINT32) FHand.SourceSize, - ImageIsFromFv + UEFI_IMAGE_SOURCE_FV ); if (EFI_ERROR (Status)) { ASSERT (FALSE); @@ -1240,8 +1240,8 @@ CoreLoadImageCommon ( SecurityStatus = gSecurity2->FileAuthentication ( gSecurity2, OriginalFilePath, - &ImageContext, - sizeof (ImageContext), + &ImageContext, + sizeof (ImageContext), BootPolicy ); if (!EFI_ERROR (SecurityStatus) && ImageIsFromFv) { diff --git a/MdePkg/Include/Library/UefiImageLib.h b/MdePkg/Include/Library/UefiImageLib.h index 14a944710e..957b7f17be 100644 --- a/MdePkg/Include/Library/UefiImageLib.h +++ b/MdePkg/Include/Library/UefiImageLib.h @@ -6,8 +6,8 @@ #include typedef enum { - UefiImageFormatUe = 0, - UefiImageFormatPe = 1, + UefiImageFormatPe = 0, + UefiImageFormatUe = 1, UefiImageFormatMax } UEFI_IMAGE_FORMAT; diff --git a/MdePkg/Library/BaseUefiImageLib/UefiImageLib.c b/MdePkg/Library/BaseUefiImageLib/UefiImageLib.c index 327c086831..5fb960cd4d 100644 --- a/MdePkg/Library/BaseUefiImageLib/UefiImageLib.c +++ b/MdePkg/Library/BaseUefiImageLib/UefiImageLib.c @@ -135,7 +135,7 @@ UefiImageInitializeContextPreHash ( Status = RETURN_UNSUPPORTED; STATIC_ASSERT ( - UefiImageFormatPe == UefiImageFormatMax - 1, + UefiImageFormatUe == UefiImageFormatMax - 1, "Support for more formats needs to be added above." ); diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 60921efdd0..fdb3e95088 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2306,11 +2306,13 @@ ## Indicates the UEFI image file formats supported outside FVs.

# BIT0 - PE.
+ # BIT1 - UE.
# @Prompt Supported UEFI image file formats outside FVs. gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportNonFv|0x02|UINT8|0x40002000 ## Indicates the UEFI image file formats supported inside FVs.

# BIT0 - PE.
+ # BIT1 - UE.
# @Prompt Supported UEFI image file formats inside FVs. gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportFv|0x03|UINT8|0x40002001