public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges
@ 2023-09-22 14:18 PierreGondois
  2023-09-22 14:24 ` Jeff Brasen via groups.io
  2023-09-22 15:35 ` Leif Lindholm
  0 siblings, 2 replies; 3+ messages in thread
From: PierreGondois @ 2023-09-22 14:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Jeff Brasen

From: Pierre Gondois <pierre.gondois@arm.com>

The IsaRange parameter in:
- AmlCodeGenRdDWordIo()
- AmlCodeGenRdQWordIo()
is an hard-coded value. Define an enum for IsarRanges
and use it.

Suggested-by: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../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 (#108991): https://edk2.groups.io/g/devel/message/108991
Mute This Topic: https://groups.io/mt/101521874/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges
  2023-09-22 14:18 [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges PierreGondois
@ 2023-09-22 14:24 ` Jeff Brasen via groups.io
  2023-09-22 15:35 ` Leif Lindholm
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Brasen via groups.io @ 2023-09-22 14:24 UTC (permalink / raw)
  To: pierre.gondois@arm.com, devel@edk2.groups.io; +Cc: Sami Mujawar, Leif Lindholm

Reviewed-by: Jeff Brasen <jbrasen@nvidia.com>

> -----Original Message-----
> From: pierre.gondois@arm.com <pierre.gondois@arm.com>
> Sent: Friday, September 22, 2023 8:18 AM
> To: devel@edk2.groups.io
> Cc: Sami Mujawar <sami.mujawar@arm.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Jeff Brasen <jbrasen@nvidia.com>
> Subject: [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for
> IsaRanges
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Pierre Gondois <pierre.gondois@arm.com>
> 
> The IsaRange parameter in:
> - AmlCodeGenRdDWordIo()
> - AmlCodeGenRdQWordIo()
> is an hard-coded value. Define an enum for IsarRanges and use it.
> 
> Suggested-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>  .../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/SsdtPcieGenera
> tor.c
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera
> tor.c
> index 9ddaddc198fa..87b426ccfe07 100644
> ---
> a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera
> tor.c
> +++
> b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGener
> +++ ator.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/AmlResourceDataC
> odeGen.c
> b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC
> odeGen.c
> index 9c6700b9e08c..707e8182b4c0 100644
> ---
> a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC
> odeGen.c
> +++
> b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataC
> ode
> +++ Gen.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 (#108992): https://edk2.groups.io/g/devel/message/108992
Mute This Topic: https://groups.io/mt/101521874/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges
  2023-09-22 14:18 [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges PierreGondois
  2023-09-22 14:24 ` Jeff Brasen via groups.io
@ 2023-09-22 15:35 ` Leif Lindholm
  1 sibling, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2023-09-22 15:35 UTC (permalink / raw)
  To: devel, pierre.gondois; +Cc: Sami Mujawar, Jeff Brasen

On Fri, Sep 22, 2023 at 16:18:17 +0200, PierreGondois wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
> 
> The IsaRange parameter in:
> - AmlCodeGenRdDWordIo()
> - AmlCodeGenRdQWordIo()
> is an hard-coded value. Define an enum for IsarRanges
> and use it.
> 
> Suggested-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>

Thanks for this!
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>


> ---
>  .../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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-22 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22 14:18 [edk2-devel] [PATCH 1/1] DynamicTablesPkg/AmlLib: Define an enum for IsaRanges PierreGondois
2023-09-22 14:24 ` Jeff Brasen via groups.io
2023-09-22 15:35 ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox