From nobody Mon Feb 9 16:35:19 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+85571+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+85571+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1641923692; cv=none; d=zohomail.com; s=zohoarc; b=TtLjF6UgKT3O8/knD9zJzvbztyj3LLUHgaFmJjTIU0KcX5jFpBPthoyhEjM71YmeECyNhMW44fEL46sn6NYEOvPOypkEKlWf40R9oJOsU+cdfR2yOZaLYARriv02NcU9EBt35MBjEgtRvEVVFsq+FpxwweG1ftDd5d/xguZjsWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641923692; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BmJqfca1YkuQ51hc4/ZPtjqZICdy8PvxI79eeGFELL0=; b=i76pq9QAMmw1vgv3f9m/zj98DlPqQIDnms0+TFF2uUNMIgLgSwxrAlhr+KeL6APPqT9nB6KQpSAFNzMdHOs48Juq5YABopjxNQDtK1eCnzxmPnyGVKXceVXNkvG4z4oJvYBpVdBLbQT6EOIwo3QXaU/0UMhmkKY3cyihhlqeg+8= 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+85571+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 1641923692230301.04065937649307; Tue, 11 Jan 2022 09:54:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3ZhEYY1788612xFl92JNRuoE; Tue, 11 Jan 2022 09:54:51 -0800 X-Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by mx.groups.io with SMTP id smtpd.web10.11377.1641923691452449165 for ; Tue, 11 Jan 2022 09:54:51 -0800 X-Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 11 Jan 2022 09:54:51 -0800 X-QCInternal: smtphost X-Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 09:54:51 -0800 X-Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 11 Jan 2022 09:54:50 -0800 X-Received: from linbox.ba.nuviainc.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 11 Jan 2022 09:54:49 -0800 From: "Rebecca Cran" To: , Sami Mujawar , PierreGondois , Alexei Fedorov , "Leif Lindholm" CC: Rebecca Cran Subject: [edk2-devel] [PATCH v2 1/3] DynamicTablesPkg: Add Memory32Fixed function Date: Tue, 11 Jan 2022 10:54:33 -0700 Message-ID: <20220111175435.14695-2-quic_rcran@quicinc.com> In-Reply-To: <20220111175435.14695-1-quic_rcran@quicinc.com> References: <20220111175435.14695-1-quic_rcran@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) 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,quic_rcran@quicinc.com X-Gm-Message-State: rVHy4wswdH46XQqGHeEYFsK2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1641923691; bh=pROvnCEJfoAF+I/+h+KKmS/4TQ9acMwCDgXiS5ESoPc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=el6wSdD4jU20W2i2yL7A9lcJVyL1/2uFjC2qh86nQ4GSnox/eDBsFFZKi/IT9jFNrG8 H5nqcMFqVhTLiP557sEzoB6ATFT0TzklcxcCgMDZIBWkoaS3QxCAQoDZueQKFTJinBhkP R01Rnm7dOpdKn7ni1LEi4TetYxhoGjuIxZo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1641923694188100002 Content-Type: text/plain; charset="utf-8" Add a Memory32Fixed function to generate code for the corresponding Memory32Fixed macro in AML. Signed-off-by: Rebecca Cran Reviewed-by: Pierre Gondois --- DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h | = 33 ++++++++++++ DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | = 57 ++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index af18bf8e4871..2491ade397c6 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -592,6 +592,39 @@ AmlCodeGenRdDWordMemory ( OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL ); =20 +/** Code generation for the "Memory32Fixed ()" ASL macro. + + The Resource Data effectively created is a 32-bit Memory Resource + Data. Cf ACPI 6.4: + - s19.6.83 "Memory Resource Descriptor Macro". + - s19.2.8 "Memory32FixedTerm". + + See ACPI 6.4 spec, s19.2.8 for more. + + @param [in] IsReadWrite ReadAndWrite parameter. + @param [in] Address AddressBase parameter. + @param [in] RangeLength Range length. + @param [in] NameOpNode NameOp object node defining a named ob= ject. + If provided, append the new resource d= ata + node to the list of resource data elem= ents + of this node. + @param [out] NewMemNode If provided and success, + contain the created node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMemory32Fixed ( + BOOLEAN IsReadWrite, + UINT32 Address, + UINT32 RangeLength, + AML_OBJECT_NODE_HANDLE NameOpNode, + AML_DATA_NODE_HANDLE *NewMemNode + ); + /** Code generation for the "WordBusNumber ()" ASL function. =20 The Resource Data effectively created is a Word Address Space Resource diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceData= CodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC= odeGen.c index 40d8c2b07ae3..19fb76dc5b45 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -609,6 +609,63 @@ AmlCodeGenRdDWordMemory ( ); } =20 +/** Code generation for the "Memory32Fixed ()" ASL macro. + + The Resource Data effectively created is a 32-bit Memory Resource + Data. Cf ACPI 6.4: + - s19.6.83 "Memory Resource Descriptor Macro". + - s19.2.8 "Memory32FixedTerm". + + See ACPI 6.4 spec, s19.2.8 for more. + + @param [in] IsReadWrite ReadAndWrite parameter. + @param [in] Addres AddressBase parameter. + @param [in] RangeLength Range length. + @param [in] NameOpNode NameOp object node defining a named ob= ject. + If provided, append the new resource d= ata + node to the list of resource data elem= ents + of this node. + @param [out] NewMemNode If provided and success, + contain the created node. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMemory32Fixed ( + BOOLEAN IsReadWrite, + UINT32 Address, + UINT32 RangeLength, + AML_OBJECT_NODE_HANDLE NameOpNode, + AML_DATA_NODE_HANDLE *NewMemNode + ) +{ + EFI_STATUS Status; + AML_DATA_NODE *MemNode; + EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR RangeDesc; + + RangeDesc.Header.Header.Byte =3D 0x86; + RangeDesc.Header.Length =3D 0x09; + RangeDesc.Information =3D IsReadWrite ? BIT0 : 0; + RangeDesc.BaseAddress =3D Address; + RangeDesc.Length =3D RangeLength; + + Status =3D AmlCreateDataNode ( + EAmlNodeDataTypeResourceData, + (UINT8 *)&RangeDesc, + sizeof (RangeDesc), + &MemNode + ); + if (EFI_ERROR (Status)) { + ASSERT (0); + return Status; + } + + return LinkRdNode (MemNode, NameOpNode, NewMemNode); +} + /** Code generation for the "WordSpace ()" ASL function. =20 The Resource Data effectively created is a Word Address Space Resource --=20 2.31.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 (#85571): https://edk2.groups.io/g/devel/message/85571 Mute This Topic: https://groups.io/mt/88354781/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-