From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.3916.1631826255954324041 for ; Thu, 16 Sep 2021 14:04:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=D2yEsDJb; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10109"; a="202157351" X-IronPort-AV: E=Sophos;i="5.85,299,1624345200"; d="scan'208";a="202157351" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2021 14:04:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,299,1624345200"; d="scan'208";a="509509274" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 16 Sep 2021 14:04:14 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:04:14 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) 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:04:14 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by edgegateway.intel.com (134.134.137.100) 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:04:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/A2Ma9yXKDapbxpJZ3hO+6dK0aKHAS6K2q+7Lkr5XN8Cp8ZA9MEnaxMIbfUkGcYmxM3wGdo8KaAtYb3Zf1dLj9eL8VFNHt7lcbCyYVn39rOiFg5vPGRI+G3S3+eBOFI23g8MfACVa3GrnP9SGrrRIdbFXPrlTJXTlBVUIbKL6BO6Agqe7wGOPugObCSgXafjHXBHXOzJ3OX5Rr8eH04Zv3n79WhcFjsmntraT8GOk40u45xERzdOYsHwdVbHcvNxyM6RUbrPSzLeXJOJXT1j/V1vuJfloI96GDUeGbP3MgwXo34i3nC+niYrGyIRiAQojTgB89zOVYFTjujmjcaAg== 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=JFvRO1eqju0q9f/3yvXwgCXJOJsvP2UuxMKN9Fhvuh4=; b=Bx7GmlYNE1g+Aid1v2bYvnnypKhldRgPvZvOsrEx9m/XC2uGy5mbVaaoCJgX0khX8I3CxBAPW8tWG8rvjA5vqLkfppdNgIlilvXpQSXw/EepfB8Z4J16nOQanba0KVqBw1dUs8pAUcUdF6fUEvrUkt3b8bCEdJnKLanQ3wL3CfLfw2387uWB7EVSYfHfAfTbL4W7qtNbzeRUXvooq8BUDQ1JqK0Q3YIj8t28yFzbIf0ySWS9A9ha6zhoLrkgOMg6fNaNvnvn1JkzzZqc3l9pOCws/2QCGd9yTdjrXmvuBjGP0EFo6ysO7oOMAIAlfmqy6QZt3qHWaZBuFQvUvCIZzA== 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=JFvRO1eqju0q9f/3yvXwgCXJOJsvP2UuxMKN9Fhvuh4=; b=D2yEsDJbERp8HZlNITcKTkKEVESqp0uO2UV2Ya6ROmfRrQXRXIulvyRVvy2C1YMP0VVmJvhO0Yk30keMGfkkezVvrLD5P/D1g8P5eOF4F3IDu2WnMM+fZy3bGpP5zlPlEQ61X0nezPzUTzKuMCHYx9HtP/jFQm8yH7M+RM20a4Y= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MWHPR1101MB2158.namprd11.prod.outlook.com (2603:10b6:301:59::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Thu, 16 Sep 2021 21:04:12 +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:04:12 +0000 From: "Nate DeSimone" To: "devel@edk2.groups.io" , "Oram, Isaac W" 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: AQHXpQXv2ddeeBnXSkaMkaCzsJBY+6unMqRA Date: Thu, 16 Sep 2021 21:04:12 +0000 Message-ID: References: <16A2F95AA1BC0B2E.31307@groups.io> In-Reply-To: <16A2F95AA1BC0B2E.31307@groups.io> 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: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 60056ebc-39c4-42e6-a193-08d9795588b6 x-ms-traffictypediagnostic: MWHPR1101MB2158: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NbnKeo0Wa4VGPgQaa+7acNp5mxKcjvGgShXMgo1UgBHsapqRUE/zwk6NOXKb1KywotIkmdb6Iub2YAc2usXR7mcIKijLCdYSR9xgG3dqGgjKpFadOKOsZ6BqrLEDuTAzEEnYgL3HVqRZM6AT4MhwHkE82Q+cS7bEfy5U3b7IMh9Da8LY6Qoy8k8D6c+t4BFEdpN85OPL2tZFpaT17g1WHtTeyOfv6XOkbh0if4PNDkV6Ig8vZVKwOsupUWlyhNvzXFKplUSW79eYKlT+Wqp18DveMCdxLBKBb0VkVYiuNLlKFVl3tlAi1ET5Ky15HQ3G/1LOu60/Zc1jq7ZFAbXe7xUkgfpVkdYJAJLngT1mBKpg8vkt5uGJcWyIPaPAZV8XgXTYPcPDaIZ5F38lsUMApWm2b5XeJENp860iNtKORfScxUKtjcFtnu2B4vpfKKDExRTjKTNF/usZaZMXM+rUVg+Y7uGQxHunj8gEPl4JGvlllqLE5T4U3ZbMDgX2vWbjowTKxlJgP8Befi4VQQMC+ILUfj7gpuJYxcjU8O/Gfu4L2VWh8lLAZhaw/Ll/y+rQzWoS0WapR4WqK1rkAPdBm4E588yMpJzrgY1oKvF5lgzNJ8ttZVghFy/elVrAzNdcGz9JwnQW8WKDHn/DYHDPrS0KdoQpdL262tVeichJ8p4ilPf8GYxIkyxpeQNy9H2FlERTNyHp/3/14ehVoy2iH0f1vPTGpwcHTAVl4rltHw93bgfAL3sy06siGY7A5jFGzUBqcw55gXd97Yf+YDOM8QTdQeE0ASbQnQ4r5BkE5PW5HX3fQ5EJ6I1YWzPjmaOjoLEsAr4r1+wqGGbNc25xNg== 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)(346002)(136003)(376002)(366004)(396003)(39860400002)(33656002)(7696005)(26005)(8676002)(2906002)(4326008)(52536014)(478600001)(107886003)(83380400001)(38070700005)(66946007)(66476007)(76116006)(66446008)(122000001)(64756008)(9686003)(53546011)(66556008)(186003)(8936002)(6636002)(6506007)(966005)(86362001)(71200400001)(316002)(110136005)(55016002)(54906003)(5660300002)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WLdbRgZtQPwSXBUW4U+08mOf8eK0Z+PtQGxyBZ9lO/bJUXktG0kkQMon9SZT?= =?us-ascii?Q?2b0y3AM8RgNxGzic8pWnIgF0wElkdjhNS/s4pqEulAjTebIYQt946ATCnue+?= =?us-ascii?Q?7RrBZDhzeyXgQahQxRsFXJcuL+8bsOJYpT0wBYwhu5Z5HiDPx9QTJA+c5VXh?= =?us-ascii?Q?1yO035F2cMjMFuIRe/71iZQAhkWdUb/ynk/3u6GAfqq6bLTRK9Dwhnf0lcrx?= =?us-ascii?Q?GLY6H27x9fzythIHEBhHOUmYY6wVC7Fe4dTS7kOvchDW72jhN6ZQy96gwQHA?= =?us-ascii?Q?XbfwWShrgJP/Fz6AL+Tgy6c8DQELxGl8LBkRrZF1Iayt9oesAldw7tFRyBAV?= =?us-ascii?Q?+mG16HNmdAuKCXs5Ch+bKOf1a9UKJErnbha+YDM+ZP7FA8lyhodstwpiRGO/?= =?us-ascii?Q?A+3c4UnDADgpeTMB8P9+b2ZMQ+Kr6bD1aAgtfOuazowGerqitLWgmAT1Xmys?= =?us-ascii?Q?ye3g1KphKZal3yaDVDUNA7W3K2upSg/Wg+A5e99z1bELqHVg7AAYBtAnyEIl?= =?us-ascii?Q?d/Wrv8UFXnblWO5HB4svjn599Jm22DcoBCmxVKGHlwUgBlrt4Ji+mwrg0L/r?= =?us-ascii?Q?4ab+IfGs3bnHFZD35dSACd1vS4PNnmjZmWYefTssygB5B/FGWp3sbo61Scv4?= =?us-ascii?Q?PrVIic+Y7h0WkWJBdZVFDngl7DY3QAX4LPJ9sPYV0ylbl5xW2mXlF4PuUwSh?= =?us-ascii?Q?/xrIF6ZWjqxblWQuCuGvdGwuc+SB110QQDgPsqDcu2iLhjMEjN20X3QTcUyS?= =?us-ascii?Q?E+WZ496hvSfRf7The517JhgOCBGwYSNQZ+5Emn6b8VT29rxxBJtzelVCV3a6?= =?us-ascii?Q?mCGeJYbAYGJXwIEN89as4zEx/BLnU3+Df0pKdlej1f41ANUqnlKAv6weUnFT?= =?us-ascii?Q?ftJLvZm+iBZOPsU6GXS0DARfIPYKrEVPHSvuplkl772R226kaZpC1rqwTUPI?= =?us-ascii?Q?yso3a0e/s53rjeHaMo9eCo8Y9mpIuBh5hEf/ErWlC6SXT8Ig0WxxiQXRJcva?= =?us-ascii?Q?Y4lk5Wx5r8evGtm+JAhWGrkbf4lo8ihBIMSAjm2PvYpL5/WPZahNWwQyd1rt?= =?us-ascii?Q?VO3bZDVVAPsLmvo7rvO1dZLPmaMzhPeDUi5egtPuI6PYEsE4cH3dQRyaNlwm?= =?us-ascii?Q?7Jm4ebXroA+fJQ2YWHJ+qdZqnG6Rf5DwwyX7a2KmhuGqjBAU5J/pacNyX7JI?= =?us-ascii?Q?VYEtgm4P2lrZFMPK9IWAZbnDRecjk9xhfiukHxnnGMVXiDH2lkSjOVSfnDW0?= =?us-ascii?Q?vpjE7/MgUy6HTrnDUuedXAHbdvVaXy+eumUviNDqTbMAKhdBATGbq+uV4jGM?= =?us-ascii?Q?d6x015F7DzsBq+vKk2mskVA/?= 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: 60056ebc-39c4-42e6-a193-08d9795588b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2021 21:04:12.1647 (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: vDXbeE69vxd6m1F6CE9am4TVst4T1UUrMYu1eynGjA6HCjUMSFDhxhazWadMCNH9GdHQambJRrB+dZdv+2RyB/fw3876OW0NGEhy8zXAB9A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2158 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 Reviewed-by: Nate DeSimone -----Original Message----- From: devel@edk2.groups.io On Behalf Of Oram, Isaac = W 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