From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id EC514D801B0 for ; Fri, 17 May 2024 11:49:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=i1HX+tPvP9VaSMxgicNIePtyptfop5FnYPcE6OpRewo=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1715946554; v=1; b=W0n0jgFAwuWnSJBCw6roFV5RDzVwrZjmcSI4wW9Zeur5iYqGq/YDyNrr/1dDrziNoOSXKbSU YUIVrugmBFNFV7zY2CZ6K/XVr7WpPIOPWOY5nX1DnzWuRdhZx/pf2GS2OeP02RgnDUfatXPgeh1 zrR24s2UPHX+E1b+U39A59uIbmdnePEwLHWIgmYcu06eE91auRywF6ArsTXnbG7Vyis2CGlWXUM tVEEXX/DgUh6DOWrKzzsD+P7elr3JyD0oQAvsFi8Uvh2qMLd0xgGtKORliPbEv9pUySxi34rO5U +lfhmdjuqZEQzHeniZca1GqhErgF1ZLngVa4kDW72CXDQ== X-Received: by 127.0.0.2 with SMTP id Omx8YY7687511x8Ozsj4Egd5; Fri, 17 May 2024 04:49:14 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mx.groups.io with SMTP id smtpd.web11.38614.1715946553521981145 for ; Fri, 17 May 2024 04:49:13 -0700 X-CSE-ConnectionGUID: qBgKF0HCSa6K9MzR/wPE6g== X-CSE-MsgGUID: JB/Q12nLRNmdM4luIwuDGw== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="12240910" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208,217";a="12240910" X-Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 04:49:13 -0700 X-CSE-ConnectionGUID: yyHdgb+ORcmxGqYlQzcZ9g== X-CSE-MsgGUID: OucXQpsrTb699gWsqyLJgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208,217";a="31787112" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 May 2024 04:49:12 -0700 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 17 May 2024 04:49:12 -0700 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 17 May 2024 04:49:11 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 17 May 2024 04:49:11 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 17 May 2024 04:49:11 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DM4PR11MB8180.namprd11.prod.outlook.com (2603:10b6:8:18d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.30; Fri, 17 May 2024 11:49:10 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::41a4:c775:32e6:76a8]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::41a4:c775:32e6:76a8%4]) with mapi id 15.20.7587.028; Fri, 17 May 2024 11:49:09 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: Liming Gao , "Wu, Jiaxin" Subject: Re: [edk2-devel] [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid Thread-Topic: [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid Thread-Index: AQHaqD+N7qCa+j93iUOFXHQeOIAVe7GbT4wK Date: Fri, 17 May 2024 11:49:09 +0000 Message-ID: References: <20240517094917.513-1-dun.tan@intel.com> <20240517094917.513-2-dun.tan@intel.com> In-Reply-To: <20240517094917.513-2-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DM4PR11MB8180:EE_ x-ms-office365-filtering-correlation-id: 086f302c-5b0a-4e91-dc21-08dc76675d59 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?vm4wgenAtINAWBGZwRvg/YEwX1XgvfOk9LWflNx/NBvhFiWm5kmEbospBIm2?= =?us-ascii?Q?d43eC3326goXyIZd+P8skSe/Z6mkBOnW1npxYUiDAlcfsx8M4dDhubgPKapa?= =?us-ascii?Q?HOcTcKT+umvRImsxJIFUmf/4nj49bW6OKXM4ktTtMDzlkmVNmJYW+2swP00o?= =?us-ascii?Q?RO+WUdJj2jGQRRANmbsOJslS/GnbdP2Q7HEx+Ggz++vy21s29eyxCNhBNZjg?= =?us-ascii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MMZOOjUl+R+WnBxL?= =?us-ascii?Q?YZTynXzlHECll9K9Mx75qLCu3ZueYwyLfAFQQHuynCzRoG7de8eevZAZMWD3?= =?us-ascii?Q?+Du1xo4rILhZp9zUF4Gbr3WvW77tsiLD5LngFpgHOFjYJPoTjbQm2ITbuFoH?= =?us-ascii?Q?ZBymXchg5jjFM8BGv5lGJY/NKjV7KOFd2GvUJcGP9pqh07WqRuzxVTwewdWL?= =?us-ascii?Q?9rQ4zq3jc762HC650W10egvUEd6GXnFwt+NdK4gHlBx4aA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qEaqZOLgbNnYtd8elPP9telbTmA273kbaDFkQQ+7oykR57IXuovRLf+KNzBL?= =?us-ascii?Q?3tTwwX34ZsK6Xv7oKxEXLgdlCAGpSZUlHnyx4CbO/mMgZVmfptMdiFYg+fQg?= =?us-ascii?Q?qRKWrVSIQEEmA7DDmUfw5pSluic81WmAKDsfNuBqkaDW8qDTcBWp3/kLj5as?= =?us-ascii?Q?IU+em2pKABaxXSxiZa+3G5K6m1QEf4W9xchsnWmGGrhyRRED6LZF2ij8xtkp?= =?us-ascii?Q?qoWmepopFtBhbs+acEmW20Ipo2XHp9mhD+sZ6cnWZm/OjXX1z/HF9H295hFO?= =?us-ascii?Q?UsvExKvNZb1sQubgGlSiZi5w7zs9feVGefAxxvpnAIuFEMdDYqsz8k+l0wPq?= =?us-ascii?Q?XA2bFnr0I8j/WOZPXD1+xnLSwkmO+uV3VoK/larNEs3ppuoz8VfcFuqIrYNq?= =?us-ascii?Q?n+KRjHSG5byDecVz+tl2UjYZOTa7nuxjL8VSSx5lyShLda8GNRA2BPIImeHD?= =?us-ascii?Q?Tjna64Fpq6KjBzDM/DpZ/sq0670hidz0oDBvUGZDYPj6lvFmmc6LWBuD3Jol?= =?us-ascii?Q?6Tkdpd+6wX5JlYvRYG4dRyVAxDUkW370A7EQzZIpRg0pOFG5cn6bjPq0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3CYgN2M0bWrMArjH67BUFkJ?= =?us-ascii?Q?gjZNuPKkPG+f25dWYg9Mc4nvxxGhjFXij6/9A5ZSbkXm6OZgT8+15WYhr5TI?= =?us-ascii?Q?Z4d7K8VBwbN8QIwSXFA=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 086f302c-5b0a-4e91-dc21-08dc76675d59 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2024 11:49:09.9166 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6hGRgFTCOfNiTU91I4KERO7lSjVnMprVr9qwY4y1NLymIBux+2hAHI8ly0xKbw7EB8e4H22j/FVBGdiTS4Xuxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB8180 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 17 May 2024 04:49:13 -0700 Resent-From: ray.ni@intel.com Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3ZxPKsQV8WiGYKEO3ZRKYjlLx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244C1CC7FB162DCEE225AD88CEE2MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=W0n0jgFA; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) --_000_MN6PR11MB8244C1CC7FB162DCEE225AD88CEE2MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable There is no need to use pack(1). Explicit pack(1) is needed when you really need to save spaces or the data = is saved in some NV storage to be accessed by a different software componen= t. Thanks, Ray ________________________________ From: Tan, Dun Sent: Friday, May 17, 2024 17:49 To: devel@edk2.groups.io Cc: Ni, Ray ; Liming Gao ; Wu, = Jiaxin Subject: [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHob= Guid This commit defines VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used to store the address and size of the buffer that will be used for variable runtime service when the PcdEnableVariableRuntimeCache is TRUE. In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei module will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate needed buffer for different type cache, unblock the buffer and build HOB. Then VariableSmmRuntimeDxe driver will consume the gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache related content. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Liming Gao Cc: Jiaxin Wu --- MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h | 65 ++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 +++ 2 files changed, 68 insertions(+) diff --git a/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h b/MdeModu= lePkg/Include/Guid/VariableRuntimeCacheInfo.h new file mode 100644 index 0000000000..c2a8b77945 --- /dev/null +++ b/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h @@ -0,0 +1,65 @@ +/** @file + This Variable Runtime Cache Info HOB is used to store the address + and the size of the buffer that will be used for variable runtime + service when the PcdEnableVariableRuntimeCache is TRUE. + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef VARIABLE_RUNTIME_CACHE_INFO_H_ +#define VARIABLE_RUNTIME_CACHE_INFO_H_ + +#include + +#define VARIABLE_RUNTIME_CACHE_INFO_HOB_REVISION 1 + +#define VARIABLE_RUNTIME_CACHE_INFO_GUID \ + { \ + 0x0f472f7d, 0x6713, 0x4915, {0x96, 0x14, 0x5d, 0xda, 0x28, 0x40, 0x10,= 0x56} \ + } + +#pragma pack(1) +typedef struct { + /// + /// TRUE indicates GetVariable () or GetNextVariable () is being called. + /// When the value is FALSE, the given update (and any other pending upd= ates) + /// can be flushed to the runtime cache. + /// + BOOLEAN ReadLock; + /// + /// TRUE indicates there is pending update for the given variable store = needed + /// to be flushed to the runtime cache. + /// + BOOLEAN PendingUpdate; + /// + /// TRUE indicates all HOB variables have been flushed in flash. + /// + BOOLEAN HobFlushComplete; +} CACHE_INFO_FLAG; + +typedef struct { + CACHE_INFO_FLAG *CacheInfoFlag; + /// + /// Buffer reserved for runtime Hob cache + /// + UINT64 RuntimeHobCacheBuffer; + UINTN RuntimeHobCachePages; + /// + /// Buffer reserved for Non-Volatile runtime cache + /// + UINT64 RuntimeNvCacheBuffer; + UINTN RuntimeNvCachePages; + /// + /// Buffer reserved for Volatile runtime cache + /// + UINT64 RuntimeVolatileCacheBuffer; + UINTN RuntimeVolatileCachePages; +} VARIABLE_RUNTIME_CACHE_INFO; +#pragma pack() + +extern EFI_GUID gEdkiiVariableRuntimeCacheInfoHobGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index f7339f0aec..1bf5e31b7c 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -465,6 +465,9 @@ gEdk2JedecSfdpSpiDxeDriverGuid =3D { 0xBE71701E, 0xB63C, 0x4574, { 0x9C= , 0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }} gEdk2JedecSfdpSpiSmmDriverGuid =3D { 0x95A1E915, 0x195C, 0x477C, { 0x92= , 0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }} + ## Include/Guid/VariableRuntimeCacheInfo.h + gEdkiiVariableRuntimeCacheInfoHobGuid =3D { 0x0f472f7d, 0x6713, 0x4915, = { 0x96, 0x14, 0x5d, 0xda, 0x28, 0x40, 0x10, 0x56 }} + [Ppis] ## Include/Ppi/FirmwareVolumeShadowPpi.h gEdkiiPeiFirmwareVolumeShadowPpiGuid =3D { 0x7dfe756c, 0xed8d, 0x4d77, {= 0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } } -- 2.31.1.windows.1 -=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 (#119040): https://edk2.groups.io/g/devel/message/119040 Mute This Topic: https://groups.io/mt/106150797/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN6PR11MB8244C1CC7FB162DCEE225AD88CEE2MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
There is no need to use pack(1).
Explicit pack(1) is needed when you really need to save spaces or the data = is saved in some NV storage to be accessed by a different software componen= t.

Thanks,
Ray

From: Tan, Dun <dun.tan@= intel.com>
Sent: Friday, May 17, 2024 17:49
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ni, Ray <ray.ni@intel.com>; Liming Gao <gaoliming@byoso= ft.com.cn>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCache= InfoHobGuid
 
This commit defines VARIABLE_RUNTIME_CACHE_INFO HO= B.
The HOB is used to store the address and size of the
buffer that will be used for variable runtime service
when the PcdEnableVariableRuntimeCache is TRUE.

In following patches, when PcdEnableVariableRuntimeCache
is TRUE, VariablePei module will install a callback of
gEfiPeiMemoryDiscoveredPpiGuid to allocate needed buffer
for different type cache, unblock the buffer and build HOB.
Then VariableSmmRuntimeDxe driver will consume the
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the
variable runtime cache related content.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
---
 MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h | 65 +++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec      &nbs= p;            &= nbsp;    |  3 +++
 2 files changed, 68 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h b/MdeModu= lePkg/Include/Guid/VariableRuntimeCacheInfo.h
new file mode 100644
index 0000000000..c2a8b77945
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
@@ -0,0 +1,65 @@
+/** @file
+  This Variable Runtime Cache Info HOB is used to store the address +  and the size of the buffer that will be used for variable runtime +  service when the PcdEnableVariableRuntimeCache is TRUE.
+
+  Copyright (c) 2024, Intel Corporation. All rights reserved.<BR&g= t;
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef VARIABLE_RUNTIME_CACHE_INFO_H_
+#define VARIABLE_RUNTIME_CACHE_INFO_H_
+
+#include <PiPei.h>
+
+#define VARIABLE_RUNTIME_CACHE_INFO_HOB_REVISION  1
+
+#define VARIABLE_RUNTIME_CACHE_INFO_GUID \
+  { \
+    0x0f472f7d, 0x6713, 0x4915, {0x96, 0x14, 0x5d, 0xda, 0x= 28, 0x40, 0x10, 0x56}  \
+  }
+
+#pragma pack(1)
+typedef struct {
+  ///
+  /// TRUE indicates GetVariable () or GetNextVariable () is being ca= lled.
+  /// When the value is FALSE, the given update (and any other pendin= g updates)
+  /// can be flushed to the runtime cache.
+  ///
+  BOOLEAN    ReadLock;
+  ///
+  /// TRUE indicates there is pending update for the given variable s= tore needed
+  /// to be flushed to the runtime cache.
+  ///
+  BOOLEAN    PendingUpdate;
+  ///
+  /// TRUE indicates all HOB variables have been flushed in flash. +  ///
+  BOOLEAN    HobFlushComplete;
+} CACHE_INFO_FLAG;
+
+typedef struct {
+  CACHE_INFO_FLAG    *CacheInfoFlag;
+  ///
+  /// Buffer reserved for runtime Hob cache
+  ///
+  UINT64          &= nbsp;  RuntimeHobCacheBuffer;
+  UINTN          &n= bsp;   RuntimeHobCachePages;
+  ///
+  /// Buffer reserved for Non-Volatile runtime cache
+  ///
+  UINT64          &= nbsp;  RuntimeNvCacheBuffer;
+  UINTN          &n= bsp;   RuntimeNvCachePages;
+  ///
+  /// Buffer reserved for Volatile runtime cache
+  ///
+  UINT64          &= nbsp;  RuntimeVolatileCacheBuffer;
+  UINTN          &n= bsp;   RuntimeVolatileCachePages;
+} VARIABLE_RUNTIME_CACHE_INFO;
+#pragma pack()
+
+extern EFI_GUID  gEdkiiVariableRuntimeCacheInfoHobGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec<= br> index f7339f0aec..1bf5e31b7c 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -465,6 +465,9 @@
   gEdk2JedecSfdpSpiDxeDriverGuid  =3D { 0xBE71701E, 0xB63C,= 0x4574, { 0x9C, 0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }}
   gEdk2JedecSfdpSpiSmmDriverGuid  =3D { 0x95A1E915, 0x195C,= 0x477C, { 0x92, 0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }}
 
+  ## Include/Guid/VariableRuntimeCacheInfo.h
+  gEdkiiVariableRuntimeCacheInfoHobGuid =3D { 0x0f472f7d, 0x6713, 0x4= 915, { 0x96, 0x14, 0x5d, 0xda, 0x28, 0x40, 0x10, 0x56 }}
+
 [Ppis]
   ## Include/Ppi/FirmwareVolumeShadowPpi.h
   gEdkiiPeiFirmwareVolumeShadowPpiGuid =3D { 0x7dfe756c, 0xed8d,= 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }
--
2.31.1.windows.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#119040) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244C1CC7FB162DCEE225AD88CEE2MN6PR11MB8244namp_--