[edk2-devel] [PATCH edk2-platforms v1 1/1] Platform/Ampere: Fix build break in JadePkg

Sami Mujawar sami.mujawar at arm.com
Fri Jul 29 21:07:19 UTC 2022


The definition for ARM_PROCESSOR_TABLE has been removed by
commit c8af26627a4e9a3659255dc147d75596da08248e
as it is a pseudo ACPI table.

This causes the JadePkg builds to fail. Therefore, update
Ampere/JadePkg to reflect this change.

Signed-off-by: Sami Mujawar <sami.mujawar at arm.com>
---
 Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
index d5bc732b08bbfc61a24781f82f575b33b17d75d8..93dabce0e68ab090ac86ec8066ab1b40372e4746 100644
--- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
+++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSrat.c
@@ -1,6 +1,7 @@
 /** @file
 
   Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
+  Copyright (c) 2022, ARM Ltd. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -115,7 +116,8 @@ SratAddGiccAffinity (
   EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *SratGiccAffinity
   )
 {
-  ARM_PROCESSOR_TABLE *ArmProcessorTable;
+  VOID                *Hob;
+  UINTN               NumberOfEntries;
   ARM_CORE_INFO       *ArmCoreInfoTable;
   UINTN               Count, NumNode, Idx;
   UINT32              AcpiProcessorUid;
@@ -123,22 +125,22 @@ SratAddGiccAffinity (
   UINT8               Core;
   UINT8               Cpm;
 
-  for (Idx = 0; Idx < gST->NumberOfTableEntries; Idx++) {
-    if (CompareGuid (&gArmMpCoreInfoGuid, &(gST->ConfigurationTable[Idx].VendorGuid))) {
-      ArmProcessorTable = (ARM_PROCESSOR_TABLE *)gST->ConfigurationTable[Idx].VendorTable;
-      ArmCoreInfoTable = ArmProcessorTable->ArmCpus;
-      break;
-    }
+  Hob = GetFirstGuidHob (&gArmMpCoreInfoGuid);
+  if (Hob == NULL) {
+    return EFI_NOT_FOUND;
   }
 
-  if (Idx == gST->NumberOfTableEntries) {
+  ArmCoreInfoTable = (ARM_CORE_INFO*)GET_GUID_HOB_DATA (Hob);
+  NumberOfEntries = GET_GUID_HOB_DATA_SIZE (Hob)/sizeof (ARM_CORE_INFO);
+
+  if (NumberOfEntries == 0) {
     return EFI_INVALID_PARAMETER;
   }
 
   Count = 0;
   NumNode = 0;
-  while (Count != ArmProcessorTable->NumberOfEntries) {
-    for (Idx = 0; Idx < ArmProcessorTable->NumberOfEntries; Idx++ ) {
+  while (Count != NumberOfEntries) {
+    for (Idx = 0; Idx < NumberOfEntries; Idx++ ) {
       Socket = GET_MPIDR_AFF1 (ArmCoreInfoTable[Idx].Mpidr);
       Core   = GET_MPIDR_AFF0 (ArmCoreInfoTable[Idx].Mpidr);
       Cpm = Core >> PLATFORM_CPM_UID_BIT_OFFSET;
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91987): https://edk2.groups.io/g/devel/message/91987
Mute This Topic: https://groups.io/mt/92700227/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list