From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web11.2469.1624416764968334886 for ; Tue, 22 Jun 2021 19:52:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhiguang.liu@intel.com) IronPort-SDR: F46apl1dMSaW5cZac9nPaKaYKEeNKe0cAPc7SzV+huraO/IKIdFy8BQJKxq7oOx9oIyl9Gn+rZ C8faCLn89kZQ== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="204175490" X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="204175490" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 19:52:48 -0700 IronPort-SDR: +HYRDaZDSB4la79UUDgu2F6eqVq2NHxxTtYBan4s0C67LJE2qkl8PxnokRv307JqSs4wOxPFc2 CCb7E+jeMnJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="487138279" Received: from fieedk002.ccr.corp.intel.com ([10.239.158.144]) by orsmga001.jf.intel.com with ESMTP; 22 Jun 2021 19:52:47 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Maurice Ma , Guo Dong , Benjamin You Subject: [Patch V2 04/12] UefiPayloadPkg: Update the function definition of HobConstructor Date: Wed, 23 Jun 2021 10:52:27 +0800 Message-Id: <20210623025235.3311-5-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20210623025235.3311-1-zhiguang.liu@intel.com> References: <20210623025235.3311-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Update the function defination of HobConstructor to align the Phit Hob structure. Cc: Maurice Ma Cc: Guo Dong Cc: Benjamin You Reviewed-by: Guo Dong Signed-off-by: Zhiguang Liu --- UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c | 26 +++++++++++++-----= -------- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 5 +---- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h | 16 ++++++++-------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c b/UefiPayloadP= kg/Library/PayloadEntryHobLib/Hob.c index 23a749edf1..768c3db770 100644 --- a/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c +++ b/UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c @@ -39,14 +39,14 @@ GetHobList ( /**=0D Build a Handoff Information Table HOB=0D =0D - This function initialize a HOB region from EfiMemoryBegin with length=0D - EfiMemoryLength. And EfiFreeMemoryBottom and EfiFreeMemoryTop should=0D + This function initialize a HOB region from EfiMemoryBegin to=0D + EfiMemoryTop. And EfiFreeMemoryBottom and EfiFreeMemoryTop should=0D be inside the HOB region.=0D =0D - @param[in] EfiMemoryBegin Total memory start address=0D - @param[in] EfiMemoryLength Total memory length reported in handoff = HOB.=0D - @param[in] EfiFreeMemoryBottom Free memory start address=0D - @param[in] EfiFreeMemoryTop Free memory end address.=0D + @param[in] EfiMemoryBottom Total memory start address=0D + @param[in] EfiMemoryTop Total memory end address.=0D + @param[in] EfiFreeMemoryBottom Free memory start address=0D + @param[in] EfiFreeMemoryTop Free memory end address.=0D =0D @return The pointer to the handoff HOB table.=0D =0D @@ -54,8 +54,8 @@ GetHobList ( EFI_HOB_HANDOFF_INFO_TABLE*=0D EFIAPI=0D HobConstructor (=0D - IN VOID *EfiMemoryBegin,=0D - IN UINTN EfiMemoryLength,=0D + IN VOID *EfiMemoryBottom,=0D + IN VOID *EfiMemoryTop,=0D IN VOID *EfiFreeMemoryBottom,=0D IN VOID *EfiFreeMemoryTop=0D )=0D @@ -77,11 +77,11 @@ HobConstructor ( Hob->Version =3D EFI_HOB_HANDOFF_TABLE_VERSION;=0D Hob->BootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D =0D - Hob->EfiMemoryTop =3D (UINTN)EfiMemoryBegin + EfiMemoryLength;=0D - Hob->EfiMemoryBottom =3D (UINTN)EfiMemoryBegin;=0D - Hob->EfiFreeMemoryTop =3D (UINTN)EfiFreeMemoryTop;=0D - Hob->EfiFreeMemoryBottom =3D (EFI_PHYSICAL_ADDRESS)(UINTN)(HobEnd+1);=0D - Hob->EfiEndOfHobList =3D (EFI_PHYSICAL_ADDRESS)(UINTN)HobEnd;=0D + Hob->EfiMemoryTop =3D (EFI_PHYSICAL_ADDRESS) EfiMemoryTop;=0D + Hob->EfiMemoryBottom =3D (EFI_PHYSICAL_ADDRESS) EfiMemoryBottom;=0D + Hob->EfiFreeMemoryTop =3D (EFI_PHYSICAL_ADDRESS) EfiFreeMemoryTop;=0D + Hob->EfiFreeMemoryBottom =3D (EFI_PHYSICAL_ADDRESS) (UINTN) (HobEnd+1);= =0D + Hob->EfiEndOfHobList =3D (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;=0D =0D mHobList =3D Hob;=0D return Hob;=0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPaylo= adPkg/UefiPayloadEntry/UefiPayloadEntry.c index 19d2a8d3bd..ed956c447c 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -561,7 +561,6 @@ PayloadEntry ( PHYSICAL_ADDRESS DxeCoreEntryPoint;=0D EFI_HOB_HANDOFF_INFO_TABLE *HandoffHobTable;=0D UINTN MemBase;=0D - UINTN MemSize;=0D UINTN HobMemBase;=0D UINTN HobMemTop;=0D EFI_PEI_HOB_POINTERS Hob;=0D @@ -580,9 +579,7 @@ PayloadEntry ( HobMemBase =3D ALIGN_VALUE (MemBase + PcdGet32 (PcdPayloadFdMemSize), SI= ZE_1MB);=0D HobMemTop =3D HobMemBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize= );=0D =0D - // DXE core assumes the memory below HOB region could be used, so includ= e the FV region memory into HOB range.=0D - MemSize =3D HobMemTop - MemBase;=0D - HandoffHobTable =3D HobConstructor ((VOID *)MemBase, MemSize, (VOID *)Ho= bMemBase, (VOID *)HobMemTop);=0D + HobConstructor ((VOID *)MemBase, (VOID *)HobMemTop, (VOID *)HobMemBase, = (VOID *)HobMemTop);=0D =0D // Build HOB based on information from Bootloader=0D Status =3D BuildHobFromBl ();=0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h b/UefiPaylo= adPkg/UefiPayloadEntry/UefiPayloadEntry.h index 5a1b37be16..1ad7a37023 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h @@ -93,14 +93,14 @@ UpdateStackHob ( /**=0D Build a Handoff Information Table HOB=0D =0D - This function initialize a HOB region from EfiMemoryBegin with length=0D - EfiMemoryLength. And EfiFreeMemoryBottom and EfiFreeMemoryTop should=0D + This function initialize a HOB region from EfiMemoryBegin to=0D + EfiMemoryTop. And EfiFreeMemoryBottom and EfiFreeMemoryTop should=0D be inside the HOB region.=0D =0D - @param[in] EfiMemoryBegin Total memory start address=0D - @param[in] EfiMemoryLength Total memory length reported in handoff = HOB.=0D - @param[in] EfiFreeMemoryBottom Free memory start address=0D - @param[in] EfiFreeMemoryTop Free memory end address.=0D + @param[in] EfiMemoryBottom Total memory start address=0D + @param[in] EfiMemoryTop Total memory end address.=0D + @param[in] EfiFreeMemoryBottom Free memory start address=0D + @param[in] EfiFreeMemoryTop Free memory end address.=0D =0D @return The pointer to the handoff HOB table.=0D =0D @@ -108,8 +108,8 @@ UpdateStackHob ( EFI_HOB_HANDOFF_INFO_TABLE*=0D EFIAPI=0D HobConstructor (=0D - IN VOID *EfiMemoryBegin,=0D - IN UINTN EfiMemoryLength,=0D + IN VOID *EfiMemoryBottom,=0D + IN VOID *EfiMemoryTop,=0D IN VOID *EfiFreeMemoryBottom,=0D IN VOID *EfiFreeMemoryTop=0D );=0D --=20 2.30.0.windows.2