From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9DABBD8026F for ; Thu, 9 May 2024 07:40:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tk9m0fg09b3oT5HejhEty3OeONr3f7YvgNkBqq0XxMc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20240206; t=1715240420; v=1; b=m6zQ+GwwA+jPgUjGtexDE124Z7Th31hoYMZZynyaDWZyg31lx4NJS645yJqhFiE4k+IQD+98 4qOsaz06Snyw5stqHZiEc/FlcrtM8N7N1Efxs71cNu8N3znLl40RiR6v8JKdwFF8qO/uq+fHWAA 7HSmg1SCxpnQtExv4BpL9nTDPXl+zBGOZjYpg8bunIpvjr13R+3j3LW/RqhIw+VwS7FvxMcExSh aW1ZRR88c1RAIwzLVOd6XVUdaRoQ7Ir0Z5kEfKMnbPxr9tuxZnDCmaCwyaMqSPJ1VHP4mP67LYa d7oIZd6efwjHdzg42ZPZ0xTttHRe3p3zECoTYCcXh4zdw== X-Received: by 127.0.0.2 with SMTP id 1IqzYY7687511xywHKaxvll5; Thu, 09 May 2024 00:40:20 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web10.4846.1715240418924556685 for ; Thu, 09 May 2024 00:40:19 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 87C63A32E15B for ; Thu, 9 May 2024 15:40:16 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 3BF6EA32E0E5 for ; Thu, 9 May 2024 15:40:16 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 5BBCCA32E0C2 for ; Thu, 9 May 2024 15:40:12 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Thu, 09 May 2024 15:40:01 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: , Cc: "'Pierre Gondois'" , "'Sami Mujawar'" References: <27f10d098dd8477df432534933dca5f688cfd66d.1715229678.git.AbdulLateef.Attar@amd.com> In-Reply-To: <27f10d098dd8477df432534933dca5f688cfd66d.1715229678.git.AbdulLateef.Attar@amd.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW2VkazItc3RhYmxlMjAyNDA1IFJFU0VORCBQQVRDSCB2MiAxLzFdIER5bmFtaWNUYWJsZXNQa2c6IEFkZHMgaW50ZWdlciB0byB0aGUgQU1MIHBhY2thZ2Ugbm9kZQ==?= Date: Thu, 9 May 2024 15:40:04 +0800 Message-ID: <00fc01daa1e4$1bb73d60$5325b820$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQICoPUlS0ABqi/r0+GPYipDAWFVoAFZ9k4ysTO2MqA= Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 09 May 2024 00:40:19 -0700 Resent-From: gaoliming@byosoft.com.cn Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 51LaidW5AzhjodkWnOny9N4Ix7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=m6zQ+Gww; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io Abdul: Can you give more information why this change is required for this stable tag 202405? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Abdul Lateef > Attar via groups.io > =B7=A2=CB=CD=CA=B1=BC=E4: 2024=C4=EA5=D4=C29=C8=D5 12:49 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Abdul Lateef Attar ; Pierre Gond= ois > ; Sami Mujawar > =D6=F7=CC=E2: [edk2-devel] [edk2-stable202405 RESEND PATCH v2 1/1] > DynamicTablesPkg: Adds integer to the AML package node >=20 > Adds an AmlAddIntegerToNamedPackage() API to generate AML code, > which adds an integer value to the package node. >=20 > Cc: Pierre Gondois > Cc: Sami Mujawar > Signed-off-by: Abdul Lateef Attar > --- > .../Include/Library/AmlLib/AmlLib.h | 41 +++++++++++- > .../Common/AmlLib/CodeGen/AmlCodeGen.c | 67 > +++++++++++++++++++ > 2 files changed, 107 insertions(+), 1 deletion(-) >=20 > diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > index 82d5464084..4427ab68fa 100644 > --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > @@ -2,7 +2,7 @@ > AML Lib. >=20 > Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.
> - Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
> + Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights > reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > @@ -1743,6 +1743,45 @@ AmlAddNameStringToNamedPackage ( > IN AML_OBJECT_NODE_HANDLE NamedNode > ); >=20 > +/** Add an integer value to the named package node. > + > + AmlCodeGenNamePackage ("_CID", NULL, &PackageNode); > + AmlGetEisaIdFromString ("PNP0A03", &EisaId); > + AmlAddIntegerToNamedPackage (EisaId, NameNode); > + AmlGetEisaIdFromString ("PNP0A08", &EisaId); > + AmlAddIntegerToNamedPackage (EisaId, NameNode); > + > + equivalent of the following ASL code: > + Name (_CID, Package (0x02) // _CID: Compatible ID > + { > + EisaId ("PNP0A03"), > + EisaId ("PNP0A08") > + }) > + > + The package is added at the tail of the list of the input package node > + name: > + Name ("NamePackageNode", Package () { > + [Pre-existing package entries], > + [Newly created integer entry] > + }) > + > + > + @ingroup CodeGenApis > + > + @param [in] Integer Integer value that need to be added to > package node. > + @param [in, out] NameNode Package named node to add the object > to. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER Invalid parameter. > + @retval Others Error occurred during the operation. > +**/ > +EFI_STATUS > +EFIAPI > +AmlAddIntegerToNamedPackage ( > + IN UINT32 Integer, > + IN OUT AML_OBJECT_NODE_HANDLE NameNode > + ); > + > /** AML code generation to invoke/call another method. >=20 > This method is a subset implementation of MethodInvocation > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > index 22c2d598d0..89fa4e06f8 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c > @@ -3871,6 +3871,73 @@ exit_handler: > return Status; > } >=20 > +/** Add an integer value to the named package node. > + > + AmlCodeGenNamePackage ("_CID", NULL, &PackageNode); > + AmlGetEisaIdFromString ("PNP0A03", &EisaId); > + AmlAddIntegerToNamedPackage (EisaId, NameNode); > + AmlGetEisaIdFromString ("PNP0A08", &EisaId); > + AmlAddIntegerToNamedPackage (EisaId, NameNode); > + > + equivalent of the following ASL code: > + Name (_CID, Package (0x02) // _CID: Compatible ID > + { > + EisaId ("PNP0A03"), > + EisaId ("PNP0A08") > + }) > + > + The package is added at the tail of the list of the input package node > + name: > + Name ("NamePackageNode", Package () { > + [Pre-existing package entries], > + [Newly created integer entry] > + }) > + > + > + @ingroup CodeGenApis > + > + @param [in] Integer Integer value that need to be added to > package node. > + @param [in, out] NameNode Package named node to add the object > to. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER Invalid parameter. > + @retval Others Error occurred during the operation. > +**/ > +EFI_STATUS > +EFIAPI > +AmlAddIntegerToNamedPackage ( > + IN UINT32 Integer, > + IN OUT AML_OBJECT_NODE_HANDLE NameNode > + ) > +{ > + EFI_STATUS Status; > + AML_OBJECT_NODE *PackageNode; > + > + if (NameNode =3D=3D NULL) { > + ASSERT_EFI_ERROR (FALSE); > + return EFI_INVALID_PARAMETER; > + } > + > + PackageNode =3D (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument ( > + NameNode, > + EAmlParseIndexTerm1 > + ); > + if ((PackageNode =3D=3D NULL) > || > + (AmlGetNodeType ((AML_NODE_HANDLE)PackageNode) !=3D > EAmlNodeObject) || > + (!AmlNodeHasOpCode (PackageNode, AML_PACKAGE_OP, 0))) > + { > + ASSERT_EFI_ERROR (FALSE); > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D AmlAddRegisterOrIntegerToPackage (NULL, Integer, PackageNod= e); > + if (EFI_ERROR (Status)) { > + ASSERT_EFI_ERROR (Status); > + } > + > + return Status; > +} > + > /** AML code generation to invoke/call another method. >=20 > This method is a subset implementation of MethodInvocation > -- > 2.34.1 >=20 >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118747): https://edk2.groups.io/g/devel/message/118747 Mute This Topic: https://groups.io/mt/105997290/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-