From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.495.1588215429934850024 for ; Wed, 29 Apr 2020 19:57:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=XnLHdteT; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: chasel.chiu@intel.com) IronPort-SDR: KPZfZqTwVHfCgNxcIzVM6SChZpgBYafHIv8T5n5qSVwbjEc4ky46nDDNi/YFeVS26LQq1xcLc5 Ni7Hzq8sPjOQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 19:57:08 -0700 IronPort-SDR: fh5vrWGBWuj7ipTQ6MTAvy0qvHC2kABJ8ZNoIgF1wPR2CAvyCpwSSuWmajClfDjFPpy5JZ4JQv hTDudrt9dpmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,333,1583222400"; d="scan'208";a="293413188" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 29 Apr 2020 19:57:08 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 19:57:08 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 19:57:08 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 19:56:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=en4+1xI4aSmAnr/Ia61Fuc3JCHSDghByhOQB6xoKxjByz1yFCixZMunLAfDYQrAOk1YstnAqk/HFjKKqQ+sJesUya4W4cMI3RT5VL6/3x05TaxWRAkIOiF/39QCcLUhpz74mFLwkjkf1+6bNRnmJTYFFDAolqr5cBzSyOKYa7Jw9hF5UQp9sqc+KLOoYAjVLcD4+nLVvF/fqUq0rTVdTiL03VLoXba9nqR3DDLtgRLCbN/ebbNFvh3omllQP9y6FwoNbMvOFj9M2s2psMYHE3kLCwdK+caOJpCZXIn4nptM6SEWQCt78JOSPo++xhDFTw5PXD5e5cnR/NkrHJagxfg== 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:X-MS-Exchange-SenderADCheck; bh=I3rhLtLvf3O1jW+knW51VeG7aVVcsCb5prN3IULysUE=; b=VNJb0h/H9lkkQgZ8LX4yCQh1EbU9qraaWkH9OXKkkpQtnE+kyMleFhp17TL7xWGkfiwuhduLG/ZM9KdfVpUU09mRQ5zjyCY1lBWBDM7McytZ7sluEPQd8tO3NcRCjaRTwpyO5DT82/t0CEnPXI27/MlJkC4NUaMO/8rqrXK4KEbDrGVU/ElKJqaOf5M2rvzdSYnLtx82+F0JvbPhSR+Q9keW2ssR6C3Z+/v7fNWUY6P24jBpzCEljBKV29cYWXWABseCCbcOEAqhMCl/ACHy8LHIfAdu/ihmAMrpmJkTt8ZiyGJMKbLf+ASwDIJ2BnGNWyafwAjfEgpPmIjsS4NFNQ== 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=I3rhLtLvf3O1jW+knW51VeG7aVVcsCb5prN3IULysUE=; b=XnLHdteTH3bv338lftBjeDip1LM+fTE6ljnJ0LACM4iyZoOBHTJxpFwlIioE9HU3R2p4IFv2AHRSbIKwyXAs9pWH8DGYzSLaCzHPYt0hZarl2PJkF6LOoGv0mPAZoLdg+Lq7ehdilhZ192SjwhhJaxlDltTHsgsugrmUM873x8U= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SN6PR11MB3053.namprd11.prod.outlook.com (2603:10b6:805:d9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Thu, 30 Apr 2020 02:56:36 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::152f:df2:6370:1584]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::152f:df2:6370:1584%4]) with mapi id 15.20.2937.023; Thu, 30 Apr 2020 02:56:36 +0000 From: "Chiu, Chasel" To: "Shindo, Miki" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Desimone, Nathaniel L" , "Agyeman, Prince" , "Ni, Ray" Subject: Re: [edk2-platforms:PATCH v4 5/7] KabylakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Topic: [edk2-platforms:PATCH v4 5/7] KabylakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Index: AQHWHc5+OKGwAVz2xkyUJJnZ76oIy6iQ+kdQ Date: Thu, 30 Apr 2020 02:56:36 +0000 Message-ID: References: <20200429023203.37544-1-miki.shindo@intel.com> <20200429023203.37544-6-miki.shindo@intel.com> In-Reply-To: <20200429023203.37544-6-miki.shindo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.193] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5750f7e8-31d9-4c80-4500-08d7ecb21946 x-ms-traffictypediagnostic: SN6PR11MB3053: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-forefront-prvs: 0389EDA07F x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(346002)(136003)(396003)(366004)(376002)(478600001)(26005)(5660300002)(33656002)(186003)(107886003)(71200400001)(8676002)(6506007)(76116006)(966005)(2906002)(54906003)(66946007)(55016002)(53546011)(316002)(110136005)(66476007)(66556008)(8936002)(9686003)(66446008)(86362001)(64756008)(52536014)(7696005)(30864003)(4326008)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y+A697YL/i7hlu+VuI1ZdjZ1GOpWUj5natLkOq+qATKJsY4gJdWP1DhIAs+di1pnIok7U74FIKLPCuhsR1VCsmNwob6O/222vSlRVNRHaTncpfooPe3WoWd8kZbop2hzAgAE+w8Kx+OasdHsUVyUSDHvfKfGCz4HhKBDvVjJenslZ0snvYqFiEu1yFoARwSLeAILqWdLw9WHfR9qMdrJPpgbdBPcWvV6U2Xu4huxAekge00k4FnORC2PF3GPNj/E7khdAld0mT/uTFXM5zPDzKCaENa1kfhX/SMtC4KnVHZg9ktOeXMXDpoRfXhPjG6oIVWcHMI2uVohqE5+EIV9zWj28XkLKuSKMF02UK87Tr22PUOdIBIBrA5kQLu0rjv3RGQsRMK/Fv8jRjYuY+H/GIWfG6+ZrjYnZZnc+zG/bms0Tjsnv8sHIcna2UVd7/jwZ1PalBPQBkVHeBB67GccbE7h87d2ihvjJvN5wqMI8Vfw2shPXiY3Pbem06tJFKhijmHhIk4Irg01IQuErV9QjQ== x-ms-exchange-antispam-messagedata: b+r6q3sRKB/6QA0j9/pNi+XfmQSOE/dlRP0Ee8e8QiF+SF0rgP2lNmggfRnX2ZQvUyt8dK2mk0dNz4agOgCL3Gcr7Kf2fc+VrZugtJ0YVTVbUjAb9Q6uy9ZkOn/FGCtt3UHnLenHfcPlUBHj1/BExhVdHWiGINKqy58pjHYj/hntqDlHsyMgk8h+ldAENtMju3lWNntyL+6rnJTFq1UF5Y6zluulHfZ8riPeiU3YnV58LA7+TAKzqP4wTsCkKGfvYUb/Ua5FmvXDtHr3IyywjnRRuyvfoEGTSj9btLQjjQ39IL0QHCGygLw4oCe+7k1B97yyKG7vX4QzWNtve6x8tr1M6U+USXBdSsmEOtoCmaPUuIOIlfwztoh8W3mozKqRZg+OHt/FirjVVK79O7o91OlvMirOCpbmhLCd+bO/+q+y93zXPZqmwHOTlj1WCtl2VteYzH1d2JvKlH+TYHU/FANsBsfxhRathvoZnjAFYWEMjoXp9jkCkcs0LN0sUADyZUFYgoRVIoZqhqCYvFr3l1effn9ZgEvA8NTqyvYZx7ZRNPSJOEjd+OFvEoXWRrdKeuHyGbUpy524OWlOGcEG/lwRuRCoIrhtc4QtsQkf9TRZYTXCCPcm7vW/uTe2paQktkknVCCiy7SrsRmxVsPRA7Ku6SNsucHVYkdJEp/mXSMemMYhdCGsDj3AFGplH14f96fJP2lhiAN9t3tQurvRR5yswxpPKj9DCnpTytMXRUYAlWjSrMQQgd5KDtWgJAC9MzqzX1uxzxYAES3NhJjqJ0g1gR+6UUSbb7ht967WSkaWDW3aN9IlxG3ZE+LPS53e MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5750f7e8-31d9-4c80-4500-08d7ecb21946 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 02:56:36.7234 (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: b4VDnJDnPkKWXKUrNss5Ld0eSY+IW3y7lX5o1STwokV6cNknD29AILi/TWgmHm0eaBXliZUZLasOeTo/Jx21fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3053 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: Shindo, Miki > Sent: Wednesday, April 29, 2020 10:32 AM > To: devel@edk2.groups.io > Cc: Chaganty, Rangasai V ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Agyeman, Prince > ; Ni, Ray > Subject: [edk2-platforms:PATCH v4 5/7] KabylakeSiliconPkg/DxeAslUpdateLib= : > Cleans up APIs >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2536 >=20 > Callers of DxeAslUpdateLib don't have to call InitializeAslUpdateLib() bu= t the > library itself runs it internally. This commit deletes the redundant call= s in > caller side and makes it an internal call. > LocateAcpiTableByOemTableId() is unreferenced externally so this commit > makes it an internal call. > PSS_PACKAGE_LAYOUT and AML_RESRC_TEMP_END_TAG are both > unreferenced so they are removed. > AslUpdateLib.h is cleaned up accordingly. >=20 > Signed-off-by: Miki Shindo > Cc: Sai Chaganty > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Prince Agyeman > Cc: Ray Ni > --- >=20 > Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.= c > | 207 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++++++++++++++++++++--------------------------------= ------ > ---------------------------------------------------------------- >=20 > Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpdate= L > ibNull.c | 94 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- > --------------------------- > Silicon/Intel/KabylakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > | 5 +---- > Silicon/Intel/KabylakeSiliconPkg/Include/Library/AslUpdateLib.h > | 130 > ++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- > ---------------------------------------------------------- > 4 files changed, 217 insertions(+), 219 deletions(-) >=20 > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLi= b > .c > b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLi= b > .c > index 87c6b15ed2..abdb85307f 100644 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLi= b > .c > +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpd > +++ ateLib.c > @@ -6,7 +6,7 @@ >=20 > This library uses the ACPI Support protocol. >=20 > -Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
> +Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -50,6 +50,62 @@ InitializeAslUpdateLib ( > return Status; > } >=20 > +/** > + This function uses the ACPI SDT protocol to locate an ACPI SSDT table. > + > + @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > + will consider it a match if the first > TableIdSize bytes match > + @param[in, out] Table - Updated with a pointer to the table > + @param[in, out] Handle - AcpiSupport protocol table handle for > the table found > + > + @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_NOT_FOUND - Failed to locate AcpiTable. > + @retval EFI_NOT_READY - Not ready to locate AcpiTable. > +**/ > +EFI_STATUS > +LocateAcpiTableByOemTableId ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > + IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > + IN OUT UINTN *Handle > + ) > +{ > + EFI_STATUS Status; > + INTN Index; > + EFI_ACPI_TABLE_VERSION Version; > + EFI_ACPI_DESCRIPTION_HEADER *OrgTable; > + > + if (mAcpiSdt =3D=3D NULL) { > + InitializeAslUpdateLib (); > + if (mAcpiSdt =3D=3D NULL) { > + return EFI_NOT_READY; > + } > + } > + /// > + /// Locate table with matching ID > + /// > + Version =3D 0; > + Index =3D 0; > + do { > + Status =3D mAcpiSdt->GetAcpiTable (Index, (EFI_ACPI_SDT_HEADER > **)&OrgTable, &Version, Handle); > + if (Status =3D=3D EFI_NOT_FOUND) { > + break; > + } > + ASSERT_EFI_ERROR (Status); > + Index++; > + } while (CompareMem (&(OrgTable->OemTableId), TableId, TableIdSize)); > + > + if (Status !=3D EFI_NOT_FOUND) { > + *Table =3D AllocateCopyPool (OrgTable->Length, OrgTable); > + ASSERT (*Table); > + } > + > + /// > + /// If we found the table, there will be no error. > + /// > + return Status; > +} >=20 > /** > This procedure will update immediate value assigned to a Name @@ > -60,8 +116,10 @@ InitializeAslUpdateLib ( >=20 > @retval EFI_SUCCESS - The function completed successfully. > @retval EFI_NOT_FOUND - Failed to locate AcpiTable. > + @retval EFI_NOT_READY - Not ready to locate AcpiTable. > **/ > EFI_STATUS > +EFIAPI > UpdateNameAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > @@ -155,79 +213,67 @@ UpdateNameAslCode ( > return EFI_NOT_FOUND; > } >=20 > - > /** > - This function uses the ACPI SDT protocol to locate an ACPI table. > - It is really only useful for finding tables that only have a single in= stance, > - e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT, etc. > + This procedure will update the name of ASL Method >=20 > - @param[in] Signature - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > - @param[in, out] Table - Updated with a pointer to the table > - @param[in, out] Handle - AcpiSupport protocol table handle > for the table found > - @param[in, out] Version - The version of the table desired > + @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in] TableIdSize - Length of the TableId to match. Table I= D > are 8 bytes long, this function > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten >=20 > - @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_UNSUPPORTED The function is not supported in > this library. > **/ > EFI_STATUS > -LocateAcpiTableBySignature ( > - IN UINT32 Signature, > - IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > - IN OUT UINTN *Handle > +EFIAPI > +UpdateSsdtNameAslCode ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > ) > { > - EFI_STATUS Status; > - INTN Index; > - EFI_ACPI_TABLE_VERSION Version; > - EFI_ACPI_DESCRIPTION_HEADER *OrgTable; > - > - if (mAcpiSdt =3D=3D NULL) { > - InitializeAslUpdateLib (); > - if (mAcpiSdt =3D=3D NULL) { > - return EFI_NOT_READY; > - } > - } > + return EFI_UNSUPPORTED; > +} >=20 > - /// > - /// Locate table with matching ID > - /// > - Version =3D 0; > - Index =3D 0; > - do { > - Status =3D mAcpiSdt->GetAcpiTable (Index, (EFI_ACPI_SDT_HEADER > **)&OrgTable, &Version, Handle); > - if (Status =3D=3D EFI_NOT_FOUND) { > - break; > - } > - ASSERT_EFI_ERROR (Status); > - Index++; > - } while (OrgTable->Signature !=3D Signature); > +/** > + This procedure will update the name of ASL Method >=20 > - if (Status !=3D EFI_NOT_FOUND) { > - *Table =3D AllocateCopyPool (OrgTable->Length, OrgTable); > - ASSERT (*Table); > - } > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten >=20 > - /// > - /// If we found the table, there will be no error. > - /// > - return Status; > + @retval EFI_UNSUPPORTED The function is not supported in > this library. > +**/ > +EFI_STATUS > +EFIAPI > +UpdateMethodAslCode ( > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > + ) > +{ > + return EFI_UNSUPPORTED; > } >=20 > /** > - This function uses the ACPI SDT protocol to locate an ACPI SSDT table. > + This function uses the ACPI SDT protocol to locate an ACPI table. > + It is really only useful for finding tables that only have a single > + instance, e.g. FADT, FACS, MADT, etc. It is not good for locating SSD= T, > etc. >=20 > - @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > - @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > - will consider it a match if the first > TableIdSize bytes match > - @param[in, out] Table - Updated with a pointer to the table > - @param[in, out] Handle - AcpiSupport protocol table handle for > the table found > - @param[in, out] Version - See AcpiSupport protocol, GetAcpiTable > function for use > + @param[in] Signature - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in, out] Table - Updated with a pointer to the table > + @param[in, out] Handle - AcpiSupport protocol table handle > for the table found >=20 > - @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_SUCCESS - The function completed > successfully. > + @retval EFI_NOT_FOUND - Failed to locate AcpiTable. > + @retval EFI_NOT_READY - Not ready to locate AcpiTable. > **/ > EFI_STATUS > -LocateAcpiTableByOemTableId ( > - IN UINT8 *TableId, > - IN UINT8 TableIdSize, > +EFIAPI > +LocateAcpiTableBySignature ( > + IN UINT32 Signature, > IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > IN OUT UINTN *Handle > ) > @@ -243,6 +289,7 @@ LocateAcpiTableByOemTableId ( > return EFI_NOT_READY; > } > } > + > /// > /// Locate table with matching ID > /// > @@ -255,7 +302,7 @@ LocateAcpiTableByOemTableId ( > } > ASSERT_EFI_ERROR (Status); > Index++; > - } while (CompareMem (&(OrgTable->OemTableId), TableId, TableIdSize)); > + } while (OrgTable->Signature !=3D Signature); >=20 > if (Status !=3D EFI_NOT_FOUND) { > *Table =3D AllocateCopyPool (OrgTable->Length, OrgTable); @@ -268,47 > +315,3 @@ LocateAcpiTableByOemTableId ( > return Status; > } >=20 > -/** > - This function calculates and updates an UINT8 checksum. > - > - @param[in] Buffer Pointer to buffer to checksum > - @param[in] Size Number of bytes to checksum > - @param[in] ChecksumOffset Offset to place the checksum result in > - > - @retval EFI_SUCCESS The function completed successfully. > -**/ > -EFI_STATUS > -AcpiChecksum ( > - IN VOID *Buffer, > - IN UINTN Size, > - IN UINTN ChecksumOffset > - ) > -{ > - UINT8 Sum; > - UINT8 *Ptr; > - > - Sum =3D 0; > - /// > - /// Initialize pointer > - /// > - Ptr =3D Buffer; > - > - /// > - /// set checksum to 0 first > - /// > - Ptr[ChecksumOffset] =3D 0; > - > - /// > - /// add all content of buffer > - /// > - while (Size--) { > - Sum =3D (UINT8) (Sum + (*Ptr++)); > - } > - /// > - /// set checksum > - /// > - Ptr =3D Buffer; > - Ptr[ChecksumOffset] =3D (UINT8) (0xff - Sum + 1); > - > - return EFI_SUCCESS; > -} > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpda= t > eLibNull.c > b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpda= t > eLibNull.c > index 490a09ddb5..395ff16596 100644 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpda= t > eLibNull.c > +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAs > +++ lUpdateLibNull.c > @@ -6,7 +6,7 @@ >=20 > This library uses the ACPI Support protocol. >=20 > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -39,6 +39,27 @@ InitializeAslUpdateLib ( > return EFI_SUCCESS; > } >=20 > +/** > + This function uses the ACPI SDT protocol to locate an ACPI SSDT table. > + > + @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > + will consider it a match if the first > TableIdSize bytes match > + @param[in, out] Table - Updated with a pointer to the table > + @param[in, out] Handle - AcpiSupport protocol table handle for > the table found > + > + @retval EFI_SUCCESS - The function completed successfully. > +**/ > +EFI_STATUS > +LocateAcpiTableByOemTableId ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > + IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > + IN OUT UINTN *Handle > + ) > +{ > + return EFI_SUCCESS; > +} >=20 > /** > This procedure will update immediate value assigned to a Name @@ > -50,6 +71,7 @@ InitializeAslUpdateLib ( > @retval EFI_SUCCESS - The function completed successfully. > **/ > EFI_STATUS > +EFIAPI > UpdateNameAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > @@ -59,66 +81,68 @@ UpdateNameAslCode ( > return EFI_SUCCESS; > } >=20 > - > /** > - This function uses the ACPI SDT protocol to locate an ACPI table. > - It is really only useful for finding tables that only have a single in= stance, > - e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT, etc. > + This procedure will update the name of ASL Method >=20 > - @param[in] Signature - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > - @param[in, out] Table - Updated with a pointer to the table > - @param[in, out] Handle - AcpiSupport protocol table handle > for the table found > - @param[in, out] Version - The version of the table desired > + @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten >=20 > - @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_SUCCESS - The function completed successfully. > **/ > EFI_STATUS > -LocateAcpiTableBySignature ( > - IN UINT32 Signature, > - IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > - IN OUT UINTN *Handle > +EFIAPI > +UpdateSsdtNameAslCode ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > ) > { > return EFI_SUCCESS; > } >=20 > /** > - This function uses the ACPI SDT protocol to locate an ACPI SSDT table. > + This procedure will update the name of ASL Method >=20 > - @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > - @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > - will consider it a match if the first > TableIdSize bytes match > - @param[in, out] Table - Updated with a pointer to the table > - @param[in, out] Handle - AcpiSupport protocol table handle for > the table found > - @param[in, out] Version - See AcpiSupport protocol, GetAcpiTable > function for use > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten >=20 > @retval EFI_SUCCESS - The function completed successfully. > **/ > EFI_STATUS > -LocateAcpiTableByOemTableId ( > - IN UINT8 *TableId, > - IN UINT8 TableIdSize, > - IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > - IN OUT UINTN *Handle > +EFIAPI > +UpdateMethodAslCode ( > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > ) > { > return EFI_SUCCESS; > } >=20 > + > /** > - This function calculates and updates an UINT8 checksum. > + This function uses the ACPI SDT protocol to locate an ACPI table. > + It is really only useful for finding tables that only have a single > + instance, e.g. FADT, FACS, MADT, etc. It is not good for locating SSD= T, > etc. >=20 > - @param[in] Buffer Pointer to buffer to checksum > - @param[in] Size Number of bytes to checksum > - @param[in] ChecksumOffset Offset to place the checksum result in > + @param[in] Signature - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in, out] Table - Updated with a pointer to the table > + @param[in, out] Handle - AcpiSupport protocol table handle > for the table found >=20 > - @retval EFI_SUCCESS The function completed successfully. > + @retval EFI_SUCCESS - The function completed > successfully. > **/ > EFI_STATUS > -AcpiChecksum ( > - IN VOID *Buffer, > - IN UINTN Size, > - IN UINTN ChecksumOffset > +EFIAPI > +LocateAcpiTableBySignature ( > + IN UINT32 Signature, > + IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > + IN OUT UINTN *Handle > ) > { > return EFI_SUCCESS; > diff --git a/Silicon/Intel/KabylakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > b/Silicon/Intel/KabylakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > index a0e3996664..6cbaf9c067 100644 > --- a/Silicon/Intel/KabylakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > +++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > @@ -1,7 +1,7 @@ > /** @file > This is the driver that initializes the Intel PCH. >=20 > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -443,9 +443,6 @@ PatchPchNvsAreaAddress ( > UINT32 Address; > UINT16 Length; >=20 > - Status =3D InitializeAslUpdateLib (); > - ASSERT_EFI_ERROR (Status); > - > Address =3D (UINT32) (UINTN) mPchNvsAreaProtocol.Area; > Length =3D (UINT16) sizeof (PCH_NVS_AREA); > DEBUG ((DEBUG_INFO, "PatchPchNvsAreaAddress: PCH NVS Address %x > Length %x\n", Address, Length)); diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Include/Library/AslUpdateLib.h > b/Silicon/Intel/KabylakeSiliconPkg/Include/Library/AslUpdateLib.h > index d58b6d6458..215ca85a29 100644 > --- a/Silicon/Intel/KabylakeSiliconPkg/Include/Library/AslUpdateLib.h > +++ b/Silicon/Intel/KabylakeSiliconPkg/Include/Library/AslUpdateLib.h > @@ -5,7 +5,7 @@ > Make sure you meet the requirements for the library (protocol > dependencies, use > restrictions, etc). >=20 > -Copyright (c) 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -16,61 +16,71 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // // > Include files // > +#include > #include > #include > #include >=20 > -// > -// AML parsing definitions > -// > -#define AML_RESRC_TEMP_END_TAG 0x0079 > - > -// > -// ASL PSS package structure layout > -// > -#pragma pack (1) > -typedef struct { > - UINT8 NameOp; // 12h ;First opcode is a NameOp. > - UINT8 PackageLead; // 20h ;First opcode is a NameOp. > - UINT8 NumEntries; // 06h ;First opcode is a NameOp. > - UINT8 DwordPrefix1; // 0Ch > - UINT32 CoreFrequency; // 00h > - UINT8 DwordPrefix2; // 0Ch > - UINT32 Power; // 00h > - UINT8 DwordPrefix3; // 0Ch > - UINT32 TransLatency; // 00h > - UINT8 DwordPrefix4; // 0Ch > - UINT32 BmLatency; // 00h > - UINT8 DwordPrefix5; // 0Ch > - UINT32 Control; // 00h > - UINT8 DwordPrefix6; // 0Ch > - UINT32 Status; // 00h > -} PSS_PACKAGE_LAYOUT; > -#pragma pack() >=20 > /** > - Initialize the ASL update library state. > - This must be called prior to invoking other library functions. > + This procedure will update immediate value assigned to a Name >=20 > + @param[in] AslSignature The signature of Operation > Region that we want to update. > + @param[in] Buffer source of data to be written > over original aml > + @param[in] Length length of data to be > overwritten >=20 > @retval EFI_SUCCESS The function completed > successfully. > + @retval EFI_NOT_FOUND Failed to locate AcpiTable. > + @retval EFI_NOT_READY Not ready to locate > AcpiTable. > + @retval EFI_UNSUPPORTED The function is not > supported in this library. > **/ > EFI_STATUS > -InitializeAslUpdateLib ( > - VOID > +EFIAPI > +UpdateNameAslCode ( > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > ); >=20 > /** > - This procedure will update immediate value assigned to a Name > + This procedure will update the name of ASL Method > + > + @param[in] TableId - Pointer to an ASCII string containing > the OEM Table ID from the ACPI table header > + @param[in] TableIdSize - Length of the TableId to match. Table > ID are 8 bytes long, this function > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten > + > + @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_NOT_FOUND - Failed to locate AcpiTable. > + @retval EFI_NOT_READY - Not ready to locate AcpiTable. > + @retval EFI_UNSUPPORTED - The function is not supported in this > library. > +**/ > +EFI_STATUS > +EFIAPI > +UpdateSsdtNameAslCode ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > + IN UINT32 AslSignature, > + IN VOID *Buffer, > + IN UINTN Length > + ); >=20 > - @param[in] AslSignature The signature of Operation > Region that we want to update. > - @param[in] Buffer source of data to be written > over original aml > - @param[in] Length length of data to be > overwritten > +/** > + This procedure will update the name of ASL Method >=20 > - @retval EFI_SUCCESS The function completed > successfully. > + @param[in] AslSignature - The signature of Operation Region that > we want to update. > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten > + > + @retval EFI_SUCCESS - The function completed successfully. > + @retval EFI_NOT_FOUND - Failed to locate AcpiTable. > + @retval EFI_NOT_READY - Not ready to locate AcpiTable. > + @retval EFI_UNSUPPORTED - The function is not supported in this > library. > **/ > EFI_STATUS > -UpdateNameAslCode( > +EFIAPI > +UpdateMethodAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > IN UINTN Length > @@ -86,55 +96,19 @@ UpdateNameAslCode( > @param[in] Signature Pointer to an ASCII string > containing the Signature to match > @param[in, out] Table Updated with a pointer to the > table > @param[in, out] Handle AcpiSupport protocol table > handle for the table found > - @param[in, out] Version On input, the version of the > table desired, > - on output, the versions the > table belongs to > @see AcpiSupport protocol > for details >=20 > @retval EFI_SUCCESS The function completed > successfully. > + @retval EFI_NOT_FOUND Failed to locate AcpiTable. > + @retval EFI_NOT_READY Not ready to locate > AcpiTable. > + @retval EFI_UNSUPPORTED The function is not > supported in this library.s > **/ > EFI_STATUS > +EFIAPI > LocateAcpiTableBySignature ( > IN UINT32 Signature, > IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > IN OUT UINTN *Handle > ); >=20 > -/** > - This function uses the ACPI support protocol to locate an ACPI SSDT ta= ble. > - The table is located by searching for a matching OEM Table ID field. > - Partial match searches are supported via the TableIdSize parameter. > - > - @param[in] TableId Pointer to an ASCII string > containing the OEM Table ID from the ACPI table header > - @param[in] TableIdSize Length of the TableId to match. > Table ID are 8 bytes long, this function > - will consider it a match if > the first TableIdSize bytes match > - @param[in, out] Table Updated with a pointer to the > table > - @param[in, out] Handle AcpiSupport protocol table > handle for the table found > - @param[in, out] Version See AcpiSupport protocol, > GetAcpiTable function for use > - > - @retval EFI_SUCCESS The function completed > successfully. > -**/ > -EFI_STATUS > -LocateAcpiTableByOemTableId ( > - IN UINT8 *TableId, > - IN UINT8 TableIdSize, > - IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > - IN OUT UINTN *Handle > - ); > - > -/** > - This function calculates and updates an UINT8 checksum. > - > - @param[in] Buffer Pointer to buffer to checksum > - @param[in] Size Number of bytes to checksum > - @param[in] ChecksumOffset Offset to place the checksum > result in > - > - @retval EFI_SUCCESS The function completed > successfully. > -**/ > -EFI_STATUS > -AcpiChecksum ( > - IN VOID *Buffer, > - IN UINTN Size, > - IN UINTN ChecksumOffset > - ); > - > #endif > -- > 2.16.2.windows.1