> -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray > Sent: Thursday, June 3, 2021 2:23 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D <michael.d.kin...@intel.com>; Liming Gao > <gaolim...@byosoft.com.cn>; Liu, Zhiguang <zhiguang....@intel.com>; Ma, > Maurice <maurice...@intel.com>; Dong, Guo <guo.d...@intel.com> > Subject: [edk2-devel] [PATCH v2 1/3] MdeModulePkg/UniversalPayload: Add > definition for extra info in payload > > The payload is in ELF format per the universal payload spec. > PLD_INFO_HEADER is stored in the ELF payload as a separate section > named ".upld_info". > > Extra data needed by payload is stored in sections whose name starts > with ".upld.". > > Signed-off-by: Ray Ni <ray...@intel.com> > Cc: Michael D Kinney <michael.d.kin...@intel.com> > Cc: Liming Gao <gaolim...@byosoft.com.cn> > Cc: Zhiguang Liu <zhiguang....@intel.com> > Cc: Maurice Ma <maurice...@intel.com> > Cc: Guo Dong <guo.d...@intel.com> > --- > .../Include/UniversalPayload/ExtraData.h | 28 ++++++++++++++ > .../UniversalPayload/UniversalPayload.h | 38 +++++++++++++++++++ > MdeModulePkg/MdeModulePkg.dec | 3 ++ > 3 files changed, 69 insertions(+) > create mode 100644 MdeModulePkg/Include/UniversalPayload/ExtraData.h > create mode 100644 > MdeModulePkg/Include/UniversalPayload/UniversalPayload.h > > diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h > b/MdeModulePkg/Include/UniversalPayload/ExtraData.h > new file mode 100644 > index 0000000000..07b7426683 > --- /dev/null > +++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h > @@ -0,0 +1,28 @@ > +/** @file > > + > > + Copyright (c) 2021, Intel Corporation. All rights reserved.<BR> > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > +#ifndef __EXTRA_DATA_H__ > > +#define __EXTRA_DATA_H__ > > + > > +extern GUID gPldExtraDataGuid; > > + > > +#pragma pack(1) > > + > > +typedef struct { > > + CHAR8 Identifier[16]; > > + EFI_PHYSICAL_ADDRESS Base; > > + UINT64 Size; > > +} PLD_EXTRA_DATA_ENTRY; > > + > > +typedef struct { > > + PLD_GENERIC_HEADER PldHeader; > > + UINT32 Count; > > + PLD_EXTRA_DATA_ENTRY Entry[0]; > > +} PLD_EXTRA_DATA; > > + > > +#pragma pack() > > + > > +#endif > > diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h > b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h > new file mode 100644 > index 0000000000..b8e9fe11a1 > --- /dev/null > +++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h > @@ -0,0 +1,38 @@ > +/** @file > > + > > + Copyright (c) 2021, Intel Corporation. All rights reserved.<BR> > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > +#ifndef __UNIVERSAL_PAYLOAD_H__ > > +#define __UNIVERSAL_PAYLOAD_H__ > > + > > +typedef VOID (EFIAPI *UNIVERSAL_PAYLOAD_ENTRY) (VOID *HobList);
Do we need to add function and input parameter description comments for the above 'typedef' like others in the codebase? With this handled, Reviewed-by: Hao A Wu <hao.a...@intel.com> Best Regards, Hao Wu > > + > > +#define PLD_IDENTIFIER SIGNATURE_32('U', 'P', 'L', 'D') > > +#define PLD_INFO_SEC_NAME ".upld_info" > > +#define PLD_EXTRA_SEC_NAME_PREFIX ".upld." > > +#define PLD_EXTRA_SEC_NAME_PREFIX_LENGTH (sizeof > (PLD_EXTRA_SEC_NAME_PREFIX) - 1) > > + > > +#pragma pack(1) > > + > > +typedef struct { > > + UINT32 Identifier; > > + UINT32 HeaderLength; > > + UINT16 SpecRevision; > > + UINT8 Reserved[2]; > > + UINT32 Revision; > > + UINT32 Attribute; > > + UINT32 Capability; > > + CHAR8 ProducerId[16]; > > + CHAR8 ImageId[16]; > > +} PLD_INFO_HEADER; > > + > > +typedef struct { > > + UINT8 Revision; > > + UINT8 Reserved[3]; > > +} PLD_GENERIC_HEADER; > > + > > +#pragma pack() > > + > > +#endif > > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec > index 8d38383915..d823ad0ba7 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -404,6 +404,9 @@ [Guids] > ## Include/Guid/MigratedFvInfo.h > > gEdkiiMigratedFvInfoGuid = { 0xc1ab12f7, 0x74aa, 0x408d, { 0xa2, 0xf4, > 0xc6, > 0xce, 0xfd, 0x17, 0x98, 0x71 } } > > > > + ## Include/UniversalPayload/ExtraData.h > > + gPldExtraDataGuid = {0x15a5baf6, 0x1c91, 0x467d, {0x9d, 0xfb, 0x31, 0x9d, > 0x17, 0x8d, 0x4b, 0xb4}} > > + > > [Ppis] > > ## Include/Ppi/AtaController.h > > gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, > 0x7a, > 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} > > -- > 2.31.1.windows.1 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#76009): https://edk2.groups.io/g/devel/message/76009 > Mute This Topic: https://groups.io/mt/83277975/1768737 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a...@intel.com] > -=-=-=-=-=-= > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76164): https://edk2.groups.io/g/devel/message/76164 Mute This Topic: https://groups.io/mt/83277975/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-