From nobody Tue Feb 10 02:43:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+83872+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83872+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1637257384; cv=none; d=zohomail.com; s=zohoarc; b=QfGJ0PARq/jDEfP/vblEly6204zMQpWDfbY2wn1S/WBiU1vuH6m/d/yCGApCZJptbNRsXDgKrGyv0YkCzaewYDRUF3dw1/QNUcUUeVRKANox0kubx+UZEW4bPxK//Ov3OaJ3SYRCRlPxMhQt4a4glb2SQz6enGsjI9FVVEFZH5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637257384; h=Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=GJEcMsEto+rgdihATmNOTpdaZntFNYwdK/WikgzWayI=; b=St8+tRv+K/1rIoG1qMdHGFfiaVn/FsrT06PKE/DuTl2WEa5aypqGpVSCxk+AJBMIqHCqKgvBhCht+g7HKRZ69IOeomP/FY+lPx3yGxh3IvlNtn+pGQtT7qxFG2pjPb+zOE/9rPCBYeOQLGWWcVSKctfnX4A5JFAceWzjVsHpTeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83872+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1637257384170549.3913551858195; Thu, 18 Nov 2021 09:43:04 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id dh0HYY1788612xdPsVGeJVBd; Thu, 18 Nov 2021 09:43:03 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.4988.1637257383051358626 for ; Thu, 18 Nov 2021 09:43:03 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A51001042; Thu, 18 Nov 2021 09:43:02 -0800 (PST) X-Received: from e120189.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D48E43F5A1; Thu, 18 Nov 2021 09:43:01 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, Sami.Mujawar@arm.com, Alexei.Fedorov@arm.com Subject: [edk2-devel] [PATCH v3 5/8] DynamicTablesPkg: Add AmlAttachNode() Date: Thu, 18 Nov 2021 17:42:44 +0000 Message-Id: <20211118174247.21075-6-Pierre.Gondois@arm.com> In-Reply-To: <20211118174247.21075-1-Pierre.Gondois@arm.com> References: <20211118174247.21075-1-Pierre.Gondois@arm.com> Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: HhBjK4CxGLJl5bc5MT6gPAaZx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1637257383; bh=S03ninknoVZhSXgaHtQi/XDqMMjoJin2sslW6FMBN9s=; h=Date:From:Reply-To:Subject:To; b=UUX3soSvneYmUdJHn7hAwfF3jofGBtsvLs0nS/1581duNr8hkCI8+0sqYgvVBImYXEZ wCm5wGY88MSjnZbHa9y7yohpIf941Q4M8L9CiB1QvHbUjTrT0Cv0sd3uM0xbriBjroXKd gXXtLxc1bt+qQjICO6HPsVW5Y90vmP/GiOQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1637257386138100022 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois This function allows to add a node as the last node of a parent node in an AML tree. For instance, ASL code corresponding to NewNode: Name (_UID, 0) ASL code corresponding to ParentNode: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) } "AmlAttachNode (ParentNode, NewNode)" will result in: ASL code: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) Name (_UID, 0) } To: Sami Mujawar To: Alexei Fedorov Reviewed-by: Sami Mujawar Signed-off-by: Pierre Gondois --- .../Include/Library/AmlLib/AmlLib.h | 33 +++++++++++++++++ .../Library/Common/AmlLib/Api/AmlApi.c | 36 +++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index aef5f55ce319..15517b5efac1 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -166,6 +166,39 @@ AmlDetachNode ( IN AML_NODE_HANDLE Node ); =20 +/** Attach a node in an AML tree. + + The node will be added as the last statement of the ParentNode. + E.g.: + ASL code corresponding to NewNode: + Name (_UID, 0) + + ASL code corresponding to ParentNode: + Device (PCI0) { + Name(_HID, EISAID("PNP0A08")) + } + + "AmlAttachNode (ParentNode, NewNode)" will result in: + ASL code: + Device (PCI0) { + Name(_HID, EISAID("PNP0A08")) + Name (_UID, 0) + } + + @param [in] ParentNode Pointer to the parent node. + Must be a root or an object node. + @param [in] NewNode Pointer to the node to add. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlAttachNode ( + IN AML_NODE_HANDLE ParentNode, + IN AML_NODE_HANDLE NewNode + ); + /** Find a node in the AML namespace, given an ASL path and a reference No= de. =20 - The AslPath can be an absolute path, or a relative path from the diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c b/DynamicT= ablesPkg/Library/Common/AmlLib/Api/AmlApi.c index 6f9e3f6f2805..def581299f5c 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c @@ -379,6 +379,42 @@ AmlNameOpGetNextRdNode ( return EFI_SUCCESS; } =20 +/** Attach a node in an AML tree. + + The node will be added as the last statement of the ParentNode. + E.g.: + ASL code corresponding to NewNode: + Name (_UID, 0) + + ASL code corresponding to ParentNode: + Device (PCI0) { + Name(_HID, EISAID("PNP0A08")) + } + + "AmlAttachNode (ParentNode, NewNode)" will result in: + ASL code: + Device (PCI0) { + Name(_HID, EISAID("PNP0A08")) + Name (_UID, 0) + } + + @param [in] ParentNode Pointer to the parent node. + Must be a root or an object node. + @param [in] NewNode Pointer to the node to add. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlAttachNode ( + IN AML_NODE_HANDLE ParentNode, + IN AML_NODE_HANDLE NewNode + ) +{ + return AmlVarListAddTail (ParentNode, NewNode); +} + // DEPRECATED APIS #ifndef DISABLE_NEW_DEPRECATED_INTERFACES =20 --=20 2.17.1 -=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 (#83872): https://edk2.groups.io/g/devel/message/83872 Mute This Topic: https://groups.io/mt/87148948/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-