MdeModulePkg/UniversalPayload: Add definition for extra info in payload

The payload is in ELF format per the universal payload spec.
UNIVERSAL_PAYLOAD_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.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Ray Ni
2021-05-01 20:17:45 +08:00
committed by mergify[bot]
parent fa24b6ed26
commit c511426abe
3 changed files with 55 additions and 0 deletions

View File

@@ -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 gUniversalPayloadExtraDataGuid;
#pragma pack(1)
typedef struct {
CHAR8 Identifier[16];
EFI_PHYSICAL_ADDRESS Base;
UINT64 Size;
} UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
typedef struct {
UNIVERSAL_PAYLOAD_GENERIC_HEADER PldHeader;
UINT32 Count;
UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];
} UNIVERSAL_PAYLOAD_EXTRA_DATA;
#pragma pack()
#endif

View File

@@ -11,8 +11,32 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#ifndef UNIVERSAL_PAYLOAD_H_
#define UNIVERSAL_PAYLOAD_H_
/**
Main entry point to Universal Payload.
@param HobList Pointer to the beginning of the HOB List from boot loader.
**/
typedef VOID (EFIAPI *UNIVERSAL_PAYLOAD_ENTRY) (VOID *HobList);
#define UNIVERSAL_PAYLOAD_IDENTIFIER SIGNATURE_32('U', 'P', 'L', 'D')
#define UNIVERSAL_PAYLOAD_INFO_SEC_NAME ".upld_info"
#define UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX ".upld."
#define UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH (sizeof (UNIVERSAL_PAYLOAD_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];
} UNIVERSAL_PAYLOAD_INFO_HEADER;
typedef struct {
UINT8 Revision;
UINT8 Reserved;