From nobody Tue Feb 10 14:33:38 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+81758+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+81758+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1633970742; cv=none; d=zohomail.com; s=zohoarc; b=K/ediqDv+jWU2dyNFPnBlbQv3f7fEd1D39nLeV766C5263iJgAVrFJzBAsRBqFwazycQS0pTVZVBHSEX2JtcNkQ4hu27/iS0zHSNM1DuXIshQF9nRUX36P5/pxaog8jxWV3Ij6xwKB9UyJr4m1z3aDbM7LMGlRA3k9thNJZL9rM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633970742; h=Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=vteON/Aw2Hkaf889jl0q7ckng3MwAcrEzALR2O1vPeU=; b=U6pojTON9l9E02wsCSkyKJZpRuyEB8skHwFat2Is5Ay3EH0mDHkBid7yt0bL5zC7pp0nWkD//0tJCGus3lnxEwIacHnXcEFZjQsOni8rwgo8PjUn5sT8isu7TyTOI9LgboHtTLAwO6reezGaqrTE8NCveTo4Jvc2fVgJDC6jf2g= 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+81758+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 163397074214241.72486085776973; Mon, 11 Oct 2021 09:45:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UijnYY1788612xlKICdf0mHq; Mon, 11 Oct 2021 09:45:41 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.988.1633970739811441904 for ; Mon, 11 Oct 2021 09:45:40 -0700 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 F0E141396; Mon, 11 Oct 2021 09:45:37 -0700 (PDT) X-Received: from e120189.arm.com (unknown [10.57.74.141]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DC39A3F66F; Mon, 11 Oct 2021 09:45:36 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Sami Mujawar , Alexei Fedorov Subject: [edk2-devel] [PATCH v2 5/7] DynamicTablesPkg: Add AmlAttachNode() Date: Mon, 11 Oct 2021 17:45:25 +0100 Message-Id: <20211011164527.18660-6-Pierre.Gondois@arm.com> In-Reply-To: <20211011164527.18660-1-Pierre.Gondois@arm.com> References: <20211011164527.18660-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: hc2Zvej7FVWf0zXJ3D30UxIyx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633970741; bh=Z/H4+QG4nADrR6OgCBmZlvqaRuayRh9cub96duWWEIA=; h=Date:From:Reply-To:Subject:To; b=vvRXXGc4nyUHJG6PKwsdLG0AGo438XR5M4J4Ls6pckKkIZ7fUF2RkRz+OlQX5w3C+1K W5KkN/74HI9OWxF0d2hgXMKG8E4SnlkEEFmlmSst2beaZYuWNzqWVHiAxE1KQN+6J5AWk G2ATLxkbV9bDt+6V/3gZg4na2yjwYOKYqNM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633970744028100022 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 (#81758): https://edk2.groups.io/g/devel/message/81758 Mute This Topic: https://groups.io/mt/86241747/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-