From nobody Sat May 11 18:40:54 2024 Delivered-To: importer@patchew.org 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+112283+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702291063720105.94624871711017; Mon, 11 Dec 2023 02:37:43 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=19oP4jP0AEetw76RVgqTCDmMzWa7c9CbW/NTi/pU+gI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1702291063; v=1; b=mgIykNFJE9wtMphqr860lToyWFjtXEjsUhK0Wh8tmO+62Jko2VuuSuXKP4Av+8jpm0ogLC87 SVsuA/lLYWjCroH/8eEnOIoqkioBhInPq8jcS7PiRAPvfLv+MnOFAyBG6dNcCGgM++GSHLK1wyV sVKC916c7aidkGFW5p9i9Zq0= X-Received: by 127.0.0.2 with SMTP id hQ8DYY1788612xUjXEQjJg1D; Mon, 11 Dec 2023 02:37:43 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.55]) by mx.groups.io with SMTP id smtpd.web10.5611.1702291062361975322 for ; Mon, 11 Dec 2023 02:37:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gcW+IDP/Kmm05obx2XKNDNp3sqqhS1VzxL+mBdTOUIpGQSn0ahOIS2h/c70orge5YY7yy4c2JNOkwgMbBtx1Jl8dbvBN9www28eOJC0NsmWMTWAW1V4KKLotXACKOmzWZ1siNeJBkzXzXBI7WTW5qhCA3J7dLauj0AGcMwlWzq+BOeHaSRS35re7v+dFi2DmmmqTPA1a715Jga5ZEYen28XwJ4bLghWZjbLGJzCP8uIDATMwaYNKAwJkqX63OI7fOYre36Mn0ERoKD0umlRFQxv8v+0nFzErIaDeJQ20xFyy2RFM7yMEiNVE5N4TM9cjG6O0cOFqIZPbvTEjIoJ61w== 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=kS9MMwBZ4cFDzPwKn5dgKFC3GuyMq1ZN7j9sRnTgvz8=; b=n5dHHl0yYbcjuz+Jd3+RCz4z+o+VlbiW9MSBaRPmcdSB2gSwFW++yxEHA6IdTCmT0DV3gfmjc94AVIaWlsMgbOGc2TDyZPrmHJGTm1tiNNBZXTTfB2iH6PznWrBlFhqQVr6cJTb4gPWLUiM979Pek3FqF8kqBpC5c8PG/nLhh8FAh2RllIgtVrb0yCTBBmwm8JOthGndUHQrqssM6LbIv/BeX3fUJSgRL2Oi67uhaIaHpIkETBunq8eEkYNV4cXmqPECURWJcjGtRK2cTOqcKq4MFfE2PxTYiSjJ0Yf22zXisNJtnw6dRzVaqiKBMHdXBDvjwEeYq3hlRhlQf4grAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from MN2PR03CA0020.namprd03.prod.outlook.com (2603:10b6:208:23a::25) by MN0PR12MB5812.namprd12.prod.outlook.com (2603:10b6:208:378::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:39 +0000 X-Received: from BL6PEPF0001AB52.namprd02.prod.outlook.com (2603:10b6:208:23a:cafe::5) by MN2PR03CA0020.outlook.office365.com (2603:10b6:208:23a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:37:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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+112283+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB52.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:39 +0000 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:39 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:37 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 1/5] DynamicTablesPkg: AML Code generation for word I/O ranges Date: Mon, 11 Dec 2023 16:07:29 +0530 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB52:EE_|MN0PR12MB5812:EE_ X-MS-Office365-Filtering-Correlation-Id: 7af781c8-3770-431e-205b-08dbfa3532de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: zKR8D5mAqFGN1Sj2wZ93E/2V+L/09oGiWeZWOlFQVITaafGOZK2PoIkFLLrd3gOB32sMKFtdK8PRffUozFDHgiqz1NKtO2QFWqyQbMJn5MGDcSNS6Xo62y6yLeb3M9tqO+/558ci3ZCpJxJTFRklX6btSxEq4rbnOUrKdpRfUPfofTH71+OdIB1J1l1TAfrEEmU9/pjfNK7SJ/xNGU5llb2MvIfl7l2Y9eYybU0QIOsYysg49KQ4U5fxIXWC3ZkA4qC4mQxgyZvIa6e0rLrgKgSirKWf6xW9+Uis0Cwct7KyxbS/PIPJ1S9hfUyS6vr/jQDGAH2LQkv65dQwWbNWxOAZkOzFzsPCWsbwZiUs6D4X0d46rxXcc2Lv+ejeK7576iJiw5IBu2O/JJWtJAxfnuJVIlnefAVUm51YKHhG3Rd8EljoXlZ324VxvyhDPZyYn6ER+IOeXrFfuWy8qoy9OQctlyfKDyT2Mkt4xdsebQ02+B1o8kyyC7nrhZ+1jSHSFLM9V+gMaJruwUh3+WFI2+LHQBQaGHxN3CdGBoHXx1CJHd3Jh3c583F0lymFDN6HUPcboRx/SIgUpUw0850D88TJQt6LIcGS0JvEzXcJpbQgxKmxMviO8dfardzhyR95GqezPPgYrhjqwvtsCUKsfXHtr6NUP+bkhQzycGiZNrhdL2XNiypr1hGKk5e2sNV5Bf7ch9LnLIh8COjka9kwIs7/YeYr+HyD0KofkHAcnaVFLbsygo6cd2UBioo1fXWdvLSRPbckYB0AWHsP31OScg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:39.6217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7af781c8-3770-431e-205b-08dbfa3532de X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB52.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5812 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 Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: axc8am5kJXlWCKvw4p8WbEP0x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702291065224100001 Content-Type: text/plain; charset="utf-8" From: Abdul Lateef Attar Add helper functions to generate AML resource data for word I/O. Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar Reviewed-by: Pierre Gondois --- .../Include/Library/AmlLib/AmlLib.h | 65 ++++++++++++++ .../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 88 +++++++++++++++++++ 2 files changed, 153 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 71e8539b30..5e340b94ce 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -2,6 +2,7 @@ AML Lib. =20 Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -724,6 +725,70 @@ AmlCodeGenRdWordBusNumber ( OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL ); =20 +/** Code generation for the "WordIO ()" ASL function. + + The Resource Data effectively created is a Word Address Space Resource + Data. Cf ACPI 6.5: + - s6.4.3.5.3 "Word Address Space Descriptor". + + The created resource data node can be: + - appended to the list of resource data elements of the NameOpNode. + In such case NameOpNode must be defined by a the "Name ()" ASL statem= ent + and initially contain a "ResourceTemplate ()". + - returned through the NewRdNode parameter. + + @param [in] IsResourceConsumer ResourceUsage parameter. + @param [in] IsMinFixed Minimum address is fixed. + @param [in] IsMaxFixed Maximum address is fixed. + @param [in] IsPosDecode Decode parameter + @param [in] IsaRanges Possible values are: + 0-Reserved + 1-NonISAOnly + 2-ISAOnly + 3-EntireRange + @param [in] AddressGranularity Address granularity. + @param [in] AddressMinimum Minimum address. + @param [in] AddressMaximum Maximum address. + @param [in] AddressTranslation Address translation. + @param [in] RangeLength Range length. + @param [in] ResourceSourceIndex Resource Source index. + Not supported. Must be 0. + @param [in] ResourceSource Resource Source. + Not supported. Must be NULL. + @param [in] IsDenseTranslation TranslationDensity parameter. + @param [in] IsTypeStatic TranslationType parameter. + @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] NewRdNode 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 +AmlCodeGenRdWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 RangeLength, + IN UINT8 ResourceSourceIndex, + IN CONST CHAR8 *ResourceSource, + IN BOOLEAN IsDenseTranslation, + IN BOOLEAN IsTypeStatic, + IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL + OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL + ); + /** Code generation for the "QWordIO ()" ASL function. =20 The Resource Data effectively created is a QWord Address Space Resource diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceData= CodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC= odeGen.c index 0bc1c1d119..60fe69ba6d 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -2,6 +2,7 @@ AML Resource Data Code Generation. =20 Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -878,6 +879,93 @@ AmlCodeGenRdWordBusNumber ( ); } =20 +/** Code generation for the "WordIO ()" ASL function. + + The Resource Data effectively created is a Word Address Space Resource + Data. Cf ACPI 6.5: + - s6.4.3.5.3 "Word Address Space Descriptor". + + The created resource data node can be: + - appended to the list of resource data elements of the NameOpNode. + In such case NameOpNode must be defined by a the "Name ()" ASL statem= ent + and initially contain a "ResourceTemplate ()". + - returned through the NewRdNode parameter. + + @param [in] IsResourceConsumer ResourceUsage parameter. + @param [in] IsMinFixed Minimum address is fixed. + @param [in] IsMaxFixed Maximum address is fixed. + @param [in] IsPosDecode Decode parameter + @param [in] IsaRanges Possible values are: + 0-Reserved + 1-NonISAOnly + 2-ISAOnly + 3-EntireRange + @param [in] AddressGranularity Address granularity. + @param [in] AddressMinimum Minimum address. + @param [in] AddressMaximum Maximum address. + @param [in] AddressTranslation Address translation. + @param [in] RangeLength Range length. + @param [in] ResourceSourceIndex Resource Source index. + Not supported. Must be 0. + @param [in] ResourceSource Resource Source. + Not supported. Must be NULL. + @param [in] IsDenseTranslation TranslationDensity parameter. + @param [in] IsTypeStatic TranslationType parameter. + @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] NewRdNode 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 +AmlCodeGenRdWordIo ( + IN BOOLEAN IsResourceConsumer, + IN BOOLEAN IsMinFixed, + IN BOOLEAN IsMaxFixed, + IN BOOLEAN IsPosDecode, + IN UINT8 IsaRanges, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 RangeLength, + IN UINT8 ResourceSourceIndex, + IN CONST CHAR8 *ResourceSource, + IN BOOLEAN IsDenseTranslation, + IN BOOLEAN IsTypeStatic, + IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL + OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL + ) +{ + return AmlCodeGenRdWordSpace ( + ACPI_ADDRESS_SPACE_TYPE_IO, + IsResourceConsumer, + IsPosDecode, + IsMinFixed, + IsMaxFixed, + RdIoRangeSpecificFlags ( + IsaRanges, + IsDenseTranslation, + IsTypeStatic + ), + AddressGranularity, + AddressMinimum, + AddressMaximum, + AddressTranslation, + RangeLength, + ResourceSourceIndex, + ResourceSource, + NameOpNode, + NewRdNode + ); +} + /** Code generation for the "QWordSpace ()" ASL function. =20 The Resource Data effectively created is a QWord Address Space Resource --=20 2.34.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 (#112283): https://edk2.groups.io/g/devel/message/112283 Mute This Topic: https://groups.io/mt/103106347/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- From nobody Sat May 11 18:40:54 2024 Delivered-To: importer@patchew.org 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+112284+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702291065665429.15498831390994; Mon, 11 Dec 2023 02:37:45 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=FCgla24Opxa1O6ovV2pRLQn33NvwbJKIIXL6kS6NSFU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1702291065; v=1; b=jd/fDHdBYAbs5XeHSoizjM3Yeuq9/TXBg2mQEo5nDNdeBvYP2wyWM90/5jpItHVm1Qmo2u3v cfWMExfiwoVCOYsMqx3SDhy/k9Oh9qnZ8SPFplo1Q9nJJ/anJ1/IM8M0Uob/pAtwBjiss8S5+Bg Bt19o+CVYfva4vNXLoWzocI4= X-Received: by 127.0.0.2 with SMTP id P71QYY1788612xTUodKp0ZUD; Mon, 11 Dec 2023 02:37:45 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web11.5562.1702291064391208119 for ; Mon, 11 Dec 2023 02:37:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oa+dxvImg+8Cg7XeyHPF9w3d4XCkWnd+jZ8b+mNqSqyWHPP62Qe3KmM6jbocRQGQfnVV0kf3VFL+T+XPnjrVDC5H9SJC3JuZ8hm8v5nFV6HSohj6Co+tIfEAOJB87QLvYLPbdm6XvGTuST9ha6cjLtHwmh1S+UYGjKHQDJARdBuivY0+viIArczvB3aI+wN1nE4aqIPk7ngEjW/tyKpsQBtX5sRNOssHN8foLhgOUZCOqA+l3N7MkePcI+ep9hltq8Du6C1cbLtToLFKGLKPDorjqhJQ6p3DCF7TI9wkWQKvnvO+ryUjjSp6qv2twBeEWkep/gHRV1BGY0t3L3ei4g== 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=X7rLn+dce5q8QqQVI4aPAz3UY21Ary1U67HW/Sc4uu8=; b=FoJekBxjyTo2zbo2duH8YujgUqMu62oMlfe3ie9m8ZiXAGJz1ek4C1sJk2q4L2UNLQmjEST7sJN9GqGRvQhZO9jVSHm2B5AKrvgpG4Q2tFrYYHA7eYt1y/+R1ygrToqQRa3QR0Fc7iaVYDlDmLDx1CKETW7VYwN4GV3+S1vxaUAWHWQtnKpmtU3Z2hCeEfDFvL540xYPkrVaYZbb9WX67lWxd6//Yro3LZjfnXP6tgVRCMCATZs/s6/XYL1xD3ovcEFMIGlrNeeSia0lGFPfXCDVWH6u/ttRlRxBlg/1lmPoynIP92xxsE1HBwDZg8OFpnvRmo+vcAZrBb5cId5hpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from MN2PR05CA0037.namprd05.prod.outlook.com (2603:10b6:208:236::6) by SA1PR12MB7366.namprd12.prod.outlook.com (2603:10b6:806:2b3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:41 +0000 X-Received: from BL6PEPF0001AB55.namprd02.prod.outlook.com (2603:10b6:208:236:cafe::27) by MN2PR05CA0037.outlook.office365.com (2603:10b6:208:236::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.21 via Frontend Transport; Mon, 11 Dec 2023 10:37:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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+112284+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB55.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:41 +0000 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:40 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:39 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 2/5] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters Date: Mon, 11 Dec 2023 16:07:30 +0530 Message-ID: <2e3491a6ad8a6c289f6f6ffd6f8f242cb56eaa57.1702290369.git.AbdulLateef.Attar@amd.com> In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB55:EE_|SA1PR12MB7366:EE_ X-MS-Office365-Filtering-Correlation-Id: 24ac09ff-3d7b-4cce-49f5-08dbfa353401 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: DwvdefqzaSFIHmrEqOtOD63YnFq/aHWPGXGRhQxLn3JLHVYMFT0ZUlwrsSO3CnV1qVM/ucNT2xy0EkdLvRa2bX+9MOPjToIyYzgsjDpq02VR+kyue9Ii2pKA1vNdvAhaw19tC44mrsdbdz2sIfbVUQBcqDXxipEwZVxQ41mgl92zhUdPbVAMQxDsZzHPfB/H5ZR1Wr5E1g9SKI2nIahZ9kx+rmZMXd5KaKZCtmyTuImjarXdMjuP3Albcevv9gLm8bqFqTUkR/En1/TmxLvXjjFUqUEnzCLoIthWDU4VlkrsThkv2QFQWFtQW1BIXvmM1HUt7DMCddAhdnm1sHo3AHHpeZG9BTSIJzst2APEZ6i/bf1R+pq/OiOCcIJZPrGsHc/uglUF8O7IzuiuYI3BXDxg/sx7QzO0cZvQ6FAx4/A42Ob7Jl3NcuW9MsIz9W470NVLH3EdyWrUg+sT+N7Xs5owHokuLWgaacCfcLvJOo5h5PmCUe40yDM/Z2htn6ku37c9hYLRmHnkROyKZRbFOCSYzcb4oNU/aBx2cv6wU2vl91BGzSfi3MjU4X7FZSlFlNq6z3dHo6hdTx7++/99MV1960s6TxULd10stihvSnyAzHDWkGW0hTwGWU/7f2QIH7zV0A3pcr/5V0Z6Au2gbwLLamadC9+u+jI9r9Q3i5XzLgFAZ3pXKbMCE21xeEksLiCMJYnTyGrAQYaQfay8Jec04bFk5ON8tMCQRf5Xjvy3cxxGzKh6h5MhnD3PC7pqQNc4hKtBx5eV5sLbG/MxUQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:41.5298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24ac09ff-3d7b-4cce-49f5-08dbfa353401 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB55.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7366 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 Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pURQiMrSDVPbp859y5DCDACGx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702291067128100006 Content-Type: text/plain; charset="utf-8" From: Abdul Lateef Attar Corrects the parameters of AmlCodeGenRdWordBusNumber() to UINT16 to generate word bus number. Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar Reviewed-by: Pierre Gondois --- DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h | 10 +++++----- .../Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 5e340b94ce..eb8740692f 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -714,11 +714,11 @@ AmlCodeGenRdWordBusNumber ( IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, - IN UINT32 AddressGranularity, - IN UINT32 AddressMinimum, - IN UINT32 AddressMaximum, - IN UINT32 AddressTranslation, - IN UINT32 RangeLength, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceData= CodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC= odeGen.c index 60fe69ba6d..46243f981c 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen= .c @@ -848,11 +848,11 @@ AmlCodeGenRdWordBusNumber ( IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, - IN UINT32 AddressGranularity, - IN UINT32 AddressMinimum, - IN UINT32 AddressMaximum, - IN UINT32 AddressTranslation, - IN UINT32 RangeLength, + IN UINT16 AddressGranularity, + IN UINT16 AddressMinimum, + IN UINT16 AddressMaximum, + IN UINT16 AddressTranslation, + IN UINT16 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL --=20 2.34.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 (#112284): https://edk2.groups.io/g/devel/message/112284 Mute This Topic: https://groups.io/mt/103106348/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- From nobody Sat May 11 18:40:54 2024 Delivered-To: importer@patchew.org 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+112285+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702291066717651.3726256596298; Mon, 11 Dec 2023 02:37:46 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=oq1nxx+WPD6Vmyw1pQk7f4KlyBd1bcuNz7ok7/KsVc4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1702291066; v=1; b=ITCtk1FwG2xsfER7zjRZUFgrCHKVUdVuDeYC1mybiNTqvEOThf1hAGILRW9INSMMYyCR+yVD Jd58xKMniY+9BsNo5ppu1Qt/lqBX8dShInU/AeiIN3wSkCmEVBoaNDV+6bA/T6xmYnAtQ6+Zbdi mjCSE9+GGGKd6o3Xx5AOthAw= X-Received: by 127.0.0.2 with SMTP id dBDEYY1788612x7vdVbjMooI; Mon, 11 Dec 2023 02:37:46 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.63]) by mx.groups.io with SMTP id smtpd.web11.5563.1702291065753939261 for ; Mon, 11 Dec 2023 02:37:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UrrW8w4Z2yzh5UjXus5K9CPhCOtMf3y+oNimad9yrcKWX0D8Luleq8/D/PqKe26twFms6A480FhrsHplhsjbROm8WFBsa6gEpem3ZvJPNGaKM/4/BdPeqEjKOcfaOhV95n7elzpGic2SJDqLHogOqbuGPuyjVxY3nGsLm79O/bD0bip7RaI2j+HYlUOiYcfishqA+ZPiUJ96Ur3rCOLcMnkkymrWrh89arJzyJJPulg0ESqe/PMACw1Lx6k736O6r49CcQ1IJ3gwfPTRHHZNlW73fEjXeiNoXJ0rRZJt/bTQlPYOwYneYHowK/DhZFt+aJvTcj6sPIrOytxRjjLJbw== 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=/Kb5JpOj9coXlncB+5Iq6ppdMQxvnqBqbcCRPEJWFD4=; b=IwgiNRf7GSCZczYqTifKePsFhUGmGBehcNzzrk2BILIl2nlDq+DwVP4XUSMySmyA+Zpl6sCg8JMsu/BPff8F/dSxzRNqDrnH48wEuzL7CBR9VV3tekcw/xypAbPCWLYf3UNpkFtSGfwuXcqY6ZDFNHJ+5Af85AKXPJ4jRYnjSwKnLe8dcy6xCVoibCy6XxDAttPTMaD2KYQpxF49UV4j2OMH5snTq8OlDfKVPgDchMAYBF4YsZi0tsSHxa8Z7LfpPILSb1NH/y2dj6JnUr3No8fnq5droFGrllVe5E3qo5QL0olvonAWZxE2okTDwY71BKyfn3luwTwd1w+kh5Az6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from MN2PR14CA0023.namprd14.prod.outlook.com (2603:10b6:208:23e::28) by CH2PR12MB4070.namprd12.prod.outlook.com (2603:10b6:610:ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:43 +0000 X-Received: from MN1PEPF0000F0E5.namprd04.prod.outlook.com (2603:10b6:208:23e:cafe::d3) by MN2PR14CA0023.outlook.office365.com (2603:10b6:208:23e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 10:37:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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+112285+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C X-Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000F0E5.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:43 +0000 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:42 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:41 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 3/5] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION Date: Mon, 11 Dec 2023 16:07:31 +0530 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E5:EE_|CH2PR12MB4070:EE_ X-MS-Office365-Filtering-Correlation-Id: f7f942c1-0923-4943-f021-08dbfa3534ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 5IY31DDNbpS9JXsawb7/Nf4MiWOeQlNTSmNMuIa+DrbA2fKSOmMKQ6fdfUUBWj9+6YBmpyPsZnupeEHWpx+ee0GFyydM+CRLq3Ybfodq/vTckIyXxbNN/DNKSYJ4wIBJj826uCpDXyetmffMmzLiq6f/zFF3uqmqOSssCZxtYFVTT6DNnhoPVNPlDvwCYCreg/Iu+L23bi1xzbLuehvcrzsGVh8kbzFbEnIMWJMLI+Q+67g0dhA5SUQ/OUgY4vH4Jqy9LCCrOZMLwIjH9+/0gFoJclZVqjz/ldb6qWlbOQm7tCcn+upmvnVgfHraD0eQLew+b9sAK/wzyUz617u9MK1i2je4F+30xDbCsP3SzBKcKKbVQB9N9XpvOSr1dFH9LoDqj6TXOVP5BVDiVLOib1dUek1MvzzCYxBMpbP+lv/aVxGpww9zwaemvPemfQzm+sYKwmyl6l7friSfVRLDOniBhLt+rTaCup922hS00yqB8GPAJhHTaM6NKxmBDwDEEhrE8N4V2ApaNjfjoWZBLe6gDYdNq+O87Jg9JumWeZugT8eM2JKhi47s7Cmd98rwwK3s+2w08xtevIa8Nrd5dPaVuf7CCSKR1kvBNn9VonrAh+o2mcF8PABEA1Oc5KzQHPj3mndOVUNkDIhj1N1madqI5CTNGNMRBzaOTnPqAZwhinBSfxK43FJZxrt/LV65Lsqo2x8JDMQH+4/OC0jhF9bvS+/axVLydrG4DpdQLZqRmMCVVL2cBThX85iScBW1bjFEgZFULfH/vKWvrb1GBA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:43.0611 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7f942c1-0923-4943-f021-08dbfa3534ea X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4070 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 Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vnGPW2qglVeSrlU94VZ2Ragwx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702291067113100005 Content-Type: text/plain; charset="utf-8" From: Abdul Lateef Attar Corrects the function pointer typedef AML_PARSE_FUNCTION, otherwise some compiler like VS2019 gives error. Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar Reviewed-by: Pierre Gondois --- DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c b/Dy= namicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c index 8e584d4930..d3a51a94c7 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c @@ -100,8 +100,7 @@ AmlParseStream ( **/ typedef EFI_STATUS -EFIAPI -(*AML_PARSE_FUNCTION) ( +(EFIAPI *AML_PARSE_FUNCTION)( IN CONST AML_NODE_HEADER *Node, IN AML_PARSE_FORMAT ExpectedFormat, IN OUT AML_STREAM *FStream, --=20 2.34.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 (#112285): https://edk2.groups.io/g/devel/message/112285 Mute This Topic: https://groups.io/mt/103106349/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- From nobody Sat May 11 18:40:54 2024 Delivered-To: importer@patchew.org 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+112286+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702291069033954.2955599991132; Mon, 11 Dec 2023 02:37:49 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=mFgVCJ98QJPJZP+RTTUyX9Rr34V+UfWuj3FU5Gxb4dQ=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1702291068; v=1; b=JFtYIIzhxrgOf0x0XgGF64b61K5hKW4kgjPK7yvGMZDHnmsYbcTHMUZa4t/8e99jIyXKOFPP mlv7PhTDlgR9pcNjNl9afSJYkOEaTJouSH/2uh8XJpux/0S24sjlwku9DhS7Yy+sCgICAcIPYns uuT8uf7VItGkFBgMef16citM= X-Received: by 127.0.0.2 with SMTP id TMqTYY1788612xz1f7rJTxLO; Mon, 11 Dec 2023 02:37:48 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.71]) by mx.groups.io with SMTP id smtpd.web11.5565.1702291067897939080 for ; Mon, 11 Dec 2023 02:37:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mc8vDhRLBWLMXcNlzRSeZ3rkugQ+JFYONCrDrSBkps6f1NxG/NBHBlG9hfTvNSNAXy40LmxBD3sn3fwl/2vp0xVDJn/t+AU5YbWx0vmTIikJAhT6kTsgMmG7fZZ5wp0VrbzV3w2kiJ93kVn0NHgbcUiI3aAsqU752gU6reSXBzqXnjIDQ8rnnLjHIqWT35z32B/LHlfDZvZw4id6FKUbYfB25l1ZnK2yJ01Hzu2Yjz/H9SNL5Uje9WgHeELY9rotVN3iiB4iZpkJR2hPPubs6uHrsCZBcqJENEB7bHOzOxf1qaVAl+NEjLg/xn7uvHBltEgC7ttigQ/UFgaNZE4Tig== 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=4/S/aGnXxaJcojXQNWQP0SCxpl4v+oQOdLsMKZU44po=; b=l+Gl40wFShoTbTftOJpKx1grcY+pagPcJtWEI/I8e6rVMbufBMiJiIlQ8T++1h8ax7Dt8Y+AbG1dSP6ubJAu7uuHGG+5TG6+51w0icxkqMHU4AdF+ofDUWWWFOqciSNClvX7j7yyfTxTXEMCmlUVYuob8YgrXjbR3AhPddAgb8RQsp/Q27DONpNTU0qW0PXBrvjWYQjd6J5DHcu+08hmIm31vlj8VYm47AhFpcOUoP3NSV47btJVRPPL6iKHBwQkukKWY+fCxIZ63AaB0tpwR/2pvM2eMNWvyTQE1W0LfCIEYsg0fCTQIgoX2DSafZQSsWGhnspxSXBlDF9NFIA+pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0188.namprd13.prod.outlook.com (2603:10b6:208:2be::13) by CH2PR12MB4874.namprd12.prod.outlook.com (2603:10b6:610:64::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:44 +0000 X-Received: from BL6PEPF0001AB54.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::ed) by BL1PR13CA0188.outlook.office365.com (2603:10b6:208:2be::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.21 via Frontend Transport; Mon, 11 Dec 2023 10:37:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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+112286+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB54.mail.protection.outlook.com (10.167.241.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:44 +0000 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:44 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:43 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 4/5] DynamicTablesPkg: Adds API to generate a method with ArgN Date: Mon, 11 Dec 2023 16:07:32 +0530 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB54:EE_|CH2PR12MB4874:EE_ X-MS-Office365-Filtering-Correlation-Id: c5050529-5feb-4c7e-40bc-08dbfa3535d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: h3kSdFxYha8x4Nwy/7UQ9yjrryJp5NEbcY5JUFdQfHc7qxsnAHmwS/OslTo8QKaAAAm7t+1Ww5vS4iXNAWg+fktqkGvaLXzk1DO5CGhbEs1lI5ic2O7oMu7XRUhcVT+TOjNR6mCwr+SR38fR0Mhj5g1RyPnyKBAvjILUyT88Fvid3/EWZoTqr/dbZ+gryPMYTVm4UQ9LvNlr8zWF7LzFCSzbrKGl6Va1i7FT70VKN42n+d1qsQRj/QITWDizkdZV8Yev3Z0dufbYgWVDg3URtFe1Yz1Na7FcR8dLfBBbH4WtgHh4W0Ku3VhdEnS9RPeiKh2Es7fU8FCDIRbKLQ74f/FW5anKWhkfL7HeJk3XG6OC6O+03A5mpoN4Cp4JssZk/oA1YQ2+kCcZC6aerpHzO6T8ugVCmx8pNL/Uoa4dX2l4ifasgH9DEd4l3/QFAmWVBwFYh+3hq8fZHvf7eQj25/MOjnR9u2NSmKVh+HyJ48LP1uP7kA4DjCXYSza7RwJg7hIhwlK7MR+FjjWwrnyMUJq4Z+a9P65PDyqzqfZh0B0IFLUJvJbUR92oKloZ3Bmb+g9uo9RHHFgLeXBIC8k9zQ2vi3Wo9AwxOAAB4UTvdejLbNu2l7q98d/sG2pkP3av4ASPdNJbGq2QiQOlQi4Y/Yji9569IQgArhjqAfrEjVFqb+AhRdJVfUvsRjXe3ON+hLnkH4nEyfX3MYv6SzpsvVrDSIfkOXx+eaAP+E8PirdIUEm8xN6aiFgsQQS6OZt87CmkYpdiUF+w46I5LBylNQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:44.5795 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5050529-5feb-4c7e-40bc-08dbfa3535d0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB54.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4874 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 Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: wUSwBKoWv7iWLoyW3ptbGj3hx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702291071306100004 Content-Type: text/plain; charset="utf-8" From: Abdul Lateef Attar Adds an API to generate a method which invokes another method with arguments. This help to generate dynamic code to invoke another method(might be in static ASL file) with build-in argument parameters. e.g: Method (MET0, 6, Serialized) { \_SB.MET1 (Arg0, Arg1, Arg2, Arg3, Arg4, Arg5) } Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar --- .../Include/Library/AmlLib/AmlLib.h | 46 ++++++ .../Common/AmlLib/CodeGen/AmlCodeGen.c | 152 ++++++++++++++++++ 2 files changed, 198 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index eb8740692f..5ab205b5f0 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -1693,4 +1693,50 @@ AmlAddNameStringToNamedPackage ( IN AML_OBJECT_NODE_HANDLE NamedNode ); =20 +/** AML code generation for a method invoking another method + with ArgN arguments. + + AmlCodeGenMethodInvokeMethodArgn ( + "MET0", "MET1", 4, TRUE, 3, ParentNode, NewObjectNode + ); + is equivalent of the following ASL code: + Method(MET0, 4, Serialized, 3) { + MET1 (Arg0, Arg1, Arg2, Arg3) + } + + @param [in] MethodNameString The new Method's name. + Must be a NULL-terminated ASL NameSt= ring + e.g.: "MET0", "_SB.MET0", etc. + The input string is copied. + @param [in] InvokeMethodNameString The called/invoked method's name. + Must be a NULL-terminated ASL NameSt= ring + e.g.: "MET1", "_SB.MET1", etc. + The input string is copied. + @param [in] NumArgs Number of arguments. + Must be 0 <=3D NumArgs <=3D 6. + @param [in] IsSerialized TRUE is equivalent to Serialized. + FALSE is equivalent to NotSerialized. + Default is NotSerialized in ASL spec. + @param [in] SyncLevel Synchronization level for the method. + Must be 0 <=3D SyncLevel <=3D 15. + Default is 0 in ASL. + @param [in] ParentNode If provided, set ParentNode as the p= arent + of the node created. + @param [out] NewObjectNode If success, contains the created nod= e. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMethodInvokeMethodArgn ( + IN CONST CHAR8 *MethodNameString, + IN CONST CHAR8 *InvokeMethodNameString, + IN UINT8 NumArgs, + IN BOOLEAN IsSerialized, + IN UINT8 SyncLevel, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL + ); + #endif // AML_LIB_H_ diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index a6db34fb97..b05fa6d109 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -3849,3 +3849,155 @@ exit_handler: =20 return Status; } + +/** AML code generation for a method invoking another method + with ArgN arguments. + + AmlCodeGenMethodInvokeMethodArgn ( + "MET0", "MET1", 4, TRUE, 3, ParentNode, NewObjectNode + ); + is equivalent of the following ASL code: + Method(MET0, 4, Serialized, 3) { + MET1 (Arg0, Arg1, Arg2, Arg3) + } + + @param [in] MethodNameString The new Method's name. + Must be a NULL-terminated ASL NameSt= ring + e.g.: "MET0", "_SB.MET0", etc. + The input string is copied. + @param [in] InvokeMethodNameString The called/invoked method's name. + Must be a NULL-terminated ASL NameSt= ring + e.g.: "MET1", "_SB.MET1", etc. + The input string is copied. + @param [in] NumArgs Number of arguments. + Must be 0 <=3D NumArgs <=3D 6. + @param [in] IsSerialized TRUE is equivalent to Serialized. + FALSE is equivalent to NotSerialized. + Default is NotSerialized in ASL spec. + @param [in] SyncLevel Synchronization level for the method. + Must be 0 <=3D SyncLevel <=3D 15. + Default is 0 in ASL. + @param [in] ParentNode If provided, set ParentNode as the p= arent + of the node created. + @param [out] NewObjectNode If success, contains the created nod= e. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMethodInvokeMethodArgn ( + IN CONST CHAR8 *MethodNameString, + IN CONST CHAR8 *InvokeMethodNameString, + IN UINT8 NumArgs, + IN BOOLEAN IsSerialized, + IN UINT8 SyncLevel, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE MethodNode; + AML_DATA_NODE *DataNode; + AML_OBJECT_NODE *ObjectNode; + CHAR8 *AmlNameString; + UINT32 AmlNameStringSize; + UINT8 ArgnCount; + + if ((MethodNameString =3D=3D NULL) || (InvokeMethodNameString =3D=3D NUL= L)) { + return EFI_INVALID_PARAMETER; + } + + // Create a Method named MethodNameString + Status =3D AmlCodeGenMethod ( + MethodNameString, + NumArgs, + IsSerialized, + SyncLevel, + NULL, + &MethodNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + DataNode =3D NULL; + Status =3D ConvertAslNameToAmlName (InvokeMethodNameString, &AmlNameSt= ring); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + Status =3D AmlGetNameStringSize (AmlNameString, &AmlNameStringSize); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FreePool (AmlNameString); + goto exit_handler; + } + + Status =3D AmlCreateDataNode ( + EAmlNodeDataTypeNameString, + (UINT8 *)AmlNameString, + AmlNameStringSize, + &DataNode + ); + FreePool (AmlNameString); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HEADER *)MethodNode, + (AML_NODE_HEADER *)DataNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + DataNode =3D NULL; + + for (ArgnCount =3D 0; ArgnCount < NumArgs; ArgnCount++) { + Status =3D AmlCreateObjectNode ( + AmlGetByteEncodingByOpCode (AML_ARG0 + ArgnCount, 0), + 0, + &ObjectNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HEADER *)MethodNode, + (AML_NODE_HEADER *)ObjectNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + ObjectNode =3D NULL; + } + + Status =3D LinkNode ( + MethodNode, + ParentNode, + NewObjectNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + return Status; + +exit_handler: + if (MethodNode !=3D NULL) { + AmlDeleteTree ((AML_NODE_HANDLE)MethodNode); + } + + return Status; +} --=20 2.34.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 (#112286): https://edk2.groups.io/g/devel/message/112286 Mute This Topic: https://groups.io/mt/103106350/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- From nobody Sat May 11 18:40:54 2024 Delivered-To: importer@patchew.org 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+112288+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1702291072390602.6664263885541; Mon, 11 Dec 2023 02:37:52 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=NG2/q3bi5fodNpdBOoGOzHhvTYwtUQ/D7wYZytapt3Y=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1702291072; v=1; b=suXituRKyRuZjf3RMKwjJblWVCM9jGbBBqkaLOrUWBdj2tI0+Q+sRewfS9MkpeuxwdSpMKI2 Yrdv5k7u/+9OYGXNe8agd1xI/TR7TKP82XnLYfd2+TDPDuEG2diRoWyNGp9qBDNVTgmkXUnRfAn v+DMpYFT7y3nND+I1WpXwGA0= X-Received: by 127.0.0.2 with SMTP id BUNzYY1788612xnMWnGOO9F9; Mon, 11 Dec 2023 02:37:52 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.65]) by mx.groups.io with SMTP id smtpd.web10.5615.1702291071194603025 for ; Mon, 11 Dec 2023 02:37:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZSoZV47Y/2n6Dah0aSTLkpr5Sy0K1yjoHgodlOmtcepLRS5ZBDQTbSDBwpx/OaM+kqS2SkQV/iOIp2muXlbxavU0ilEwnm1I/0hC/8ZBCutN1Q9tv0UvJjFvbFTeMvED/rVoEsJMD/u/PPu0tUuws8F8R00YI+zPnlJsPW92Qj5H88PAVsZkTCOrvt6fkF/L+6AuFitlFaQHML8yrnpzeKOx3tFn4dgPKk+afFcyC74EuagVR56p7iquMT1pkbeaPhQvkiPlZInB0nZUJDOlSWpCVsdI6C1B5z896bZTARz85HrnnDY/pdw3NM5Reuxyh2+FjRHyR0tj+Gx4Py3LBA== 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=tblRJFsoWHt6PJdPqLuxuCRDaAg/s2Rj7pNuwhjVGg0=; b=ZTFhQcMesCxF8rxBisp3ZRX0mYwzZciAVr7J5x0H9muktIjnEQuslHdswegYBqh1ulLl5rl99JAY2cpmqSmQL0wxqFqgcPwtWxBOQn1dtYiFJDfJpP+89jLHQqNCTowiGnVOxWZctTfSNOGBAzia7Dwm7OsuoZjfQI4Omp/rStv8tU32kvuGVBP3fMeQKUDg1rU4BiAGiKsheyPxXhhITim/yrlxFjmX/sR5MKXDePz07i8u6vXvQir90OlZT/B285GFi8ygbbSw7eyoSzlXtJ0YCYoqMo0XmD/srog0rgRWv6XbX3tGjtWYKxmMnHbga1mQL6qdkHvVMlYfAGAfGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from MN2PR05CA0050.namprd05.prod.outlook.com (2603:10b6:208:236::19) by PH7PR12MB8055.namprd12.prod.outlook.com (2603:10b6:510:268::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:37:47 +0000 X-Received: from BL6PEPF0001AB55.namprd02.prod.outlook.com (2603:10b6:208:236:cafe::a) by MN2PR05CA0050.outlook.office365.com (2603:10b6:208:236::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.21 via Frontend Transport; Mon, 11 Dec 2023 10:37:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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+112288+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB55.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:37:46 +0000 X-Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:46 -0600 X-Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 11 Dec 2023 04:37:46 -0600 X-Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Mon, 11 Dec 2023 04:37:44 -0600 From: "Abdul Lateef Attar via groups.io" To: CC: Abdul Lateef Attar , Pierre Gondois , Sami Mujawar Subject: [edk2-devel] [PATCH v3 5/5] DynamicTablesPkg: Adds wrapper API AmlCodeGenMethodInvokeMethodArgn Date: Mon, 11 Dec 2023 16:07:33 +0530 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB55:EE_|PH7PR12MB8055:EE_ X-MS-Office365-Filtering-Correlation-Id: 66db9ace-4a6a-44ed-c0ef-08dbfa353724 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: gwh5vq5HfRcote9rl1FI5XhQ+Biy2Z+GqJHLtneS/Y5Zjk7ViEizr/+vqm8ZAYJxx55ceknDcHct82qwImIitPGc2mYcBVXHjGy9cZ9+vr8acYbpLBdxAbQo1kgzsM+Pf/6ReCwXZS9B4WkbOy23bkX57syYmYQt43Y/b5nMsdo3JzVUEmqUJyiPul5Iwj3fxBMJ5AYgzfMnder7o0sHTj4zMf0ikHtKkY6U475GYSuu+CE1DIAQrPsYQVq0PLLfe9ajciMeOUnHhXF3lp82TXml79h9owbEbDfveZZ5b7ogIF9i/s5BONqgixt0Zz8eBZitMmjcfH+i60DkxSsz/p+IDU1Pt+0qnPndUe9Hq4z7brwor6j8kSU1F2sHDSl46iDiFjtFHKidqTNstQyPY12hkBr5oOcy+D0UxUE9wr30PGl3rRRfXzPECcqYQdZO/bETaZ8C0YEGOoW8Vxle7PGRaKcn9I3b4BnsHZMJHIcC0Jdc1kSeBY8Dh45ATnp/i5Nf5Vuy64mDNXT8HSCTPZapc4c8S64Ba5kZFHHmBXvwooRSyNSjdDcHQeLgOoHgrirf37jlVnduOgvM5uJHAeDvO8kwokSYBQbjLGNuSqUTRuDXkOfWFp8fu9W963Ur/eOxVdrKy3/A8aNx7mSLdakQn6G/IIwfjQt1u2crFT0j+3M0gzfy0GzNj6OfN5Q+QxzeFTWFX1jBQ3c8ap5Z68fR1yp83qR0L5F3z4m/VoC/4hMuMtx/chFYbEKi9NqBnfD26f2PAI9XJs1zZTbxndw7QvQaaNUQJhuX9SlZboc= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:37:46.7954 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66db9ace-4a6a-44ed-c0ef-08dbfa353724 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB55.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8055 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 Reply-To: devel@edk2.groups.io,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: CbEuiwAqquCYgak5nRN9I7wFx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702291073299100009 Content-Type: text/plain; charset="utf-8" From: Abdul Lateef Attar Adds a wrapper API AmlCodeGenMethodInvokeMethodArgnWithInteger() to the AmlCodeGenMethodInvokeMethodArgn(). Wrapper API provides ability to add integer arguments along with ArgN argument. This help to generate dynamic code to invoke another method(might be in static ASL file) with build-in argument parameters plus integer arguments. e.g: Method (MET0, 3, Serialized) { \_SB.MET1 (Arg0, Arg1, Arg2, 0x10, 0x20)) } Cc: Pierre Gondois Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar --- .../Include/Library/AmlLib/AmlLib.h | 68 +++++++ .../Common/AmlLib/CodeGen/AmlCodeGen.c | 187 ++++++++++++++++++ 2 files changed, 255 insertions(+) diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h index 5ab205b5f0..132846a38a 100644 --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h @@ -1739,4 +1739,72 @@ AmlCodeGenMethodInvokeMethodArgn ( OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL ); =20 +/** AML code generation for a method invoking another method + with ArgN arguments and optionally integer arguments. + + Arg0Int =3D 0x10; + Arg1Int =3D 0x20; + AmlCodeGenMethodInvokeMethodArgnWithInteger ( + "MET0", "MET1", 4, TRUE, 3, + Arg0Int, Arg1Int, NULL, NULL, NULL, NULL, + ParentNode, NewObjectNode + ); + is equivalent of the following ASL code: + Method(MET0, 4, Serialized, 3) { + MET1 (Arg0, Arg1, Arg2, Arg3, 0x10, 0x20) + } + + @param [in] MethodNameString The new Method's name. + Must be a NULL-terminated ASL NameStri= ng + e.g.: "MET0", "_SB.MET0", etc. + The input string is copied. + @param [in] InvokeMethodNameString The called/invoked method's name. + Must be a NULL-terminated ASL NameStri= ng + e.g.: "MET1", "_SB.MET1", etc. + The input string is copied. + @param [in] NumArgs Number of arguments. + Must be 0 <=3D NumArgs <=3D 6. + @param [in] IsSerialized TRUE is equivalent to Serialized. + FALSE is equivalent to NotSerialized. + Default is NotSerialized in ASL spec. + @param [in] SyncLevel Synchronization level for the method. + Must be 0 <=3D SyncLevel <=3D 15. + Default is 0 in ASL. + @param [in] IntegerArg0 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg1 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg2 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg3 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg4 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg5 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] ParentNode If provided, set ParentNode as the par= ent + of the node created. + @param [out] NewObjectNode If success, contains the created node. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMethodInvokeMethodArgnWithInteger ( + IN CONST CHAR8 *MethodNameString, + IN CONST CHAR8 *InvokeMethodNameString, + IN UINT8 NumArgs, + IN BOOLEAN IsSerialized, + IN UINT8 SyncLevel, + IN UINT64 *IntegerArg0 OPTIONAL, + IN UINT64 *IntegerArg1 OPTIONAL, + IN UINT64 *IntegerArg2 OPTIONAL, + IN UINT64 *IntegerArg3 OPTIONAL, + IN UINT64 *IntegerArg4 OPTIONAL, + IN UINT64 *IntegerArg5 OPTIONAL, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL + ); + #endif // AML_LIB_H_ diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index b05fa6d109..b3b01e7baf 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -4001,3 +4001,190 @@ exit_handler: =20 return Status; } + +/** AML code generation for a method invoking another method + with ArgN arguments and optionally integer arguments. + + Arg0Int =3D 0x10; + Arg1Int =3D 0x20; + AmlCodeGenMethodInvokeMethodArgnWithInteger ( + "MET0", "MET1", 4, TRUE, 3, + Arg0Int, Arg1Int, NULL, NULL, NULL, NULL, + ParentNode, NewObjectNode + ); + is equivalent of the following ASL code: + Method(MET0, 4, Serialized, 3) { + MET1 (Arg0, Arg1, Arg2, Arg3, 0x10, 0x20) + } + + @param [in] MethodNameString The new Method's name. + Must be a NULL-terminated ASL NameStri= ng + e.g.: "MET0", "_SB.MET0", etc. + The input string is copied. + @param [in] InvokeMethodNameString The called/invoked method's name. + Must be a NULL-terminated ASL NameStri= ng + e.g.: "MET1", "_SB.MET1", etc. + The input string is copied. + @param [in] NumArgs Number of arguments. + Must be 0 <=3D NumArgs <=3D 6. + @param [in] IsSerialized TRUE is equivalent to Serialized. + FALSE is equivalent to NotSerialized. + Default is NotSerialized in ASL spec. + @param [in] SyncLevel Synchronization level for the method. + Must be 0 <=3D SyncLevel <=3D 15. + Default is 0 in ASL. + @param [in] IntegerArg0 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg1 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg2 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg3 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg4 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] IntegerArg5 If provided and meets the validation c= riteria, + then set as integer argument to invoke= d method. + @param [in] ParentNode If provided, set ParentNode as the par= ent + of the node created. + @param [out] NewObjectNode If success, contains the created node. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Invalid parameter. +**/ +EFI_STATUS +EFIAPI +AmlCodeGenMethodInvokeMethodArgnWithInteger ( + IN CONST CHAR8 *MethodNameString, + IN CONST CHAR8 *InvokeMethodNameString, + IN UINT8 NumArgs, + IN BOOLEAN IsSerialized, + IN UINT8 SyncLevel, + IN UINT64 *IntegerArg0 OPTIONAL, + IN UINT64 *IntegerArg1 OPTIONAL, + IN UINT64 *IntegerArg2 OPTIONAL, + IN UINT64 *IntegerArg3 OPTIONAL, + IN UINT64 *IntegerArg4 OPTIONAL, + IN UINT64 *IntegerArg5 OPTIONAL, + IN AML_NODE_HANDLE ParentNode OPTIONAL, + OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL + ) +{ + EFI_STATUS Status; + AML_OBJECT_NODE_HANDLE MethodObjectNode; + AML_OBJECT_NODE *IntNode; + UINT64 LocalIntegerArg[6]; + UINT8 LocalIntegerArgCount; + UINT8 Index; + + if ((MethodNameString =3D=3D NULL) || (InvokeMethodNameString =3D=3D NUL= L)) { + return EFI_INVALID_PARAMETER; + } + + /// Sanity check optional argument + /// AML library allows max 6 argument + /// Hence Integer argument count should be within the range + /// (NumArgs + Integer argument) should not be grater than 6 + LocalIntegerArgCount =3D 0; + if (IntegerArg0 !=3D NULL) { + if (NumArgs > 5) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg0; + } + + if (IntegerArg1 !=3D NULL) { + if (NumArgs > 4) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg1; + } + + if (IntegerArg2 !=3D NULL) { + if (NumArgs > 3) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg2; + } + + if (IntegerArg3 !=3D NULL) { + if (NumArgs > 2) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg3; + } + + if (IntegerArg4 !=3D NULL) { + if (NumArgs > 1) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg4; + } + + if (IntegerArg5 !=3D NULL) { + if (NumArgs > 0) { + return EFI_INVALID_PARAMETER; + } + + LocalIntegerArg[LocalIntegerArgCount++] =3D *IntegerArg5; + } + + /// Create a method invoking another method with Argn + Status =3D AmlCodeGenMethodInvokeMethodArgn ( + MethodNameString, + InvokeMethodNameString, + NumArgs, + IsSerialized, + SyncLevel, + NULL, + &MethodObjectNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + /// Now append the integer argument + for (Index =3D 0; Index < LocalIntegerArgCount; Index++) { + IntNode =3D NULL; + Status =3D AmlCodeGenInteger (LocalIntegerArg[Index], &IntNode); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + Status =3D AmlVarListAddTail ( + (AML_NODE_HANDLE)MethodObjectNode, + (AML_NODE_HANDLE)IntNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + } + + IntNode =3D NULL; + Status =3D LinkNode ( + MethodObjectNode, + ParentNode, + NewObjectNode + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + goto exit_handler; + } + + return Status; + +exit_handler: + if (MethodObjectNode !=3D NULL) { + AmlDeleteTree ((AML_NODE_HANDLE)MethodObjectNode); + } + + return Status; +} --=20 2.34.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 (#112288): https://edk2.groups.io/g/devel/message/112288 Mute This Topic: https://groups.io/mt/103106352/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-