From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.3957.1631826531215692370 for ; Thu, 16 Sep 2021 14:08:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=MTNMesho; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10109"; a="286348585" X-IronPort-AV: E=Sophos;i="5.85,299,1624345200"; d="scan'208";a="286348585" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 14:08:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,299,1624345200"; d="scan'208";a="610814811" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 16 Sep 2021 14:08:49 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 16 Sep 2021 14:08:49 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 16 Sep 2021 14:08:48 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 16 Sep 2021 14:08:48 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 16 Sep 2021 14:08:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X/eHnygSxa0d18sR2anaGt+fbZvr0RKpZKyYdE8xicKLa65MS9kPZMfkbvX1cm2lAHHtzRe2i/VGaQdCwdouzdWtoAuJb2bGruAa8rHOYf1MOxsaPdv8CoFdwTJoFlQjTBpBVN6EAOn5RQcS08NhdmZpksQrlBQfgNTxyKVMKfYvxU2dWRh2Vl5wkYDJFL+A5Sqn0mAATyU428vZ4wOZ+k1y7gLK5bL4GVvRTMdJWd+33laSKnViTa4ugvt6g49tvE7ebsJcJDY/jwA1i1mQjFEBRup95DFwXG2s6lP6yr9dbzElswwO+yr1Pn6mjNfCnag2MaT4gi/1buVhv1IPFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LpZnmmX4r27WQbB4Ac3j5CslHJZIhWJCDvuv3+7A7/Q=; b=FnIrXe48ZQ3tltaSmghFtl5SHEiucH3Atnfm4dzaPfVlTqx4Q9G4lAWtjeFzTeng06tMgF+brTp9y1dPP4u6ZELSKsNw4k42fESbN2n2ReOxa9aWoVL/p5/muEBpVkBYhXDoNePqSblK3RxFUvZT4U11GvGwmyyiwVf9klMQIUep43BsYniRfPure+TZMCIj9Q5FGvN7SsGC68KGp8GrP6JafvXiRFm0cFCSEBh7HY69xcA3J7l3v4gzEslW7lPbb6Bku/QZxNQiuN7sr9C+IH9SzreBZsN++1laPXGEUujQnUBkCdAOtWqL/Kk5y6C82xfYi7IkJltctGCXDbqrxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LpZnmmX4r27WQbB4Ac3j5CslHJZIhWJCDvuv3+7A7/Q=; b=MTNMeshoPdTtLGz4zZsdjszSEJF++ztNLGsJqjEAOFCITovEOmAbmLmRu+PG1aT39MUGe/qlARDqiwaeEHM1FkExhgTKNMfh85z+BYrGfaw3clSofAmndubyKBXPGRNVFyHRXeiBIgKedVfuM8szmqlbg8ED64c2j02mU7FG54s= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MWHPR11MB1805.namprd11.prod.outlook.com (2603:10b6:300:114::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 16 Sep 2021 21:08:47 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::f07d:7a97:3b68:92ed]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::f07d:7a97:3b68:92ed%11]) with mapi id 15.20.4523.016; Thu, 16 Sep 2021 21:08:47 +0000 From: "Nate DeSimone" To: "Oram, Isaac W" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , Liming Gao , "Dong, Eric" Subject: Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Variable*Lib: Build VariableRead and VariableWrite libs Thread-Topic: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Variable*Lib: Build VariableRead and VariableWrite libs Thread-Index: AQHXpQEH/6yUZOMbqE2AKJdLj+RFUqunM9Eg Date: Thu, 16 Sep 2021 21:08:47 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9779d9ed-3b70-4fe2-e26b-08d979562c90 x-ms-traffictypediagnostic: MWHPR11MB1805: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1850; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DD30ADg+zny3l+al/wt4YxnbDqsIyE+nphOYNwSXX6NDQjGQYBy0/Dj3ZDMM+uOm/wze1UFJU2jCkEO1nuk+nlKiFejBgF4mRkKuwFsXWFvJS5pyZt8Rt/JCXl1y4Z0FPdd5INuEQLY1rN5OeUzT/KGtXPEIX2R0kpg0pAGD1c7PV0TdkaDSOzEZFGPoQf125JMUe9ZsnMH+0sr7xTwpR/cI15djXHELnfCSizZDvxtRgd7iRQxRjVE5vblyL7Yg0uH3yADsqOCjPYJY9ym45SUirXbNASLQzUxVSNkiuGEHY+IhRcTJyfLRRCRn6+p8LBprmGyk0z9ZOmk/0H+5hnjIXOK1txcrCK+vgZnzuJgkWM7iAn01l+5whopJxa0u0V40HNFTbcTxExM3tM0Y9Xwb4S2Fv+NGJfn1tsWLPc+lAvTf4HyQHPx5z2hgT3QNWdm8Pkv54pQNe+SixF5sx+Efrv2rLDiTfoaMnzORw2O6o2hVveJN3wXGUDifayRTRNklgo6rylTTg/v8m4FYEFL1+0xikAaavxoBwcRsl53cL37BlZbkgjj+PJAdf/VCJxbWCIPgePId2JRc/7aP6BKaXu2lmZsAKazTzTiSOQo8WhvwPt5u9NVNCkqUmtNvrD5veZ/O7aotbA4LE70VQIEreoQvYXJBqGw5JQWHsse39fBxPZAZnYvSxazD9E6EDCsA7GSVqE+B/kxRNjkJoJjAhMEGQ0KR6yMTS/AShej/keU1I5ITo/UL3qShzdCQwcIAmWDpJaWCad4WisC7yNKRt45+YdfwbO362KdHZIc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(39860400002)(366004)(346002)(136003)(966005)(6506007)(55016002)(9686003)(186003)(107886003)(122000001)(38070700005)(86362001)(53546011)(26005)(83380400001)(5660300002)(64756008)(66446008)(66556008)(66946007)(76116006)(66476007)(8936002)(8676002)(33656002)(2906002)(7696005)(54906003)(110136005)(478600001)(71200400001)(316002)(4326008)(38100700002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xey+BLNEVAMYtaj/kAN1ekRQnflRAd7rODIELRCY5D/8MQXIbAxd3jrSzk2g?= =?us-ascii?Q?Uil+dbmWtMoMDoEt0FaOly9n4HX7ymLRnyz6+/hk2zvt3J61o/GDdHcXCqhI?= =?us-ascii?Q?GCpAbJypBs12PJAOCRFN4UtZ64lsBUVjA5F5rWRCVanC3foW5/nPNHMJ58ou?= =?us-ascii?Q?RUNY/Xg7XyOa0Z+dBLR9aRUZR7U5JuAg2In1PbJE3t9cF2er6qqgvzsshHNg?= =?us-ascii?Q?hcPGfn04z5WXGklaxyPBSLzqwL4J2eDzbe4uRgQ2x842ze4l9i81zjtte8Hg?= =?us-ascii?Q?p2A0dXYDSoeNppox8Iasuyv62StLqZ7nQIdRx1eVmB+Q5wVzFp+lZpjDc8Zt?= =?us-ascii?Q?93xCfIRwfIwZUvEkM0z/rFv+kOsudBrmQATv+nlNVFaMGLBGmR7UDRvSoBbf?= =?us-ascii?Q?MbtYP0vnHk7fbHKAv6TdWFY2KaE0iWv/t7WZFfL2p7v/mJhfZULx4aQ+o5W9?= =?us-ascii?Q?lgGw9tehETWIQJm2MSROD4nRveDvC2uTAzVlcen93MK6NKZuasfbuIEBz1ob?= =?us-ascii?Q?3eLZb75kPKilMd6puXHA8HJnNlarJLqq9Gr8edIF8iw/HvKcZ6UuLUPnvB77?= =?us-ascii?Q?lgwBZibbnS2Ynae6yCBaUObw8q9J6oP8gqVIGYZNOuJacNy+9rt9SMu6eA4s?= =?us-ascii?Q?BZd+kjFmQdeGfPPA4YaFdIK8+//DdTQrFQlaWk7Xq9KqtufeCAWMQlodTeGa?= =?us-ascii?Q?ZmPmqjQpPeni08rG7TvEdZwJhOF1Exyjspkz5BQplCYr3FcIaN47ixjYAxMX?= =?us-ascii?Q?Rc7wLJXwiTkL2yA2qjLtXHYWCOrfy3QAAW0bzdZNsf/BxTq7qIMeJ72tdnA2?= =?us-ascii?Q?uqERovRfiqAudjVD516750wSVQUL1hs85ywFqMlMJY3MHY7MeZ3xioZodkrF?= =?us-ascii?Q?AxL16L2fFAxBQSBf6kotgWUcYV8afbFocuADvYBJzPE0plP4KJwc+i1ialPG?= =?us-ascii?Q?D4uP71k0FBeXITN+JDfcs2eVgXrCJ3B5GUJn/hf1qDFPrMfhe7JBpfox8VN4?= =?us-ascii?Q?+O5qMq1/q8/AA4F5JZbGVQ0hgxl093a0V/t4lt3sHLeihr4zoUu+uyGp+Sn1?= =?us-ascii?Q?3KWfclcZJTMzEy+CVztVdfakH60PlwVUXrNw2rPwRZ7303+qJmQUspNrW5eN?= =?us-ascii?Q?z+lZ5LM57rg2mQxWeY6SHlP5C6ylV5DIGYqCvt5nXv1RdYP9RzAd4NBkSqKc?= =?us-ascii?Q?XSimASH/TDDZKgHJyt2cevbXwodb7sDvcSgkPbHpuCjt85VJwyVksZQeSLA3?= =?us-ascii?Q?fxCfHaXbZ1RTTuLyh7nf3rbQAIu+dpcVtwJkA8v9i8LkxzcpQHnpr65qOIBP?= =?us-ascii?Q?pIAHRJ5S1RnMbqrYuMHqmB1l?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9779d9ed-3b70-4fe2-e26b-08d979562c90 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2021 21:08:47.0247 (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: K+h2E+FcnNdhYNDIatku/bj3O+16QjusIiq3kWoBIJFJ6hjUU/xLBYQRVf44tRlBWWxjmIsI707v2W9hZYcLJHod7qhN85lCgUkgFT1dGNM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1805 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed: https://github.com/tianocore/edk2-platforms/commit/2cd3be4 -----Original Message----- From: Oram, Isaac W =20 Sent: Wednesday, September 8, 2021 3:30 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Liming Gao ; Dong, Eric Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Variable= *Lib: Build VariableRead and VariableWrite libs Add the VariableReadLib and VariableWriteLib instances to Components to ens= ure build when building MinPlatformPkg.dsc. Add a NULL library instance that provides the non-functional library instan= ce for VariableReadLib designed for all phase use. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Isaac Oram --- Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariable= ReadLibNull.c | 75 ++++++++++++++++++++ Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariable= ReadLibNull.inf | 37 ++++++++++ Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc = | 6 +- 3 files changed, 117 insertions(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/= BaseVariableReadLibNull.c b/Platform/Intel/MinPlatformPkg/Library/BaseVaria= bleReadLibNull/BaseVariableReadLibNull.c new file mode 100644 index 0000000000..f276b7b6b4 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/Base +++ VariableReadLibNull.c @@ -0,0 +1,75 @@ +/** @file + NULL implementation of Variable Read Lib + + This library provides phase agnostic access to the UEFI Variable Service= s. + This is done by implementing a wrapper on top of the phase specific=20 + mechanism for reading from UEFI variables. For example, the PEI=20 + implementation of this library uses EFI_PEI_READ_ONLY_VARIABLE2_PPI.=20 + The DXE implementation accesses the UEFI Runtime Services Table, and=20 + the SMM implementation uses EFI_SMM_VARIABLE_PROTOCOL. + + Using this library allows code to be written in a generic manner that=20 + can be used in PEI, DXE, or SMM without modification. + + @copyright + Copyright 2021 Intel Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent **/ + +#include + +/** + Returns the value of a variable. + + @param[in] VariableName A Null-terminated string that is the name= of the vendor's + variable. + @param[in] VendorGuid A unique identifier for the vendor. + @param[out] Attributes If not NULL, a pointer to the memory loca= tion to return the + attributes bitmask for the variable. + @param[in, out] DataSize On input, the size in bytes of the return= Data buffer. + On output the size of data returned in Da= ta. + @param[out] Data The buffer to return the contents of the = variable. May be NULL + with a zero DataSize in order to determin= e the size buffer needed. + + @retval EFI_UNSUPPORTED This function is not implemented by this = instance of the LibraryClass + +**/ +EFI_STATUS +EFIAPI +VarLibGetVariable ( + IN CHAR16 *VariableName, + IN EFI_GUID *VendorGuid, + OUT UINT32 *Attributes, OPTIONAL + IN OUT UINTN *DataSize, + OUT VOID *Data OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +/** + Enumerates the current variable names. + + @param[in, out] VariableNameSize The size of the VariableName buffer. T= he size must be large + enough to fit input string supplied in= VariableName buffer. + @param[in, out] VariableName On input, supplies the last VariableNa= me that was returned + by GetNextVariableName(). On output, r= eturns the Nullterminated + string of the current variable. + @param[in, out] VendorGuid On input, supplies the last VendorGuid= that was returned by + GetNextVariableName(). On output, retu= rns the + VendorGuid of the current variable. + + @retval EFI_UNSUPPORTED This function is not implemented by th= is instance of the LibraryClass + +**/ +EFI_STATUS +EFIAPI +VarLibGetNextVariableName ( + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VendorGuid + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/= BaseVariableReadLibNull.inf b/Platform/Intel/MinPlatformPkg/Library/BaseVar= iableReadLibNull/BaseVariableReadLibNull.inf new file mode 100644 index 0000000000..3a397998a9 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/Library/BaseVariableReadLibNull/Base +++ VariableReadLibNull.inf @@ -0,0 +1,37 @@ +## @file +# Component description file for NULL implementation of Variable Read=20 +Lib # # This library provides phase agnostic access to the UEFI=20 +Variable Services. +# This is done by implementing a wrapper on top of the phase specific=20 +mechanism # for reading from UEFI variables. For example, the PEI=20 +implementation of this # library uses EFI_PEI_READ_ONLY_VARIABLE2_PPI.=20 +The DXE implementation accesses # the UEFI Runtime Services Table, and=20 +the SMM implementation uses # EFI_SMM_VARIABLE_PROTOCOL. +# +# Using this library allows code to be written in a generic manner that=20 +can be # used in PEI, DXE, or SMM without modification. +# +# @copyright +# Copyright 2021 Intel Corporation.
# # SPDX-License-Identifier:=20 +BSD-2-Clause-Patent ## + +## +## NOTICE: This library is also available in MinPlatformPkg. This copy was= added +## for the convience of those that are using an older MinPlatformP= kg. +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseVariableReadLibNull + FILE_GUID =3D 5C9E2489-329F-4D2A-90F1-F5CB2A88A3E6 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D BASE + LIBRARY_CLASS =3D VariableReadLib + +[Packages] + MdePkg/MdePkg.dec + +[Sources] + BaseVariableReadLibNull.c diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/In= tel/MinPlatformPkg/MinPlatformPkg.dsc index 07b776cecd..a09f8db3ab 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc @@ -74,7 +74,7 @@ FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib= /PeiFspWrapperApiTestLib.inf FspWrapperHobProcessLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperH= obProcessLib/PeiFspWrapperHobProcessLib.inf PlatformSecLib|MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSe= cLib/SecFspWrapperPlatformSecLib.inf - + =20 + VariableReadLib|MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVar + iableReadLibNull.inf FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPla= tformLib/PeiFspWrapperPlatformLib.inf =20 BoardInitLib|MinPlatformPkg/PlatformInit/Library/BoardInitLibNull/BoardI= nitLibNull.inf @@ -214,5 +214,9 @@ MinPlatformPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf MinPlatformPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf =20 + =20 + MinPlatformPkg/Library/BaseVariableReadLibNull/BaseVariableReadLibNull + .inf =20 + MinPlatformPkg/Library/SmmVariableReadLib/StandaloneMmVariableReadLib. + inf =20 + MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLi + b.inf + [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES -- 2.27.0.windows.1