mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
UefiPayloadPkg: Assign the length of UniversalPayload ExtraData
V1: Assign the length and revision of UniversalPayload ExtraData V2: Force int to UINT16 V3: Create a local variable to hold the size of ExtraData Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
parent
7d748705b1
commit
9bf4aee734
@ -56,6 +56,7 @@ PeiLoadFileLoadPayload (
|
|||||||
UINTN Size;
|
UINTN Size;
|
||||||
UINT32 ExtraDataCount;
|
UINT32 ExtraDataCount;
|
||||||
UINTN Instance;
|
UINTN Instance;
|
||||||
|
UINTN Length;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ELF is added to file as RAW section for EDKII bootloader.
|
// ELF is added to file as RAW section for EDKII bootloader.
|
||||||
@ -105,11 +106,14 @@ PeiLoadFileLoadPayload (
|
|||||||
//
|
//
|
||||||
// Report the additional PLD sections through HOB.
|
// Report the additional PLD sections through HOB.
|
||||||
//
|
//
|
||||||
|
Length = sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY);
|
||||||
ExtraData = BuildGuidHob (
|
ExtraData = BuildGuidHob (
|
||||||
&gUniversalPayloadExtraDataGuid,
|
&gUniversalPayloadExtraDataGuid,
|
||||||
sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
|
Length
|
||||||
);
|
);
|
||||||
ExtraData->Count = ExtraDataCount;
|
ExtraData->Count = ExtraDataCount;
|
||||||
|
ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
|
||||||
|
ExtraData->Header.Length = (UINT16) Length;
|
||||||
if (ExtraDataCount != 0) {
|
if (ExtraDataCount != 0) {
|
||||||
for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
|
for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
|
||||||
Status = GetElfSectionName (&Context, Index, &SectionName);
|
Status = GetElfSectionName (&Context, Index, &SectionName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user