From: Sami Mujawar <sami.muja...@arm.com>

The GicCToken field in the CM_ARM_PROC_HIERARCHY_INFO structure is
a reference to the associated object which has the corresponding
ACPI Processor ID, e.g. for Arm systems this is a reference to the
CM_ARM_GICC_INFO object.
For other architecture this may be a reference to a similar object
that has the ACPI Processor ID.

Therefore, rename the GicCToken field to a more generic name like
AcpiIdObjectToken.

Correspondingly also update the following modules to reflect the
changes introduced by this renaming:
 - PPTT generator
 - SSDT CPu topology generator
 - ConfigurationManagerObjectParser.

Cc: Pierre Gondois <pierre.gond...@arm.com>
Cc: Yeo Reum Yun <yeoreum....@arm.com>
Cc: AbdulLateef Attar <abdullateef.at...@amd.com>
Cc: Jeshua Smith <jesh...@nvidia.com>
Cc: Jeff Brasen <jbra...@nvidia.com>
Cc: Girish Mahadevan <gmahade...@nvidia.com>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggar...@nxp.com>
Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
Signed-off-by: Pierre Gondois <pierre.gond...@arm.com>
---
 .../Include/ArmNameSpaceObjects.h             | 10 ++--
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 60 ++++++++++---------
 .../SsdtCpuTopologyGenerator.c                |  8 +--
 .../ConfigurationManagerObjectParser.c        |  2 +-
 4 files changed, 41 insertions(+), 39 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index e019323c1fcd..da50f581fa25 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -657,11 +657,11 @@ typedef struct CmArmProcHierarchyInfo {
   /// Token for the parent CM_ARM_PROC_HIERARCHY_INFO object in the processor
   /// topology. A value of CM_NULL_TOKEN means this node has no parent.
   CM_OBJECT_TOKEN    ParentToken;
-  /// Token of the associated CM_ARM_GICC_INFO object which has the
-  /// corresponding ACPI Processor ID. A value of CM_NULL_TOKEN means this
-  /// node represents a group of associated processors and it does not have an
-  /// associated GIC CPU interface.
-  CM_OBJECT_TOKEN    GicCToken;
+  /// Token of the associated object which has the corresponding ACPI Processor
+  /// ID, e.g. for Arm systems this is a reference to CM_ARM_GICC_INFO object.
+  /// A value of CM_NULL_TOKEN means this node represents a group of associated
+  /// processors and it does not have an associated CPU interface.
+  CM_OBJECT_TOKEN    AcpiIdObjectToken;
   /// Number of resources private to this Node
   UINT32             NoOfPrivateResources;
   /// Token of the array which contains references to the resources private to
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index c237f7ff9386..f2f2a834116e 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -397,12 +397,14 @@ AddPrivateResources (
   @param [in]  Index2         Index of Object2 to be displayed for debugging
                               purposes.
 
-  @retval TRUE                Object1 and Object2 have the same GicCToken.
-  @retval FALSE               Object1 and Object2 have different GicCTokens.
+  @retval TRUE                Object1 and Object2 have the same
+                              AcpiIdObjectToken.
+  @retval FALSE               Object1 and Object2 have different
+                              AcpiIdObjectTokens.
 **/
 BOOLEAN
 EFIAPI
-IsGicCTokenEqual (
+IsAcpiIdObjectTokenEqual (
   IN  CONST VOID   *Object1,
   IN  CONST VOID   *Object2,
   IN        UINTN  Index1,
@@ -426,18 +428,18 @@ IsGicCTokenEqual (
 
   if (IS_ACPI_PROC_ID_VALID (ProcNode1) &&
       IS_ACPI_PROC_ID_VALID (ProcNode2) &&
-      (ProcNode1->GicCToken != CM_NULL_TOKEN) &&
-      (ProcNode2->GicCToken != CM_NULL_TOKEN) &&
-      (ProcNode1->GicCToken == ProcNode2->GicCToken))
+      (ProcNode1->AcpiIdObjectToken != CM_NULL_TOKEN) &&
+      (ProcNode2->AcpiIdObjectToken != CM_NULL_TOKEN) &&
+      (ProcNode1->AcpiIdObjectToken == ProcNode2->AcpiIdObjectToken))
   {
     DEBUG ((
       DEBUG_ERROR,
       "ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \
-      "the same GICC Info object. ACPI Processor IDs are not unique. " \
-      "GicCToken = %p.\n",
+      "the same ACPI ID reference object. ACPI Processor IDs are not unique. " 
\
+      "AcpiIdObjectToken = %p.\n",
       Index1,
       Index2,
-      ProcNode1->GicCToken
+      ProcNode1->AcpiIdObjectToken
       ));
     return TRUE;
   }
@@ -474,7 +476,7 @@ AddProcHierarchyNodes (
   EFI_STATUS                             Status;
   EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR  *ProcStruct;
   UINT32                                 *PrivateResources;
-  BOOLEAN                                IsGicCTokenDuplicated;
+  BOOLEAN                                IsAcpiIdObjectTokenDuplicated;
 
   CM_ARM_GICC_INFO  *GicCInfoList;
   UINT32            GicCInfoCount;
@@ -500,15 +502,15 @@ AddProcHierarchyNodes (
   NodeCount        = Generator->ProcHierarchyNodeCount;
 
   // Check if every GICC Object is referenced by onlu one Proc Node
-  IsGicCTokenDuplicated = FindDuplicateValue (
-                            ProcNodeIterator,
-                            NodeCount,
-                            sizeof (PPTT_NODE_INDEXER),
-                            IsGicCTokenEqual
-                            );
+  IsAcpiIdObjectTokenDuplicated = FindDuplicateValue (
+                                    ProcNodeIterator,
+                                    NodeCount,
+                                    sizeof (PPTT_NODE_INDEXER),
+                                    IsAcpiIdObjectTokenEqual
+                                    );
   // Duplicate GIC CPU Interface Token was found so two PPTT Processor 
Hierarchy
   // Nodes map to the same MADT GICC structure
-  if (IsGicCTokenDuplicated) {
+  if (IsAcpiIdObjectTokenDuplicated) {
     return EFI_INVALID_PARAMETER;
   }
 
@@ -602,14 +604,14 @@ AddProcHierarchyNodes (
     if (!IS_ACPI_PROC_ID_VALID (ProcInfoNode)) {
       // Default invalid ACPI Processor ID to 0
       ProcStruct->AcpiProcessorId = 0;
-    } else if (ProcInfoNode->GicCToken == CM_NULL_TOKEN) {
+    } else if (ProcInfoNode->AcpiIdObjectToken == CM_NULL_TOKEN) {
       Status = EFI_INVALID_PARAMETER;
       DEBUG ((
         DEBUG_ERROR,
-        "ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no GICC " \
-        "structure token was provided. GicCToken = %p. RequestorToken = %p. " \
-        "Status = %r\n",
-        ProcInfoNode->GicCToken,
+        "ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no " \
+        "ACPI ID Reference object token was provided. " \
+        "AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
+        ProcInfoNode->AcpiIdObjectToken,
         ProcInfoNode->Token,
         Status
         ));
@@ -617,17 +619,17 @@ AddProcHierarchyNodes (
     } else {
       Status = GetEArmObjGicCInfo (
                  CfgMgrProtocol,
-                 ProcInfoNode->GicCToken,
+                 ProcInfoNode->AcpiIdObjectToken,
                  &GicCInfoList,
                  &GicCInfoCount
                  );
       if (EFI_ERROR (Status)) {
         DEBUG ((
           DEBUG_ERROR,
-          "ERROR: PPTT: Failed to get GICC structure. ACPI Processor ID " \
-          "can't be populated. GicCToken = %p. RequestorToken = %p. " \
-          "Status = %r\n",
-          ProcInfoNode->GicCToken,
+          "ERROR: PPTT: Failed to get ACPI ID Reference object token.  " \
+          "ACPI Processor ID can't be populated. " \
+          "AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
+          ProcInfoNode->AcpiIdObjectToken,
           ProcInfoNode->Token,
           Status
           ));
@@ -640,10 +642,10 @@ AddProcHierarchyNodes (
           DEBUG_ERROR,
           "ERROR: PPTT: Failed to find a unique GICC structure. " \
           "ACPI Processor ID can't be populated. " \
-          "GICC Structure Count = %d. GicCToken = %p. RequestorToken = %p " \
+          "GICC Structure Count = %d. AcpiIdObjectToken = %p. RequestorToken = 
%p " \
           "Status = %r\n",
           GicCInfoCount,
-          ProcInfoNode->GicCToken,
+          ProcInfoNode->AcpiIdObjectToken,
           ProcInfoNode->Token,
           Status
           ));
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 6ce7b71fac8b..5a5bfefd894e 100644
--- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -894,11 +894,11 @@ CreateAmlCpuFromProcHierarchy (
   ASSERT (CfgMgrProtocol != NULL);
   ASSERT (ParentNode != NULL);
   ASSERT (ProcHierarchyNodeInfo != NULL);
-  ASSERT (ProcHierarchyNodeInfo->GicCToken != CM_NULL_TOKEN);
+  ASSERT (ProcHierarchyNodeInfo->AcpiIdObjectToken != CM_NULL_TOKEN);
 
   Status = GetEArmObjGicCInfo (
              CfgMgrProtocol,
-             ProcHierarchyNodeInfo->GicCToken,
+             ProcHierarchyNodeInfo->AcpiIdObjectToken,
              &GicCInfo,
              NULL
              );
@@ -1170,9 +1170,9 @@ CreateAmlCpuTopologyTree (
     // Find the children of the CM_ARM_PROC_HIERARCHY_INFO
     // currently being handled (i.e. ParentToken == NodeToken).
     if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
-      // Only Cpus (leaf nodes in this tree) have a GicCToken.
+      // Only Cpus (leaf nodes in this tree) have a AcpiIdObjectToken.
       // Create a Cpu node.
-      if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) {
+      if (Generator->ProcNodeList[Index].AcpiIdObjectToken != CM_NULL_TOKEN) {
         Status = CheckProcNode (
                    Generator->ProcNodeList[Index].Flags,
                    TRUE,
diff --git 
a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
 
b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 050cd04d09c2..17388b183554 100644
--- 
a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ 
b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -328,7 +328,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] 
= {
   { "Token",                      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "Flags",                      4,                        "0x%x", NULL },
   { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-  { "GicCToken",                  sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "AcpiIdObjectToken",          sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "NoOfPrivateResources",       4,                        "0x%x", NULL },
   { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "LpiToken",                   sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116987): https://edk2.groups.io/g/devel/message/116987
Mute This Topic: https://groups.io/mt/105068161/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to