From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 14B72AC180F for ; Fri, 22 Sep 2023 15:35:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=rdo7jy0Mbw5FryqESvTWKgIAgqLbowCYAyEyqJVnkSA=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1695396923; v=1; b=XuVHMS96OadmyCvX5M4XVvp/KfXVusghuDg8mzmTnmM0xgSaF1dOVip/EHlOOCAbkPJ7w5Yz LT/EIfflIJVU7oeb3nU5lxW4qfURyo75pFvkWsP+mq4/qO7sep4aV32vrM+md3wVUnB78orFwAj nPo//JDSsH/m2HYS5i6K6qzg= X-Received: by 127.0.0.2 with SMTP id 0G3LYY7687511x00vxXHToyk; Fri, 22 Sep 2023 08:35:23 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.717.1695396922808922103 for ; Fri, 22 Sep 2023 08:35:22 -0700 X-Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38MEttFV012696; Fri, 22 Sep 2023 15:35:18 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t8u0s29er-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 15:35:18 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38MFZIcx032233 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 15:35:18 GMT X-Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Fri, 22 Sep 2023 08:35:16 -0700 Date: Fri, 22 Sep 2023 16:35:13 +0100 From: "Leif Lindholm" To: , CC: Sami Mujawar , Jeff Brasen Subject: Re: [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges Message-ID: References: <20230922141817.1651629-1-pierre.gondois@arm.com> MIME-Version: 1.0 In-Reply-To: <20230922141817.1651629-1-pierre.gondois@arm.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: 9yz4h_jux41I24lcex9HoNFwmQ3N08W9 X-Proofpoint-ORIG-GUID: 9yz4h_jux41I24lcex9HoNFwmQ3N08W9 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: t2X62Kd6hVjx8YEJzwnoNywjx7686176AA= Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=XuVHMS96; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Fri, Sep 22, 2023 at 16:18:17 +0200, PierreGondois wrote: > From: Pierre Gondois > > The IsaRange parameter in: > - AmlCodeGenRdDWordIo() > - AmlCodeGenRdQWordIo() > is an hard-coded value. Define an enum for IsarRanges > and use it. > > Suggested-by: Leif Lindholm > Signed-off-by: Pierre Gondois Thanks for this! Reviewed-by: Leif Lindholm > --- > .../Include/Library/AmlLib/AmlLib.h | 28 +++++++++++-------- > .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 2 +- > .../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 28 +++++++------------ > 3 files changed, 27 insertions(+), 31 deletions(-) > > diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > index 8e24cecdd77b..ce81f5876681 100644 > --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > @@ -59,6 +59,18 @@ typedef void *AML_DATA_NODE_HANDLE; > > #endif // AML_HANDLE > > +/** Enum for ISA Ranges. > + > + See ACPI 6.4 spec, s19.6.34 for more. > +*/ > +typedef enum { > + EAmlIsaRangeReserved = 0, ///< Reserved. > + EAmlIsaRangeNonIsaOnly, ///< NonIsaOnly. > + EAmlIsaRangeIsaOnly, ///< IsaOnly. > + EAmlIsaRangeEntireRange, ///< EntireRange. > + EAmlIsaRangeMax, ///< Max. > +} EAML_ISA_RANGE; > + > /** Parse the definition block. > > The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT > @@ -471,11 +483,7 @@ AmlUpdateRdQWord ( > @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] IsaRanges Isa Range. > @param [in] AddressGranularity Address granularity. > @param [in] AddressMinimum Minimum address. > @param [in] AddressMaximum Maximum address. > @@ -505,7 +513,7 @@ AmlCodeGenRdDWordIo ( > IN BOOLEAN IsMinFixed, > IN BOOLEAN IsMaxFixed, > IN BOOLEAN IsPosDecode, > - IN UINT8 IsaRanges, > + IN EAML_ISA_RANGE IsaRanges, > IN UINT32 AddressGranularity, > IN UINT32 AddressMinimum, > IN UINT32 AddressMaximum, > @@ -702,11 +710,7 @@ AmlCodeGenRdWordBusNumber ( > @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] IsaRanges Isa Range. > @param [in] AddressGranularity Address granularity. > @param [in] AddressMinimum Minimum address. > @param [in] AddressMaximum Maximum address. > @@ -736,7 +740,7 @@ AmlCodeGenRdQWordIo ( > IN BOOLEAN IsMinFixed, > IN BOOLEAN IsMaxFixed, > IN BOOLEAN IsPosDecode, > - IN UINT8 IsaRanges, > + IN EAML_ISA_RANGE IsaRanges, > IN UINT64 AddressGranularity, > IN UINT64 AddressMinimum, > IN UINT64 AddressMaximum, > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > index 9ddaddc198fa..87b426ccfe07 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > @@ -545,7 +545,7 @@ GeneratePciCrs ( > TRUE, > TRUE, > IsPosDecode, > - 3, > + EAmlIsaRangeEntireRange, > 0, > AddrMapInfo->PciAddress, > AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1, > diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c > index 9c6700b9e08c..707e8182b4c0 100644 > --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c > +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c > @@ -121,13 +121,13 @@ STATIC > UINT8 > EFIAPI > RdIoRangeSpecificFlags ( > - IN UINT8 IsaRanges, > - IN BOOLEAN IsDenseTranslation, > - IN BOOLEAN IsTypeStatic > + IN EAML_ISA_RANGE IsaRanges, > + IN BOOLEAN IsDenseTranslation, > + IN BOOLEAN IsTypeStatic > ) > { > // Only check type specific parameters. > - if (IsaRanges > 3) { > + if (IsaRanges >= EAmlIsaRangeMax) { > ASSERT (0); > return MAX_UINT8; > } > @@ -440,20 +440,16 @@ AmlCodeGenRdDWordSpace ( > @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] IsaRanges Isa Range. > @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. > - Unused. Must be 0. > + Not supported. Must be 0. > @param [in] ResourceSource Resource Source. > - Unused. Must be NULL. > + Not supported. Must be NULL. > @param [in] IsDenseTranslation TranslationDensity parameter. > @param [in] IsTypeStatic TranslationType parameter. > @param [in] NameOpNode NameOp object node defining a named object. > @@ -474,7 +470,7 @@ AmlCodeGenRdDWordIo ( > IN BOOLEAN IsMinFixed, > IN BOOLEAN IsMaxFixed, > IN BOOLEAN IsPosDecode, > - IN UINT8 IsaRanges, > + IN EAML_ISA_RANGE IsaRanges, > IN UINT32 AddressGranularity, > IN UINT32 AddressMinimum, > IN UINT32 AddressMaximum, > @@ -1031,11 +1027,7 @@ AmlCodeGenRdQWordSpace ( > @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] IsaRanges Isa Range. > @param [in] AddressGranularity Address granularity. > @param [in] AddressMinimum Minimum address. > @param [in] AddressMaximum Maximum address. > @@ -1065,7 +1057,7 @@ AmlCodeGenRdQWordIo ( > IN BOOLEAN IsMinFixed, > IN BOOLEAN IsMaxFixed, > IN BOOLEAN IsPosDecode, > - IN UINT8 IsaRanges, > + IN EAML_ISA_RANGE IsaRanges, > IN UINT64 AddressGranularity, > IN UINT64 AddressMinimum, > IN UINT64 AddressMaximum, > -- > 2.25.1 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109016): https://edk2.groups.io/g/devel/message/109016 Mute This Topic: https://groups.io/mt/101521874/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-