From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.1656.1588222839201101988 for ; Wed, 29 Apr 2020 22:00:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=l7mk4zVH; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: piTymW7wdjV6Aw9t/fwy+DGBEuvA3v9T4fFu0/LaXuY51mlyCvNz/KEZEqLM0TMXsZLEkAiVQP W5w75vqxNNIQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 22:00:37 -0700 IronPort-SDR: t43p3Z0XfmU5dPb/rsYg+5wKlEGcrHhufS95ck+WHT15kqj2dmlkPrvFL/nHYi7+UutEQK4plb Ja41mD6ldrpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="432825907" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 29 Apr 2020 22:00:37 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:00:37 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:00:36 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 22:00:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDtjmpHzpmrjTqFLhTcnFLh2BWGS/6WfBZaWjInuJnbR4sbMxpEXEDVfH6+ZMJzhCeL5YyxS2sbJ8q0+bwhYtifdjHkQJyGVzVsIDr+OTflRwcC2ldpF/+gefZtIjMef0ITxOqI6yVnrfh5R/QMur/OcQztZkFFmBqnHivS6VotAh+qwn83HRSol+ZJmDTrs1MQ0hQ6INAKh7ubBa6UeMk6OxBsAzLRoz4SEm7okj8rzQ50CTVHzJF+WY02PcBaPCS+Jlz46J+a3SyfmX01O7fgzluszNrly2QRxkwyfWbdPmhqwdEUPoRO98adjVglsFRUV6AZyQxEUTwl3Lsl31g== 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=i747+v8RGdxExVMKjNelIy9vW6IhuQy3rHLJnvM8B6g=; b=bZx1Lt6pkX0MLxdnNvNCw+XI5cNvZuL82Twj0s/4O92CdhjMdujGaKrCcCrFYHp+EyjaLHWLnqcgzMW+KSCFtFVMYbXx2BS3W09ymyXV3ec7FlNJD8+PBEW0JbaTKsZ2Xjd42CjCRIDNITCmZp6gt/GbJTtskYTct1R/lGCVw/Lh1xezywFOvJp1syBCFKTQh+o2tOipXT3gGm2JSrhDFNlc8z6bVanC88Ap6t1in663agX1Q+6u78riSO00D5FcI5+G+5sX0C1ESSg+qJ7st9JEH/5v/dx4QGVoNEVOyEzy5mF5y1CZsW9VmsgCt0mvaGnn7KdSlEUuSxuCIk4xZA== 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=i747+v8RGdxExVMKjNelIy9vW6IhuQy3rHLJnvM8B6g=; b=l7mk4zVH6LTu9HiZ80xdMNYoQZDWyd4iNXgzcoTDYC3uYpWQ+eaIgY7ySGndTyis2/VPDctHuQT3qi37twkl0LHhJHaAfQSxnBQFRfVdFqAweCQxG9aVZYv5zJswObdwWNydaHDbVgOEzfPs2hFJLZ5rGpvbwzMPaE+ZSN3Bg08= 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:00:35 +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:00:35 +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 4/7] MinPlatformPkg/DxeAslUpdateLib: Cleans up APIs Thread-Topic: [edk2-platforms:PATCH v4 4/7] MinPlatformPkg/DxeAslUpdateLib: Cleans up APIs Thread-Index: AQHWHc5+7VgFpyPiZkqVFtYf/z8VK6iRF/2A Date: Thu, 30 Apr 2020 05:00:34 +0000 Message-ID: References: <20200429023203.37544-1-miki.shindo@intel.com> <20200429023203.37544-5-miki.shindo@intel.com> In-Reply-To: <20200429023203.37544-5-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: f656262f-f16e-488b-29c9-08d7ecc36add 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:3968; 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);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lOAS+U6EzQmsWtcowic1ueVJ0uj5qKLyU9hyQvglsVnTZIw6Ds+G1Eg2BqbXYClUlibrd4GErA4G2c3DalbXiAizv2NuSs9MM28gqc71ecwyJpFyXWGuGQXF653jvCKo0cxaVE+ipwrHQEDTq1efX3UFB9IvUTWMADhVTi9yGMNUGfVjgInPuRg96I+B/5TtYWdX6uyQLJ/kyeMT6dJmntnoUyPF8u6lp05J8LP2JEig3kGShWdavKk2ck7PoLQt/m3YR/G7Igj67rtw/xEjd3y/uNV1lKuDaC0bckcnXHDD9BWza6+nWRIiBiSvekFmbH8BtayxEvUS9r8Ska+KqLIs3vwcv204sBDhjFWbuoIwPf0CTcyG3EJPOaLLqBgLeF8fV23494FqychbCWPIc8zc0dN51o5CwA18jg20yiRM0AHGMBEKrYrnReclFNHVC6rr2zOdM88/oPYB4H+hXKAPwBfVU2NF7RasyBqW6w5R2n5A5okSW4gx1sl3/+6ubP4XIqUjr73CgjJx6f9K4w== x-ms-exchange-antispam-messagedata: Iroh7ECysBnISYNUR4rUvUYJXi4OeewvtuRiyjrNd08FSaMIdTN0f/Wx71SGlzfOPs5HogwfiWNFkYRAVqtzlOGWosEajF73StoeTrbdUXwVgQXA9p7iWs2dw2jlSNp9bX8oBPpV2x7W753WyTlArFnQ01OTrFumhI/hBqcvOJ9FFuGB3XPsJrDdjYIVsz4YgbDPTjErHEdiMSezBzYOkTKo0DcuKA1Yd8wPRgkxZ0ICXwxSBxelvfFFZJWauoEaUs+Iadht0v2wt4xuYS7wJq98jnus5WzwTFg3WCGXhKxlKCE8oaeWP92kbZHVmUps39bYfyNu178LAWx5iJnJ/GtVl2WFrkxPKsmtri8wQ3ZxXCGhr/pMd5kpLtLPpW1icN2HxiA8nn9ODoQ05nwFX1Tf6IrQS/sXhq+YG9Wh3dPg1dJpmpu3rXDl2PgDeoczz8WtB19Y6bSKsFAruN2FjEPhpJXGRmYthSxvrUzOBxcgk/UdAGosPJaUBfsDC4eeyupMzdazGTTSuE86RE3Ktj0/BTuJfuEcgufGGMhJolO8IxorY1/hq8lCBTigD+YSefYDNjHFh/3LwbMYWyDQGoGiCkFgqgavajDuhpvXkvFnlkHc/wFejRsPEf3a5vhpoDrKvnuv7OLIu9A7Bsh4TaYT6bRCnVQpAMXeyus7SB+NEzm7bTfuy2o9y2VzZJ99D5410jWFBu8pslTwzjCHlaciJab7FO7MNp9Ni8OHvwcAyrwbthjbDMp7Hg6BuG06Bbi58fOYn/YmueD4yr+mMsGUihDuk3LmHbXUDUO+Kvk= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f656262f-f16e-488b-29c9-08d7ecc36add X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 05:00:34.9882 (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: 9EGwDTQCRR2GP8TTF7xeVc4rLozhO4dw2DU+lxWYjhG1JuWV4iRR+O/efxbRemAVPapkH9l+pSb24Y93gvm0yZExgbHvR47kv7/UGN56x0E= 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 Noticed that some APIs have incorrect descriptions (e.g. UpdateMethodAslCod= e) that needs to be addressed. With that: Reviewed-by: Sai Chaganty =20 -----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 4/7] MinPlatformPkg/DxeAslUpdateLib: Clea= ns 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 makes it an internal cal= l. 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. Signed-off-by: Miki Shindo Cc: Sai Chaganty Cc: Chasel Chiu Cc: Nate DeSimone Cc: Prince Agyeman Cc: Ray Ni --- Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib= .c | 209 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++----------------------------------= -------------------------------------------------------------------- Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h = | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------------= ----------------------------------------------------------------- 2 files changed, 159 insertions(+), 181 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/Dxe= AslUpdateLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib= /DxeAslUpdateLib.c index e6ab43db6d..1ba51a7c55 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpda= teLib.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslU +++ pdateLib.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 **/ @@ -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 @@ -59,8 += 115,11 @@ InitializeAslUpdateLib ( @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. **/ EFI_STATUS +EFIAPI UpdateNameAslCode ( IN UINT32 AslSignature, IN VOID *Buffer, @@ -149,6 +208,50 @@ UpdateNameAslCode ( return EFI_NOT_FOUND; } =20 +/** + 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 + will consider it a match if the first Tab= leIdSize bytes match + @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_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 + + @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_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 table. @@ -161,8 +264,11 @@ UpdateNameAslCode ( @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, @@ -205,104 +311,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/Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h b= /Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h index d58b6d6458..0be8df6469 100644 --- a/Platform/Intel/MinPlatformPkg/Include/Library/AslUpdateLib.h +++ b/Platform/Intel/MinPlatformPkg/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,70 @@ 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() - /** - 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 +95,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 **/ 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