]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add Universal Payload general definition header file
authorZhiguang Liu <zhiguang.liu@intel.com>
Fri, 30 Apr 2021 04:44:10 +0000 (12:44 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 16 Jun 2021 05:20:19 +0000 (05:20 +0000)
Add Universal Payload general definition header file according to
Universal Payload's documentation as below:
https://universalpayload.github.io/documentation/

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
MdeModulePkg/Include/UniversalPayload/UniversalPayload.h [new file with mode: 0644]

diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
new file mode 100644 (file)
index 0000000..e661306
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  Universal Payload general definitions.\r
+\r
+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+  @par Revision Reference:\r
+    - Universal Payload Specification 0.75 (https://universalpayload.github.io/documentation/)\r
+**/\r
+\r
+#ifndef UNIVERSAL_PAYLOAD_H_\r
+#define UNIVERSAL_PAYLOAD_H_\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT8                Revision;\r
+  UINT8                Reserved;\r
+  UINT16               Length;\r
+} UNIVERSAL_PAYLOAD_GENERIC_HEADER;\r
+\r
+#pragma pack()\r
+\r
+/**\r
+  Returns the size of a structure of known type, up through and including a specified field.\r
+\r
+  @param   TYPE     The name of the data structure that contains the field specified by Field.\r
+  @param   Field    The name of the field in the data structure.\r
+\r
+  @return  size, in bytes.\r
+\r
+**/\r
+#define UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD(TYPE, Field) (OFFSET_OF(TYPE, Field) + sizeof (((TYPE *) 0)->Field))\r
+\r
+#endif // UNIVERSAL_PAYLOAD_H_\r