From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.1676.1588223043054955479 for ; Wed, 29 Apr 2020 22:04:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZThotSa+; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: mBr2mZAj8krjeNTQnbitwhq2lHGs82rTnq/BUQtmrDlPNu+XIGvX0kSQO3gFFC8un0iOnYuC6/ iRx+dhc8h17Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 22:04:01 -0700 IronPort-SDR: DBEhLuupbYPK0JgicHXfGC+i9qQcwmMh8+j4DL43KsRGK6etcFxvl/G6YyD/1mXiXBMJuETI4M dtrpQ07dFzxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="303180613" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2020 22:04:00 -0700 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) 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:04:00 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX114.amr.corp.intel.com (10.22.240.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:04:00 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:04:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzREy2TPv7wVMMPUMYDLhwmJYNIAWKRm0IZy2pvBdwPZ9EWo/QHcrNNNpjBSKut2+O05eRORY0MEAJMk2Ab3u9bL2THz2YRb8BtZiE41XzHgL39G9hnH86zr+dD3YUgWzYVhGqaAW1g+gWg2qcnKnq6yN+2qYWbv0B5oRPykQpOIbm0hme+z3Mpb7NZhT7TA/PMNf7OrCadPoSxA0uQI2hm5ZjqUmMueP+unRxXsn8fP83DWnn48OgeIFE0leQlue9sNa9/TGhVCv82sEiW1itJff/E2AA78NzQ9uWlC7uYDHyEV7zc2JJEpVeBnrlWqj8olSLdIEfmIhkTIhE7e/g== 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=tX44TSj37o6JdHQqY+1APnftOr7F2TxXjBiQzsz9dEU=; b=TnTmtp+u8E38ETg5f3bdoP9pUkyjCP50RQkz1y2bIqq32r21DDfqMTDrhuVVnQ8MdIqAKeyUcIFv0DGcRKjtV5Jyge2jCPpchjqr19jFLaIe4Wah4AkCQCsM8NCRiQoahCiPJlL6Cz66IETM+lo8T9vkkCWcJu6kWyfo5FVl2pDrzNfyAdOZk/rhLU99NVSJDxtJMjBjod2NoI6zayV6h6ghP/lRSvbOD/khQslLxAFQqzVR/Y5Y5EYFcLZnVs/7004aiA/ZpFLmEcWQjbLH/NYGI3x0LlFwbQAQTIyzdUm9EcNgsPMgDPOq8p0vuwajQju7Kq+uwxf2+W6WcnFf/g== 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=tX44TSj37o6JdHQqY+1APnftOr7F2TxXjBiQzsz9dEU=; b=ZThotSa+bzQd5YDwHVxR0NjWzTxbuWeGHyV7aCkBPVbOQ0AKbrQIqLrlqQotf8vJtcNcMyad0KKqOZbJ8jPFyKIo+dX7PJ7wqvK+jgkbfHtrBjLVHrhMJUytLdyxzMWLhT/oinWhthNMTleOZ9X/3oMr2Ojklc31rf3jCMrOEp4= Received: from CY4PR11MB1878.namprd11.prod.outlook.com (2603:10b6:903:11f::12) by CY4PR11MB1735.namprd11.prod.outlook.com (2603:10b6:903:127::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 05:03:58 +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:03:58 +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 6/7] CoffeelakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Topic: [edk2-platforms:PATCH v4 6/7] CoffeelakeSiliconPkg/DxeAslUpdateLib: Cleans up APIs Thread-Index: AQHWHc6Cg5MP9GNJ4UyMKHSO/QxWdaiRHcOQ Date: Thu, 30 Apr 2020 05:03:58 +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-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: bce0223d-47fa-49c4-7164-08d7ecc3e402 x-ms-traffictypediagnostic: CY4PR11MB1735: 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iJbtQlZ0TGhRiiWMHrcx0bWoPqPZ3aJ68HSv2qDFF6C/MkCnVKnioZ7HzMWgYMnC0IQPaLvDviJ9AWZRWAeB8KLZmQ64+IXki8+FXGmF/IMgh5sVsIkcvych385JHB7pci/LmyaMYcx0v1JE6wKU1b99BN+gPPBuYkVkcDQcBnuo8N2RSGrQSjDtH1RxAxY3OV51Xyn2p4VarpBwv8V6f/sruK3XSfjtVcyAM6P4wTZyp353+j2zvCu5C7l4ChOCy/MoP08GohwCacVold8ad5Tq7+Syqakxz2Lq1M6eWe9ZXcR5296CW8bsmNHhWifcNxbv1Hcjb8aw3UdR+yoRXo5vSehnFzPtUUM802dsqEFTqxjQwXdxPIsQ/hH3X41xeirS5woWqVRU1nJLp70vPPWi3HQzqZAfTMaXIHktA7GM1Q6Tf9iXjVkjhixFKUfaeck3NftNjmx+v7i4iLsLifvSnra/e1BVr6t16g2yDJmKdp7pUvXD7e5lJgclchS4VypFhyPmWprrVmAfLR+2ZQ== 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:(346002)(376002)(39860400002)(366004)(396003)(136003)(5660300002)(52536014)(966005)(478600001)(55016002)(2906002)(66476007)(4326008)(66446008)(66556008)(8936002)(71200400001)(8676002)(64756008)(186003)(66946007)(9686003)(7696005)(54906003)(107886003)(316002)(76116006)(86362001)(30864003)(33656002)(26005)(53546011)(6506007)(110136005)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: jWPYyZ3zln4ErvqgqZrhAzFGqYMrh3oJO1ogkwIZ4IzTlQ4yi8FVMAGjnDHYh85UnXkwHdcxdaSiS++z/7Io2LBowK3LIyIMq/lPIKjRkxg1hB7qapfRCSrbRWDA+dQwMLJ/ZCgC3vFcOnxqnLWSerTxvkSGUvgoR71Py2kLkorwu3FgMF2X0dQzl0noses8uPpPxvnF299fj0/D8L4J9Sa1i9hYTpxkWtOHplPkEDPo/+fx93YKLvhUnAFMVujh7b8FcmYfdUISr5CsCn9qvQEOt2rh9i5S4Wc27o8zOQxmGtjbB5xu3TIs0dih+nHDIsSjwzY9uuBc11m88d6E/t6Ads/VqKBits8LsuqcKFewe9sbpLn88FmBsSsm9nfP2DMxfgoJ8wGZUWzXJc9/IUiJ/2rGeJRed03Vbe8VjqPEm1gIoYkhw+zKfaX5SMMNsdwXjc2Sh3KGtimcaNl6lRdIiuiDrfcFaow+7bd0G2ckXT24mkl3JbUXxjCRXPUbNYM5XmBv5DUA4jzuaQNSizC0CtMbdN3ZOIsPIKFn0d64B4M7w6Z/b2g5H6+z8CW5F08+WVVWhIi5tEIAqW8Tqjg1CKZs80g+yl5ocgNqoJlq4oP2xRNTgivlZxiSvIpD45WVQrTN5gsD39mbwFgQ+0Z6/xl/CSuomjkBzM8QVNWldFrTRT5Lrkzo4p+hzr11TCG/U3x5cLT7O/uvIsWW/cjjWrJYi2BSOXxgdnksBMyrlAoIdeEQ9sWJCa//h+qqT3Z8vWefuRnQ/DfTuCQGBJci48UDvCxVnxzpkfsgfcU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bce0223d-47fa-49c4-7164-08d7ecc3e402 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 05:03:58.2358 (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: WNUj4slOWajlaIHM3LdA60rrm2Eb4ulkRFMvtDgFdXXw3YyCLEi0Zt4Xs3uQMShtYTag5kyllcVE26oPYf+0LzjO/4FlfpGycbwyLAGJ4MM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1735 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 6/7] CoffeelakeSiliconPkg/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/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpdateLib= .c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++----------------------------------------------= --------------------------------------------------------- Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAslUpdat= 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(-) diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/Dxe= AslUpdateLib.c b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib= /DxeAslUpdateLib.c index 04cf66fd2f..f18ca835ad 100644 --- a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLib/DxeAslUpda= teLib.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 +
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -51,6 +51,62 @@ Ini= tializeAslUpdateLib ( 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 @@ -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=20 +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 origina= l aml + @param[in] Length - length of data to be overwritten + + @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 + ) +{ + 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 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 =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 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 - - @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 **)&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; -} - -/** - 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= /DxeAslUpdateLibNull.c b/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslU= pdateLibNull/DxeAslUpdateLibNull.c index a7ce92b7c3..63e232f04b 100644 --- a/Silicon/Intel/CoffeelakeSiliconPkg/Library/DxeAslUpdateLibNull/DxeAsl= UpdateLibNull.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 +
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -40,6 +40,27 @@ Ini= tializeAslUpdateLib ( 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 @@ -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 inst= ance, - 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=20 + table =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] 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. - - @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=20 + instance, e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT,= etc. =20 - @retval EFI_SUCCESS The function completed successfully. + @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 +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/In= clude/Library/AslUpdateLib.h b/Silicon/Intel/CoffeelakeSiliconPkg/Include/L= ibrary/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 dependenci= es, use restrictions, etc). =20 - Copyright (c) 2019 Intel Corporation. All rights reserved.
+ Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.=20 +
=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 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 =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 origina= l aml + @param[in] Length - length of data to be overwritten =20 - @retval EFI_SUCCESS The function completed successfull= y. + @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 +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 lib= rary. **/ EFI_STATUS +EFIAPI UpdateMethodAslCode ( IN UINT32 AslSignature, IN VOID *Buffer, @@ -103,55 +95,19 @@ UpdateMethodAslCode ( @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. **/ 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