public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: devel@edk2.groups.io
Cc: Maurice Ma <maurice.ma@intel.com>, Guo Dong <guo.dong@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>
Subject: [PATCH v3 1/3] MdeModulePkg/UniversalPayload: Add definition for extra info in payload
Date: Wed, 16 Jun 2021 14:59:20 +0800	[thread overview]
Message-ID: <20210616065922.196-2-ray.ni@intel.com> (raw)
In-Reply-To: <20210616065922.196-1-ray.ni@intel.com>

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>
---
 .../Include/UniversalPayload/ExtraData.h      | 28 +++++++++++++++++++
 .../UniversalPayload/UniversalPayload.h       | 24 ++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec                 |  3 ++
 3 files changed, 55 insertions(+)
 create mode 100644 MdeModulePkg/Include/UniversalPayload/ExtraData.h

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
new file mode 100644
index 0000000000..146ec845f6
--- /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 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
diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
index e661306a9b..bc8a3e0cf8 100644
--- a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
+++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
@@ -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;
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 8c0885955b..10602a8f79 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -419,6 +419,9 @@ [Guids]
   ## Include/UniversalPayload/AcpiTable.h
   gUniversalPayloadAcpiTableGuid = { 0x9f9a9506, 0x5597, 0x4515, { 0xba, 0xb6, 0x8b, 0xcd, 0xe7, 0x84, 0xba, 0x87 } }
 
+  ## Include/UniversalPayload/ExtraData.h
+  gUniversalPayloadExtraDataGuid = {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


  reply	other threads:[~2021-06-16  6:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  6:59 [PATCH v3 0/3] Add PayloadLoaderPeim which can load ELF payload Ni, Ray
2021-06-16  6:59 ` Ni, Ray [this message]
2021-06-16  6:59 ` [PATCH v3 2/3] UefiPayloadPkg: " Ni, Ray
2021-06-16  6:59 ` [PATCH v3 3/3] PeiCore: Remove assertion when failing to load PE image Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616065922.196-2-ray.ni@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox