From nobody Tue Feb 10 07:41:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76031+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76031+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1622782635; cv=none; d=zohomail.com; s=zohoarc; b=gB6mg2wT5G+aMfTik4Vkxt8YP2bR4398d/xpicWwwzclIMg+NXiDuOF4Vd/e/VUSwrKML5givWRfvbebQJL/4JtDQ999hvTUeyBCG369qzfV+OYgZcnh7kwWa+mmYk4pgLC7M2vhjuA6V1vgi0rAHFdiu9tlQg/nM0U0cgCJbVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622782635; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ollZH606MaWj2ATQmqkelWjmKMbyKN/ClJgkbfxZUHI=; b=iwXxqZy8ZC6/jg+INE+TrxUKwVbpHnghdHIxlY7NQEzLfF65C+L+RDleRuZA6SjQmN/n1CytuOuj82RUUQP1pAMDkkK+NBVGWGkWJZjorBSIvayyKVwZc2G7kvXlfl0Hw1sbaKSMIsM5SiFk0I7VS5CE0pdQmeu1EluVbvTs3YU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76031+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162278263510172.29269035211269; Thu, 3 Jun 2021 21:57:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YievYY1788612xQbpaUQRt6v; Thu, 03 Jun 2021 21:57:14 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.4284.1622782621066069793 for ; Thu, 03 Jun 2021 21:57:01 -0700 IronPort-SDR: BYJPAKxNFDktTKC45FGldrbK2EEFO7zwcNJc+IKkglnoQiw+0Cl1LdQFs2UmYmDi9C6M+8TQcm nG2Kbo9WEUgQ== X-IronPort-AV: E=McAfee;i="6200,9189,10004"; a="268087097" X-IronPort-AV: E=Sophos;i="5.83,247,1616482800"; d="scan'208";a="268087097" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 21:56:55 -0700 IronPort-SDR: sml+9ca3RUE1/bS5FA6SQOIIfL+LiKa/HHUZCOHbzNCadx616URyXVGXne0VpjuHC/8cWqemzE Erd8DuJmdZRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,247,1616482800"; d="scan'208";a="480502747" X-Received: from fieedk002.ccr.corp.intel.com ([10.239.158.144]) by orsmga001.jf.intel.com with ESMTP; 03 Jun 2021 21:56:54 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Jian J Wang , Hao A Wu Subject: [edk2-devel] [Patch V2 1/9] MdeModulePkg: Add Universal Payload general defination header file Date: Fri, 4 Jun 2021 12:56:36 +0800 Message-Id: <20210604045644.1721-2-zhiguang.liu@intel.com> In-Reply-To: <20210604045644.1721-1-zhiguang.liu@intel.com> References: <20210604045644.1721-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com X-Gm-Message-State: siVhZsEH7rcFY9b5jNOtKL08x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622782634; bh=qpNW1MCjD3fjDgQORrWtd2YyiPkiywXkbaFbJpH4OKE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=FI/Z0wGx4vt7eUEYyvkXGaWrXgVIFwQw0cXQdeBMpFHtxNg8B59ecA0jgiANQNGYuY0 0Y4pottUNtZDQ6qjn4F0AgPbDrrSotDBf116TKq0ebQxVvuQ3kVBRULR9SexVV9OHeu9F K6c8j4Bz4bBe385mg/K+2U499g6K3DdYdNU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" V1: Add Universal Payload general defination header file according to Universal Payload=E2=80=99s documentation V2: Add a macro funtion to check the Revision Cc: Michael D Kinney Cc: Liming Gao Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Zhiguang Liu --- MdeModulePkg/Include/UniversalPayload/UniversalPayload.h | 43 ++++++++++++= +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h b/Mde= ModulePkg/Include/UniversalPayload/UniversalPayload.h new file mode 100644 index 0000000000..a026f709bf --- /dev/null +++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h @@ -0,0 +1,43 @@ +/** @file + Universal Payload general definations. + +Copyright (c) 2021, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __UNIVERSAL_PAYLOAD_H__ +#define __UNIVERSAL_PAYLOAD_H__ + +#include + +#pragma pack(1) + +typedef struct { + UINT8 Revision; + UINT8 Reserved; + UINT16 Length; +} PLD_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 PLD_SIZEOF_THROUGH_FIELD(TYPE, Field) (OFFSET_OF(TYPE, Field) + si= zeof (((TYPE *) 0)->Field)) + +#define IS_PLD_HEADER_HAS_REVISION(GuidHob, ExpectedRevision) \ + ( \ + (GuidHob !=3D NULL) && \ + (sizeof (PLD_GENERIC_HEADER) <=3D GET_GUID_HOB_DATA_SIZE (GuidHob)) &&= \ + (((PLD_GENERIC_HEADER *) GET_GUID_HOB_DATA (GuidHob))->Length <=3D GET= _GUID_HOB_DATA_SIZE (GuidHob)) && \ + (((PLD_GENERIC_HEADER *) GET_GUID_HOB_DATA (GuidHob))->Revision =3D=3D= ExpectedRevision) \ + ) + +#endif // __UNIVERSAL_PAYLOAD_H__ --=20 2.30.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76031): https://edk2.groups.io/g/devel/message/76031 Mute This Topic: https://groups.io/mt/83301962/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-