diff mbox

[Linaro-uefi,13/27] Platforms/Hisilicon: Add definition of NUMA related structures

Message ID 1478785950-24197-14-git-send-email-heyi.guo@linaro.org
State Superseded
Headers show

Commit Message

gary guo Nov. 10, 2016, 1:52 p.m. UTC
Update gicc and memory affinity structure version to ACPI 6.0 and
add NUMA related structure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 Chips/Hisilicon/Include/Library/AcpiNextLib.h | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Leif Lindholm Nov. 10, 2016, 7:37 p.m. UTC | #1
On Thu, Nov 10, 2016 at 09:52:17PM +0800, Heyi Guo wrote:
> Update gicc and memory affinity structure version to ACPI 6.0 and
> add NUMA related structure.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> ---
>  Chips/Hisilicon/Include/Library/AcpiNextLib.h | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/Chips/Hisilicon/Include/Library/AcpiNextLib.h b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> index 639b702..5a810ec 100644
> --- a/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> +++ b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> @@ -32,14 +32,14 @@
>       GicRBase, GicRlength \
>    }
>  
> -#define EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE_INIT(                                              \

rp-16.12-12-d05 still contains source code using these macros under
their old names, although it seems those files are not used.
Can you send a new patch deleting those
Chips/Hisilicon/Pv660/Pv660AcpiTables/Srat.aslc, and any other unused
ACPI source files?

> +#define EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE_INIT(                                              \
>      ProximityDomain, ACPIProcessorUID, Flags, ClockDomain)                                      \
>    {                                                                                             \
>      3, sizeof (EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE),ProximityDomain ,                          \
>       ACPIProcessorUID,  Flags,  ClockDomain                                                     \
>    }
>  
> -#define EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
> +#define EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
>      ProximityDomain, AddressBaseLow, AddressBaseHigh, LengthLow, LengthHigh, Flags)               \
>    {                                                                                               \
>      1, sizeof (EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE),ProximityDomain , EFI_ACPI_RESERVED_WORD,  \
> @@ -47,6 +47,21 @@
>      EFI_ACPI_RESERVED_QWORD                                                                       \
>    }
>  
> +#pragma pack(1)
> +//
> +// Define the number of each table type.
> +// This is where the table layout is modified.
> +//
> +#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  64
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT                10
>  
> +
> +typedef struct {
> +  EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER          Header;
> +  EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE                      Memory[EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT];
> +  EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE                        Gicc[EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT];
> +} EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE;
> +
> +#pragma pack()
>  #endif
>  
> -- 
> 1.9.1
>
Graeme Gregory Nov. 16, 2016, 9:56 a.m. UTC | #2
On Thu, Nov 10, 2016 at 09:52:17PM +0800, Heyi Guo wrote:
> Update gicc and memory affinity structure version to ACPI 6.0 and
> add NUMA related structure.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> ---
>  Chips/Hisilicon/Include/Library/AcpiNextLib.h | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/Chips/Hisilicon/Include/Library/AcpiNextLib.h b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> index 639b702..5a810ec 100644
> --- a/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> +++ b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
> @@ -32,14 +32,14 @@
>       GicRBase, GicRlength \
>    }
>  
> -#define EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE_INIT(                                              \
> +#define EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE_INIT(                                              \
>      ProximityDomain, ACPIProcessorUID, Flags, ClockDomain)                                      \
>    {                                                                                             \
>      3, sizeof (EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE),ProximityDomain ,                          \
>       ACPIProcessorUID,  Flags,  ClockDomain                                                     \
>    }
>  
> -#define EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
> +#define EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
>      ProximityDomain, AddressBaseLow, AddressBaseHigh, LengthLow, LengthHigh, Flags)               \
>    {                                                                                               \
>      1, sizeof (EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE),ProximityDomain , EFI_ACPI_RESERVED_WORD,  \
> @@ -47,6 +47,21 @@
>      EFI_ACPI_RESERVED_QWORD                                                                       \
>    }

The general scheme in edk2 codebase for these type of _INIT macros seems
to be to keep the version at the ACPI spec level the subtable was
introduced in. There seems to be no functional different in 6.0 so they
would stay at 5.X levels.

But as this is a private header this should not block upstreaming I
think.

Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>

>  
> +#pragma pack(1)
> +//
> +// Define the number of each table type.
> +// This is where the table layout is modified.
> +//
> +#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  64
> +#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT                10
>  
> +
> +typedef struct {
> +  EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER          Header;
> +  EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE                      Memory[EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT];
> +  EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE                        Gicc[EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT];
> +} EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE;
> +
> +#pragma pack()
>  #endif
>  
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/Chips/Hisilicon/Include/Library/AcpiNextLib.h b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
index 639b702..5a810ec 100644
--- a/Chips/Hisilicon/Include/Library/AcpiNextLib.h
+++ b/Chips/Hisilicon/Include/Library/AcpiNextLib.h
@@ -32,14 +32,14 @@ 
      GicRBase, GicRlength \
   }
 
-#define EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE_INIT(                                              \
+#define EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE_INIT(                                              \
     ProximityDomain, ACPIProcessorUID, Flags, ClockDomain)                                      \
   {                                                                                             \
     3, sizeof (EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE),ProximityDomain ,                          \
      ACPIProcessorUID,  Flags,  ClockDomain                                                     \
   }
 
-#define EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
+#define EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE_INIT(                                              \
     ProximityDomain, AddressBaseLow, AddressBaseHigh, LengthLow, LengthHigh, Flags)               \
   {                                                                                               \
     1, sizeof (EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE),ProximityDomain , EFI_ACPI_RESERVED_WORD,  \
@@ -47,6 +47,21 @@ 
     EFI_ACPI_RESERVED_QWORD                                                                       \
   }
 
+#pragma pack(1)
+//
+// Define the number of each table type.
+// This is where the table layout is modified.
+//
+#define EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT  64
+#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT                10
 
+
+typedef struct {
+  EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER          Header;
+  EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE                      Memory[EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT];
+  EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE                        Gicc[EFI_ACPI_PROCESSOR_LOCAL_GICC_AFFINITY_STRUCTURE_COUNT];
+} EFI_ACPI_STATIC_RESOURCE_AFFINITY_TABLE;
+
+#pragma pack()
 #endif