Re: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData

2021-07-12 Thread Ni, Ray
It will be better if you can create a local variable Length to hold "sizeof 
(UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof 
(UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)".
So that Length can be used in BuildGuidHob() call as well.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77730): https://edk2.groups.io/g/devel/message/77730
Mute This Topic: https://groups.io/mt/83992081/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Assign the length of UniversalPayload ExtraData

2021-07-04 Thread duntan
V1: Assign the length and revision of UniversalPayload ExtraData
V2: Force int to UINT16

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 

Signed-off-by: DunTan 
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c 
b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index c619470dbb..0e25bef516 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -110,6 +110,8 @@ PeiLoadFileLoadPayload (
sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + ExtraDataCount * sizeof 
(UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY)
);
   ExtraData->Count = ExtraDataCount;
+  ExtraData->Header.Revision = UNIVERSAL_PAYLOAD_EXTRA_DATA_REVISION;
+  ExtraData->Header.Length = (UINT16) (sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA) + 
ExtraDataCount * sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY));
   if (ExtraDataCount != 0) {
 for (ExtraDataIndex = 0, Index = 0; Index < Context.ShNum; Index++) {
   Status = GetElfSectionName (&Context, Index, &SectionName);
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77472): https://edk2.groups.io/g/devel/message/77472
Mute This Topic: https://groups.io/mt/83992081/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-