From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com []) by mx.groups.io with SMTP id smtpd.web11.471.1588215457962842330 for ; Wed, 29 Apr 2020 19:57:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZTh7EmEZ; spf=fail (domain: intel.com, ip: , mailfrom: chasel.chiu@intel.com) IronPort-SDR: /hP0TlO/9cJhP5zr9RQ5cBXqnCVbABNMxXyXd49N4uhjGytrvTuprmpSGTgq/J3ymGQq2528eD ZtVZ6yxv/x0w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 19:57:38 -0700 IronPort-SDR: lWdrl64vKZ5LE2BzjOkOOl/NtwnDJqm7u0g4mJy3JKZR/F7L18ss1NCTC2akU2G5egu//zcABv xl4Wr8djvUaw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,333,1583222400"; d="scan'208";a="258155507" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 29 Apr 2020 19:57:38 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 19:57:37 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 19:57:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5637KSC/ANDwfbuBPQ+AsS8Bavv7NN1oWF9ddj89e/rYTWzEnZafm6WHycM46f/Nlqh4sNNt69idxk7oCvDSUi2cvi3rQhbn9T6iOuBY2YlR9GDYPiHrN3hzWe8xax2CarsrNj3xlHpRPK93TJxS9SH86+VPo4C+Nsg6wcoJokq+uj6hVH+qWmMb2MbsqsIEqHnC/xruO/yrEs15IE88Qu5GqyIm8boULwo4umJuVUWbR2J5rLh0ZrbxQCmV8fe1Tqqv3GXWZZDqko53/b1LjALrjC3ukp6I8cScp3U5jTiqq8LAVf3m/AkEWIQrkw6AhOJR6ytwtVs/61JXOAk6g== 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=e2w7eO6y/O/0y98pzb7RDTqj9Ar+1LO+5wGnNg97swE=; b=FpL1gJaYxGRekL8ZywA5vUmTOs+ao0dihpMAnaW+OrgHS7hFOjs9XjXXjApf3aI/LAxNI8mxx6CaOjk36mZFGBMR2ZpMxM51PXspTsYmjMvm369vje9+cWRU6gRGG3XlpJAQYYW0Mi740jt2Dm7XiH0aS6xY8rt8T0f9sIJuPy37n4e8fVaj6ZzmYJYBfFEdNeNIkd+lGkBt4kwGFtG9eKfFG5fhGg2sd0NfUsvXDuLI3qwrRaOh1F58D5Ct5T+QifeR4Ra1bPqQVMrXHvJ0A0rvvOpLMLh7w0d1NxFF+cJCeqezO7vn3dJdX9ufZhFPudJmPwAvKeTMca3E9eA4mQ== 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=e2w7eO6y/O/0y98pzb7RDTqj9Ar+1LO+5wGnNg97swE=; b=ZTh7EmEZs2nbn3TOc5YsI3QPHgDxSd3V9ssqSV3Z+hEYPW1c2jSGa3GSkkODFmANHAJA7ocnDWx34NH0w7a1g7wiYo64jnnGggYUmT3lPd0Vd+JFrZa2VXb6moYVb//dE00c0V0gYLloKi87sw9lWMoaz3MqTUPtwb8+/F+53uA= 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:57:03 +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:57:03 +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 6/7] CoffeelakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Topic: [edk2-platforms:PATCH v4 6/7] CoffeelakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Index: AQHWHc6Cy3Dxtyjch0qQUzoHOwlmcaiQ+mcg Date: Thu, 30 Apr 2020 02:57:03 +0000 Message-ID: References: <20200429023203.37544-1-miki.shindo@intel.com> <20200429023203.37544-7-miki.shindo@intel.com> In-Reply-To: <20200429023203.37544-7-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: 34e956b4-a2bb-4a4a-9d2f-08d7ecb228fa 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: x5P/7fnn7G/vNk189kS2Pw0dwGheXb+wBtPQYCuyQrn1axml6jeMtOP+i0btJDhw2+z5i/gaRgTZYiEM1prcNRoAzXH/LpT3gLPOzoTLOzxxScoi1lsE5c6vTWP2dtx0gHa+qnHbGgSTS1Rn0GrGCEkFudF12xJhd1axipDhJmXzvGZ5gZyJPg+VfWn+SM2vd3/TaSz4jAHAGHtTAlzR5N7WMXVQAGnLG7zSv1wzYtDp/VjF/asbpA/NNVBahJjebG64XxRgIKdLesnG+oUtBZAuQIKc5YXMMaiR3imRR1RGeVfjpzhCJwg39VhF7AHKs8jpjEuz8g5RCYq6UJYg2KcJmLAt35qgVC/jdKUYHBkD7MUCosz13+9Z62K2DFYOKa6IcRanXR2Zk1Mf9MzkCxz7NE754C+ruDEOGgvZeQA9vOxj6UkmcAFrZlSkn8w8XMdZZb9MYq7+RchsKnEyfjZ0Hs0V9IzFaAIFQ35lGFlDuXjSSIxYXCRMjX5NnzIUFA0qyAx8LG166tdBzEfnAA== x-ms-exchange-antispam-messagedata: xXceRbdeHvBbWdN1yIWchWqlB5U89FTEYwCE16mJnLbSnkz4MlhR7ZaRdHgJ6Zewv526hutb//KYoaz8GgMBtxxPjv7AO736QsTwlf831SR7DHZWenb4KuI3VY/WKciOvheaY3Z7vdYwih+Pa+qfFTEqkMtJbDT80Bi8bMTnzIx1dUg5iPnmt3OtZGE7AsAPCDme0IM3zQuV6BWB1fAtLliyh5Z4z76S8yhXVgv31HQi7MgBL7sA+ywylrY6Fc2UhoYpvoY1Q+wC98QrS2KGhG6qkbcuQF238M8EXEYOX3ddyXuiJ0FaUJ+qamWhO5X1+pAfqac/+ii4RCanPE/JmVBXf/HHzRGeyTkXhNWrSMoXkkLPaHafQ9Yr+k8h6lG/tnNP3qdKTSdxS2VwoQtzyrT28leL6EUJKnCXtN3MXl8K9xQc5LrrQOc5T4BGy4nCDD2RoCBcAzodFcDwncxP4LRq9GUDlci7eTZEXljrD7zi4sNxy3iLeKX6jFDZSp9pGuXfxyFuudLiXXkn2cIq5coK2WUSrwApkvjGZuTL9LZut0wt7LpAjiZcjflWlkXlOG8FhFjiTdW4QuT68gSFwnZhTkblr8V4UtIZxIkP0uRURbnUlL/xSSQ47VuajcCZEVI+3NFGEAWWY29cGjPl7R2u3YSF7IcOzUou7lFR7YNP3u3SGltCJdlUJSo0RgGkTQvWpPpoKVr4S3YcvZraOem56tarHuq3tcZP+CDdJY3Xu/U6DuunFTbs6hw5AW5Z50dw94k3o9ROTBHGNZn5PoRsamQZXO/j1T4+T2+TA0XdDpt6P5HQQuYUPA5RWvwO MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 34e956b4-a2bb-4a4a-9d2f-08d7ecb228fa X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 02:57:03.0612 (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: i0oBw0CoeGnbl4u7Xzo+DW/+PiXudUSb1c7MQybwbNGqFJ29GvY8lg7Vi7AoBhstXi+ZQBlm1WCNV/rr0CbBtw== 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 6/7] > CoffeelakeSiliconPkg/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/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLi= b. > c | 190 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++++++++++++++++++++++--------------------------------------------------= ------------------ > ----------------------------------- >=20 > Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpda= t > eLibNull.c | 94 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- > -------------------------- > Silicon/Intel/CoffeelakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > | 3 --- > Silicon/Intel/CoffeelakeSiliconPkg/Include/Library/AslUpdateLib.h > | 114 > +++++++++++++++++++++++++++++++++++--------------------------------------= ---------- > ------------------------------- > 4 files changed, 180 insertions(+), 221 deletions(-) >=20 > diff --git > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= L > ib.c > b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= L > ib.c > index 04cf66fd2f..f18ca835ad 100644 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= L > ib.c > +++ b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslU > +++ pdateLib.c > @@ -6,7 +6,7 @@ >=20 > This library uses the ACPI Support protocol. >=20 > - Copyright (c) 2019 Intel Corporation. All rights reserved.
> + Copyright (c) 2019 -2020, Intel Corporation. All rights reserved. > +
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -51,6 +51,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 @@ > -61,8 +117,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, > @@ -154,6 +212,29 @@ UpdateNameAslCode ( > return EFI_NOT_FOUND; > } >=20 > +/** > + This procedure will update immediate value assigned to a Name in 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 > + @param[in] Buffer - source of data to be written over > original aml > + @param[in] Length - length of data to be overwritten > + > + @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 > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > /** > This procedure will update the name of ASL Method >=20 > @@ -163,8 +244,10 @@ UpdateNameAslCode ( >=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 > UpdateMethodAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > @@ -253,11 +336,13 @@ UpdateMethodAslCode ( > @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 >=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 > LocateAcpiTableBySignature ( > IN UINT32 Signature, > IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table, > @@ -300,104 +385,3 @@ LocateAcpiTableBySignature ( > /// > return Status; > } > - > -/** > - 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 > - @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 > - ) > -{ > - 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; > -} > - > -/** > - 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/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUp= d > ateLibNull.c > b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUp= d > ateLibNull.c > index a7ce92b7c3..63e232f04b 100644 > --- > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUp= d > ateLibNull.c > +++ b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/Dxe > +++ AslUpdateLibNull.c > @@ -6,7 +6,7 @@ >=20 > This library uses the ACPI Support protocol. >=20 > - Copyright (c) 2019 Intel Corporation. All rights reserved.
> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved. > +
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -40,6 +40,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 @@ > -51,6 +72,7 @@ InitializeAslUpdateLib ( > @retval EFI_SUCCESS - The function completed successfully. > **/ > EFI_STATUS > +EFIAPI > UpdateNameAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > @@ -60,66 +82,66 @@ 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 immediate value assigned to a Name in SSDT > + table >=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] 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. > - > - @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 > + 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 > - @retval EFI_SUCCESS The function completed successfully. > + @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 > +s > + @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/CoffeelakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > index 12f1a7f4fe..807cdb92f7 100644 > --- a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > +++ b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/PchInit/Dxe/PchAcpi.c > @@ -438,9 +438,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/CoffeelakeSiliconPkg/Include/Library/AslUpdateLib.h > b/Silicon/Intel/CoffeelakeSiliconPkg/Include/Library/AslUpdateLib.h > index 39baa6c03a..1a0ec4fa16 100644 > --- a/Silicon/Intel/CoffeelakeSiliconPkg/Include/Library/AslUpdateLib.h > +++ b/Silicon/Intel/CoffeelakeSiliconPkg/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) 2019 Intel Corporation. All rights reserved.
> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved. > +
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -16,61 +16,50 > @@ // // 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() > - > /** > - 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 >=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 > + @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. > + @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 > +UpdateSsdtNameAslCode ( > + IN UINT8 *TableId, > + IN UINT8 TableIdSize, > IN UINT32 AslSignature, > IN VOID *Buffer, > IN UINTN Length > @@ -85,8 +74,11 @@ UpdateNameAslCode( >=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 > +EFIAPI > UpdateMethodAslCode ( > IN UINT32 AslSignature, > IN VOID *Buffer, > @@ -103,55 +95,19 @@ UpdateMethodAslCode ( > @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. > **/ > 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