From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.1674.1588222946028740750 for ; Wed, 29 Apr 2020 22:02:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=IMnmO/TC; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: h2WFIUMwao42AQfSryBj3GBWr69hh6Pd7SbaqDPGZrI68CbL9xg4OtTgf+wFIxh7EL0RVAM2Mi yY8GCQ2o4D8Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 22:02:26 -0700 IronPort-SDR: MlnGrnxu0JZUKEzNwgE3pzrIdJruu8VyDA5BwqvbfV7TV/lebzKP52Tekulh/2fAIMYBJTBkKp miZZp3qo17lw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="303180313" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2020 22:02:25 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:02:25 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:02:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmthOKo+ffSNXnf/D678zu08rMZvGbY+RSqvKngCnD3rmWqXUq7jNLlpoBjxfQP0lCvS7XXp1Ne3g0DHGKI+/6hpIGDZXOOipJQ5S5G+m29kO7AAknA9g9yj2m++kG92uCRr7beNT/qavJd8D8PBp4UiRox/fIkva9vav9jwgOVfRprnnrKzKGP2aNfjJCwbKau6rLGllgsDixcy5OyqPi6FQgLr79sVNdG8j/zwD4kvr33R4A2rA37GzcT1CSyvnWeBIJ+GKA0wLpvZjFZ9omdJxxzUVPvIqQF3dkM32T1HDO327lL+awDdB/3AXOg5/RUpWgEFZuLFfY5rMVo4Hw== 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=j8qmaFDLETw4QkrhemjUJWpdnbGQ7Sd6oXnEXzA+oUA=; b=QqK4yH0jGFGTduY6xrGvsIrM14NldqN58X/2so87Gf95HMHBklsoGF5gE8OMusCG5gySAeDh754br28wwYPYgboYL0Xcvqm8YlxzPZw6YYHCwVCtgQ//H45jD3SzeLxjHOAwctjkxiKM19Y3nceH8NURIr8k0Tc9apZwybWcT/Wo+LLlmjBGJikqV/LatNWdkzP0Cmo1L/VeDgbMFqHML3RM5yrNrCbICj4bc+gvnfQFYyoWQodOdppm/2mGxJpLpM6vdk4Xn1EkaL5/+o+2Qe20LzYdDpBEr/JSi7nd/Go+NZc+rCJM4/IIPyN83fo3iAQ5fcNUoVCAK9muqXsD6g== 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=j8qmaFDLETw4QkrhemjUJWpdnbGQ7Sd6oXnEXzA+oUA=; b=IMnmO/TCIZi1/qt0bJavhCgJm9fFaJ2zhhhRWfdp9lZKIKy2NfdzaZgqaz4UW803F5EXP4B13mKT4l/x7alSV2yJzx/Vtin/nfQfn8+L1QXZ7yk7GOk9CRmUi6iWC8XvDJTsuAMotZHCiV7Wxe5YdeOQRR/d/M5/QtfHxlz5U/M= Received: from CY4PR11MB1878.namprd11.prod.outlook.com (2603:10b6:903:11f::12) by CY4PR11MB1815.namprd11.prod.outlook.com (2603:10b6:903:125::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 30 Apr 2020 05:02:23 +0000 Received: from CY4PR11MB1878.namprd11.prod.outlook.com ([fe80::29da:d951:99c3:a94e]) by CY4PR11MB1878.namprd11.prod.outlook.com ([fe80::29da:d951:99c3:a94e%11]) with mapi id 15.20.2958.020; Thu, 30 Apr 2020 05:02:23 +0000 From: "Chaganty, Rangasai V" To: "Shindo, Miki" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "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+DzZgiFdNX0mHl9J1MLiNhqiRHWiA Date: Thu, 30 Apr 2020 05:02:23 +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-reaction: no-action dlp-version: 11.2.0.6 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-originating-ip: [192.55.52.222] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 196c848b-1c8d-4f78-3e7a-08d7ecc3ab56 x-ms-traffictypediagnostic: CY4PR11MB1815: 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:7691; x-forefront-prvs: 0389EDA07F x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1878.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(396003)(376002)(366004)(39860400002)(346002)(136003)(26005)(76116006)(9686003)(5660300002)(66946007)(66556008)(55016002)(66476007)(64756008)(66446008)(52536014)(30864003)(8936002)(2906002)(8676002)(71200400001)(4326008)(33656002)(107886003)(966005)(186003)(53546011)(6506007)(110136005)(7696005)(54906003)(316002)(86362001)(478600001)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i4c8Bwg+Y06fGekz3vFfWJVUjC90q1JLWvVt7/B8zcaZATucyJ5X5gyDnlGBBuk1GnIjfKMnCEhEIjm1Fa8xpudiTAc+eHCO9JpfDuErQN/17PEWRn9KMUh8tjw6lix/HTSYtB5fCAbGM4feLA1a2KCox614NwANjoCojajGQWreKtggp85fpufjJmUYKvyn1WWk7UFxyh/Xs58p/KRt8SBwpzuo/XDGaCOWfqith0XctOKKAKru4iznsJMZqq3AO0fv+BN0K2i4J73UNibg54JYyCdt8OeWRtfS8Z6CeLoj+MbzN4MP56KIoU4LwOqhEdXR5Vn+w7pz4UajJFHSlJfgspGlAJ5wV75nqqp7M1xyfjYkY/ZH9GrdL505mrfpcayqR3V81OQ4soNc+XCDuUWQtASqyHRSMt00X6OiB6qeJPIM/QqFO3ZdgcYvc2RLQgRWzbcmWqAaW0jdwdtDcUXz2uQH2wg8641onuXPFCBoeY8//gKugTDpc/gwIUa9FQHPtFqsfxYTJzhVnm79nQ== x-ms-exchange-antispam-messagedata: 8eSA7+WUkNLr4uq5ujviudK/DzUCdj+Y0lx9AKKICwtxch/E/N+gIckhD4T77f0BHQPEJ+2Em3cWpsisg2rm1IUFRinsgO+YN0lw70ogDCcFlSReh+xuwAOfGVTM2a5oXUFk8ebSNcJMY5P1G+iuEZP18mJrTURgnKQKVk5/Bo+kv8TakoXO1w6j2I4AGOao+Sg91me731rPuPSlA23LaOzCUJMTSHjIUtuQLHDY+B8VyTHYTv/UsI2DZiFVOMjBvAxcFFVhuo6n2t2v7/BQp5yF0Aawl6EU/wio3tlvmNhlvRJqIK1XqmRwTjZVF7AU9zJtSidPlet0BWYavfwnS4jbK/6frrYClXEP1IqvEAyi4J7IrnutlMnVg9n0PXAAs9LC5mPstErGthofW/RBToJ1GNrJgZipQryXMEZQZHTEXRz2w43WfGnJCHd+2hFk1ZxIaiogllUzLt7lntybKdKEGEkwFtEPza6k+oP4mGBLDttlO4sV7yiI0ubPvqz3anHGMdZuxcYVHB3eL6nzeXwNIGmZzREtILbNb+XvIsvyEkhSH+HbJptNFW3JG9zmze8bjulXp8Nl6I2E0tJfIqLLnWqaqBf7zhDVq9ebarNoV3BhdXNP3GOg2dZRjnLUJI/QXbFE99nLFVsLn8+TOZGsGHUd5c/teX5l647oJ11bFfh+aRoQhtiRaGuy1KIickhT6maKex7XU2OTAznJzQjs3KxFtIssro17NZjUSI4lTiMmoQRfn9mD/o2svgGfkYaTvD2em9lVWjBKVyb5bFzknuNSQ+32zIevrJ2i+o4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 196c848b-1c8d-4f78-3e7a-08d7ecc3ab56 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 05:02:23.2229 (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: jmdgCDzB3hgwbwhbEjkFqvGf6nHZ5cZqpq0atbIDx9iN55vcK0Rujuqoz7T6/WgzPMXxdQuoTEzAIFNGVSnzhd9O+9UEeQ9DP4+bVXyxmF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1815 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty -----Original Message----- From: Shindo, Miki =20 Sent: Tuesday, April 28, 2020 7:32 PM 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 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2536 Callers of DxeAslUpdateLib don't have to call InitializeAslUpdateLib() but = the library itself runs it internally. This commit deletes the redundant ca= lls in caller side and makes it an internal call. LocateAcpiTableByOemTableId() is unreferenced externally so this commit mak= es 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. Signed-off-by: Miki Shindo Cc: Sai Chaganty Cc: Chasel Chiu Cc: Nate DeSimone Cc: Prince Agyeman Cc: Ray Ni --- Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib.c= | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++------------------------------= ------------------------------------------------------------------------ Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpdateL= 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(-) diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAs= lUpdateLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/Dxe= AslUpdateLib.c index 87c6b15ed2..abdb85307f 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdate= Lib.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 Tab= leIdSize 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 **)&Org= Table, &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 inst= ance, - 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 t= he 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 t= he 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 origina= l 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 lib= rary. **/ 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 **)&Org= Table, &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 origina= l 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 lib= rary. +**/ +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=20 + instance, e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT,= 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 Tab= leIdSize 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 fu= nction for use + @param[in] Signature - Pointer to an ASCII string containing t= he 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 t= he 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/D= xeAslUpdateLibNull.c b/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdat= eLibNull/DxeAslUpdateLibNull.c index 490a09ddb5..395ff16596 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUp= dateLibNull.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 Tab= leIdSize 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 inst= ance, - 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 t= he 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 t= he 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 origina= l 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 Tab= leIdSize 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 fu= nction 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 origina= l 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=20 + instance, e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT,= 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 t= he 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 t= he 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/S= ilicon/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/Incl= ude/Library/AslUpdateLib.h b/Silicon/Intel/KabylakeSiliconPkg/Include/Libra= ry/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 dependenci= es, 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 // // In= clude 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 successfull= y. + @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 t= his 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 origina= l 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 lib= rary. +**/ +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 successfull= y. + @param[in] AslSignature - The signature of Operation Region that we= want to update. + @param[in] Buffer - source of data to be written over origina= l 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 lib= rary. **/ 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 contain= ing the Signature to match @param[in, out] Table Updated with a pointer to the tabl= e @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 deta= ils =20 @retval EFI_SUCCESS The function completed successfull= y. + @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 t= his 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 tabl= e. - 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 contain= ing the OEM Table ID from the ACPI table header - @param[in] TableIdSize Length of the TableId to match. T= able ID are 8 bytes long, this function - will consider it a match if the fi= rst TableIdSize bytes match - @param[in, out] Table Updated with a pointer to the tabl= e - @param[in, out] Handle AcpiSupport protocol table handle = for the table found - @param[in, out] Version See AcpiSupport protocol, GetAcpiT= able function for use - - @retval EFI_SUCCESS The function completed successfull= y. -**/ -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 resul= t in - - @retval EFI_SUCCESS The function completed successfull= y. -**/ -EFI_STATUS -AcpiChecksum ( - IN VOID *Buffer, - IN UINTN Size, - IN UINTN ChecksumOffset - ); - #endif -- 2.16.2.windows.1