From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.40]) by mx.groups.io with SMTP id smtpd.web11.65283.1643813573653900068 for ; Wed, 02 Feb 2022 06:52:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=bXGnE47v; spf=pass (domain: arm.com, ip: 40.107.15.40, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKLOwO9eY6MmihbMPhbK/czcEYWNeHoghIMhmbyKd04=; b=bXGnE47v9gY1Dh01/hXFq6YogT6w/LzOa0+sTSvq1mm9433+PvdBa69PaM3GQRIx2qxKQluLmCcLZWz95efrVrMwxNm3YmZgru1EtMTEIuxckA334/f/D6PBDszVymropMU6g4m/LEfSqQzNxwhvoYc0ZjDa7Xjoi0cRZVcsvbA= Received: from AS9PR06CA0091.eurprd06.prod.outlook.com (2603:10a6:20b:465::9) by HE1PR0801MB1755.eurprd08.prod.outlook.com (2603:10a6:3:86::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.20; Wed, 2 Feb 2022 14:52:49 +0000 Received: from VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::bc) by AS9PR06CA0091.outlook.office365.com (2603:10a6:20b:465::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Wed, 2 Feb 2022 14:52:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT008.mail.protection.outlook.com (10.152.18.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Wed, 2 Feb 2022 14:52:48 +0000 Received: ("Tessian outbound 63bb5eb69ee8:v113"); Wed, 02 Feb 2022 14:52:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6719ba010d8c875f X-CR-MTA-TID: 64aa7808 Received: from 87851e83175e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3C6ECD38-DFA5-4985-8201-269BA6A78DC8.1; Wed, 02 Feb 2022 14:52:41 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 87851e83175e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 02 Feb 2022 14:52:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TbITk8b21+Lebkzs76MuQE6FjfH/7sTPwb0fJpt2N7l4xnEvIk9cCE1ke0rJoUN/65Ttp10Nvs/SqU4/VJ4KpSXPBsm5FVl2T1i2qW0c/djvZSpPiKmvu0cg1+Us7Q1Su7Q4lQcUFKIodsh2t3w5C3DkSFJtMe/riWxbMvqjfBjuE1G+oF5WIBf+Ekl7qB9G0/JJW7JzmaC6PPOysj398bjeI12TDuH3QqipoWk8S6YikySpS2gnvv5rhi/tV+ADeec5MGhDw5vprhw681xGnNs9gQlAxZCDmlrjsgubZM4yGUbD4t48KqHrfiNYjkMNMa3i67jIjRlM1pciTOtv0A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kKLOwO9eY6MmihbMPhbK/czcEYWNeHoghIMhmbyKd04=; b=GOTeOGRA4MEqLq55pd6gbfTca303GRLwGPI8K7RX2k8jhtR/S0pmx/uxccxFq9fobNtFJGRW2r7b2+AeSMxoIs2cdpRX6o3/kFXeDJFdvl/wKt0iYld4lA6ffddk//lJRXOtyJWwwUJWLGPEgLLXmUsX1ZpwdS5tiDvxVaxMNA++xrP/kZRoFzSkqHU+k9bq1GD6GPtcbAHE57Tjj01y6GUkc6ZI048iuZ0HQF19JjMEcV8Q3VIbEm2ft5po4A8h6aCDxAo5z1m2EzX4EddZpG6UHTVGZBmQObM3eIbiVezmIiLzYSkX0S6eeNNPs8pOybBNtDIJ2mZkKOiNtbl1Bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKLOwO9eY6MmihbMPhbK/czcEYWNeHoghIMhmbyKd04=; b=bXGnE47v9gY1Dh01/hXFq6YogT6w/LzOa0+sTSvq1mm9433+PvdBa69PaM3GQRIx2qxKQluLmCcLZWz95efrVrMwxNm3YmZgru1EtMTEIuxckA334/f/D6PBDszVymropMU6g4m/LEfSqQzNxwhvoYc0ZjDa7Xjoi0cRZVcsvbA= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by PAXPR08MB6623.eurprd08.prod.outlook.com (2603:10a6:102:155::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Wed, 2 Feb 2022 14:52:39 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::34b6:4579:9e43:6b95]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::34b6:4579:9e43:6b95%8]) with mapi id 15.20.4909.019; Wed, 2 Feb 2022 14:52:39 +0000 Subject: Re: [PATCH v3 1/3] DynamicTablesPkg: Add Memory32Fixed function To: Rebecca Cran , devel@edk2.groups.io, PierreGondois , Alexei Fedorov , Leif Lindholm , nd References: <20220113164052.20841-1-quic_rcran@quicinc.com> <20220113164052.20841-2-quic_rcran@quicinc.com> From: "Sami Mujawar" Message-ID: <5e24bff1-5aeb-608f-0439-ef677e4fe9b4@arm.com> Date: Wed, 2 Feb 2022 14:52:39 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20220113164052.20841-2-quic_rcran@quicinc.com> X-ClientProxiedBy: LO2P265CA0156.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::24) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3d62b944-818e-4dbb-fd4e-08d9e65bae3a X-MS-TrafficTypeDiagnostic: PAXPR08MB6623:EE_|VE1EUR03FT008:EE_|HE1PR0801MB1755:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: r3BbBQsuN+aaAaNcq0yVF5w3yNwfea1Doc0DnihoueiLiFUkZDSGQI/qTRJLM9AZwJ15VLBj0dHGcj3g7ghUCvqg0WCIIt9LstO/EUlhxaMpryJyNeKGEznj/fWQdCE8s9kPLqsSFDsf8AR0bue5kKny/6OvJGcy8lKswH4Dc+QNxPmmCKMpSPgl0dYZSrYolo1Rg/P9hwVdC5LJYnWklGTwhs6kFspRMiN+fdFtFiN5dsqD32z5SHfOLTTfrNmAltmr/37ABwx3tCfysUJ6466TpiE6aTotR5PTyvIIliUOcjY1H6Kalep8DnsFrZjGYpRY7NnglM0/S8F/NOcvUx1cR5ShAejApQPDm3zCAN0tkzhvB1FZrvrAL1eSVP35pka640pIe9v3UnOZ+mzNeckNlneQulGsICT8K8rgfiuLOtYyFeVHJbq29HhkfxcTaBlsyw2vwEHXJTFrKa/GIDh9lwK8xjw8I2FcPNJH4wc3/j9WhX9+L47peVqEXg2qnkljpUvXfgTn+WaZtgm+gyKN5o9ydPOxPiW2zoNl1LHvHYMe7Pk0GsCJFcbE2DwhTge5xCLKcvOM2NRufYGYUQUXUOvtDO50o+UBQjVGsUwlPtIKPaoGXxneY0XxySKutWBqGAMKAjmuD7CCIC8zd/baYZsVYjyoKTmpsTEkCzPN0cAcEOnj5vP2DpluFytOUFIC/aB7xHnslt9ba4PQllygKrOR68GZNSJD0r7LZIHdo4IoJS0smhi4ow/4fRN69xdavlBIdnY4OxJnw3iqnQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(8676002)(508600001)(8936002)(86362001)(66946007)(5660300002)(38100700002)(38350700002)(44832011)(66476007)(66556008)(31696002)(6506007)(33964004)(6636002)(26005)(186003)(110136005)(6512007)(2616005)(52116002)(316002)(36756003)(6486002)(2906002)(31686004)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6623 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ab544983-a23f-4445-d051-08d9e65ba876 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YR2RApVkr+WeMyTB/THK75deSE0wySgc7uTqz2CBirzY5c6TeUItoDQzZU6/4MktQ/SKEiG1jjNY3EfT6ojIhB6QDzD0vssP6m0SWOUpswE5aC/6AYlUsvMHVbjuiR3q0+0wn1+Dg9oTdsDWEWwOjH/9KwW8otN9IzH3KFeA4ujyOiWwnU1tDSPBmrj3P8yM46I26I0t7QGoPYXwHfHEdXwtKdNZ96G3yIX7xb9cnNwqowLgJBNy7Qbk096uhmx3cCZVqTBERvXBc1FtEgIZ2ddkSrrcN6BoMtBLkIFLAvgQFItExb6SoVpivT9uD9FslTs0plaOC6JqVUeWg1RQgJWo57r75JfZJEpkXWD8rCAZWDcGdKdBuGA+Aky2A2/xsLk/lMzphyY4RVzaHjJ8NTDXOXX52zP2g6PIzpsjxfk66AWBHRg3kuY7mZ9OkwHIAo2MeJWngBLQY9RYcIqTsNmJg9/iff9E8kGGmLsQSLX/oYzfCHvGso81tRLaDZNMonnzLmJWBzlq1lrxBLQHukd2GtL+gGHkzF/3sB1F3SW8Od3+3CN6+gTod+ZID6CoJXalCnC8oc0rPAnTlHfZt7iPpJbl6h9033NClhg01K5m0KTMTR/B5VQu/T8BWrSIZxjAeA6yiSkdy16N9iI2LF0mqqBwruGB5JmTODH8MQyQId5c9sYD3Ho2BBljmA7O9h3WC2aebV1TewJ1rc9pew== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(2616005)(26005)(2906002)(316002)(186003)(6636002)(110136005)(6506007)(36860700001)(6512007)(70586007)(8936002)(8676002)(336012)(5660300002)(86362001)(44832011)(70206006)(82310400004)(31696002)(31686004)(508600001)(83380400001)(47076005)(81166007)(6486002)(356005)(33964004)(36756003)(53546011)(40460700003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2022 14:52:48.6369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d62b944-818e-4dbb-fd4e-08d9e65bae3a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1755 Content-Type: multipart/alternative; boundary="------------7E9C29398FD64865B6FAF05E" Content-Language: en-GB --------------7E9C29398FD64865B6FAF05E Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Rebecca, Thank you for this patch. I have a minor suggestion marked inline as [SAMI]. Otherwise this patch looks good to me. Regards, Sami Mujawar On 13/01/2022 04:40 PM, Rebecca Cran wrote: 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..80d05f74ee69 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 ); +/** 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 +AmlCodeGenRdMemory32Fixed ( + BOOLEAN IsReadWrite, + UINT32 Address, + UINT32 RangeLength, + AML_OBJECT_NODE_HANDLE NameOpNode, + AML_DATA_NODE_HANDLE *NewMemNode + ); + /** Code generation for the "WordBusNumber ()" ASL function. 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..fb18c5a77e2f 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -609,6 +609,63 @@ AmlCodeGenRdDWordMemory ( ); } +/** 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 +AmlCodeGenRdMemory32Fixed ( + 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 ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPT= OR; + RangeDesc.Header.Length =3D 0x09; [SAMI] Would it be ok if I change the above line to RangeDesc.Header.Length =3D sizeof (EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_= DESCRIPTOR) - sizeof (ACPI_LARGE_RESOURCE_HEADER); before merging? [/SAMI] + 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. The Resource Data effectively created is a Word Address Space Resource IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. --------------7E9C29398FD64865B6FAF05E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Hi Rebecca,

Thank you for this patch.

I have a minor suggestion marked inline as [SAMI].

Otherwise this patch looks good to me.

Regards,

Sami Mujawar

On 13/01/2022 04:40 PM, Rebecca Cran wrote:<= br>
Add a Memory32Fixed function to generate code for the corres=
ponding
Memory32Fixed macro in AML.

Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
---
 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..80d05f74ee69 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
+AmlCodeGenRdMemory32Fixed (
+  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..fb18c5a77e2f 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
+AmlCodeGenRdMemory32Fixed (
+  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 ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPT=
OR;
+  RangeDesc.Header.Length      =3D 0x09;
[SAMI] Would it be ok if I change the above line to
RangeDesc.Header.Length   &n= bsp; =3D sizeof (EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR) -
       &= nbsp;           &nbs= p;            &= nbsp;   sizeof (ACPI_LARGE_RESOURCE_HEADER);
before merging?
[/SAMI]
+  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

IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in any medium. Thank you. --------------7E9C29398FD64865B6FAF05E--