MdePkg: BasePeCoffLib: Allow AArch64 and x64 images in ImageFormatSupported

ARM64 and X64 may allow such foreign images to be used when
driver implementing EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL is
present.

Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Daniel Schaefer <git@danielschaefer.me>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
This commit is contained in:
Andrei Warkentin 2023-02-17 18:33:55 -06:00 committed by mergify[bot]
parent 7fa4692636
commit dc5880d02f
1 changed files with 9 additions and 1 deletions

View File

@ -104,7 +104,15 @@ PeCoffLoaderImageFormatSupported (
IN UINT16 Machine
)
{
if (Machine == IMAGE_FILE_MACHINE_RISCV64) {
/*
* ARM64 and X64 may allow such foreign images to be used when
* a driver implementing EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL is
* present.
*/
if ((Machine == IMAGE_FILE_MACHINE_RISCV64) ||
(Machine == IMAGE_FILE_MACHINE_ARM64) ||
(Machine == IMAGE_FILE_MACHINE_X64))
{
return TRUE;
}