diff options
author | Zhiguang Liu <zhiguang.liu@intel.com> | 2021-04-30 12:44:10 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-06-16 05:20:19 +0000 |
commit | d8c18ba3f409a3fdb59b2f2ee19caf5fb5b1d066 (patch) | |
tree | a7cca77ab00b4794f3c9d1431981f52ccb034591 | |
parent | d58016b768cf82cebbf579e1e5658ef89641d944 (diff) | |
download | edk2-d8c18ba3f409a3fdb59b2f2ee19caf5fb5b1d066.zip edk2-d8c18ba3f409a3fdb59b2f2ee19caf5fb5b1d066.tar.gz edk2-d8c18ba3f409a3fdb59b2f2ee19caf5fb5b1d066.tar.bz2 |
MdeModulePkg: Add Universal Payload general definition header file
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>
-rw-r--r-- | MdeModulePkg/Include/UniversalPayload/UniversalPayload.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h new file mode 100644 index 0000000..e661306 --- /dev/null +++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h @@ -0,0 +1,35 @@ +/** @file
+ Universal Payload general definitions.
+
+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Revision Reference:
+ - Universal Payload Specification 0.75 (https://universalpayload.github.io/documentation/)
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_H_
+#define UNIVERSAL_PAYLOAD_H_
+
+#pragma pack(1)
+
+typedef struct {
+ UINT8 Revision;
+ UINT8 Reserved;
+ UINT16 Length;
+} UNIVERSAL_PAYLOAD_GENERIC_HEADER;
+
+#pragma pack()
+
+/**
+ Returns the size of a structure of known type, up through and including a specified field.
+
+ @param TYPE The name of the data structure that contains the field specified by Field.
+ @param Field The name of the field in the data structure.
+
+ @return size, in bytes.
+
+**/
+#define UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD(TYPE, Field) (OFFSET_OF(TYPE, Field) + sizeof (((TYPE *) 0)->Field))
+
+#endif // UNIVERSAL_PAYLOAD_H_
|