From fea7901dba72eeac526f3ef12a4ad4c539622373 Mon Sep 17 00:00:00 2001 From: Guo Dong Date: Wed, 30 Jun 2021 15:08:22 -0700 Subject: [PATCH] UefiPayloadPkg: Fix the build failure For non-universal payload, HandoffHobTable is used without initialization. This patch fixed this failure. Cc: Benjamin You Cc: Maurice Ma Reviewed-by: Maurice Ma Signed-off-by: Guo Dong --- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 +-- UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c index ed956c447c..ae16f25c7c 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -559,7 +559,6 @@ PayloadEntry ( { EFI_STATUS Status; PHYSICAL_ADDRESS DxeCoreEntryPoint; - EFI_HOB_HANDOFF_INFO_TABLE *HandoffHobTable; UINTN MemBase; UINTN HobMemBase; UINTN HobMemTop; @@ -603,7 +602,7 @@ PayloadEntry ( IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); - Hob.HandoffInformationTable = HandoffHobTable; + Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *) GetFirstHob(EFI_HOB_TYPE_HANDOFF); HandOffToDxeCore (DxeCoreEntryPoint, Hob); // Should not get here diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index a67653eb11..7a00a56ab9 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -364,7 +364,6 @@ _ModuleEntryPoint ( { EFI_STATUS Status; PHYSICAL_ADDRESS DxeCoreEntryPoint; - EFI_HOB_HANDOFF_INFO_TABLE *HandoffHobTable; EFI_PEI_HOB_POINTERS Hob; EFI_FIRMWARE_VOLUME_HEADER *DxeFv; @@ -393,8 +392,7 @@ _ModuleEntryPoint ( IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); - HandoffHobTable = (EFI_HOB_HANDOFF_INFO_TABLE *) GetFirstHob(EFI_HOB_TYPE_HANDOFF); - Hob.HandoffInformationTable = HandoffHobTable; + Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *) GetFirstHob(EFI_HOB_TYPE_HANDOFF); HandOffToDxeCore (DxeCoreEntryPoint, Hob); // Should not get here