From: Michael Kubacki <michael.kuba...@microsoft.com>

Adds support to PrmLoaderDxe to move the ACPI parameter buffer
address for a given PRM handler to the corresponding field
in the PRM handler information structure (PRMT ACPI table).

Cc: Andrew Fish <af...@apple.com>
Cc: Kang Gao <kang....@intel.com>
Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Michael Kubacki <michael.kuba...@microsoft.com>
Cc: Leif Lindholm <l...@nuviainc.com>
Cc: Benjamin You <benjamin....@intel.com>
Cc: Liu Yun <yun.y....@intel.com>
Cc: Ankit Sinha <ankit.si...@intel.com>
Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
Signed-off-by: Michael Kubacki <michael.kuba...@microsoft.com>
---
 PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c 
b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
index 433d81cf8009..6416e388a668 100644
--- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
+++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
@@ -621,6 +621,7 @@ ProcessPrmModules (
   PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY     *TempListEntry;
   CONST CHAR8                             *CurrentExportDescriptorHandlerName;
 
+  ACPI_PARAMETER_BUFFER_DESCRIPTOR        *CurrentModuleAcpiParamDescriptors;
   PRM_CONTEXT_BUFFER                      *CurrentContextBuffer;
   PRM_MODULE_CONTEXT_BUFFERS              *CurrentModuleContextBuffers;
   PRM_MODULE_INFORMATION_STRUCT           *CurrentModuleInfoStruct;
@@ -628,6 +629,7 @@ ProcessPrmModules (
 
   EFI_STATUS                              Status;
   EFI_PHYSICAL_ADDRESS                    CurrentImageAddress;
+  UINTN                                   AcpiParamIndex;
   UINTN                                   HandlerIndex;
   UINT32                                  PrmAcpiDescriptionTableBufferSize;
 
@@ -677,6 +679,7 @@ ProcessPrmModules (
     CurrentImageAddress = 
TempListEntry->Context->PeCoffImageContext.ImageAddress;
     CurrentImageExportDirectory = TempListEntry->Context->ExportDirectory;
     CurrentExportDescriptorStruct = TempListEntry->Context->ExportDescriptor;
+    CurrentModuleAcpiParamDescriptors = NULL;
 
     DEBUG ((
       DEBUG_INFO,
@@ -715,6 +718,7 @@ ProcessPrmModules (
     ASSERT (!EFI_ERROR (Status) || Status == EFI_NOT_FOUND);
     if (!EFI_ERROR (Status) && CurrentModuleContextBuffers != NULL) {
       CurrentModuleInfoStruct->RuntimeMmioRanges = (UINT64) (UINTN) 
CurrentModuleContextBuffers->RuntimeMmioRanges;
+      CurrentModuleAcpiParamDescriptors = 
CurrentModuleContextBuffers->AcpiParameterBufferDescriptors;
     }
 
     //
@@ -759,6 +763,19 @@ ProcessPrmModules (
           CurrentHandlerInfoStruct->PhysicalAddress
           ));
       }
+
+      //
+      // Update the handler ACPI parameter buffer address if applicable
+      //
+      if (CurrentModuleAcpiParamDescriptors != NULL) {
+        for (AcpiParamIndex = 0; AcpiParamIndex < 
CurrentModuleContextBuffers->AcpiParameterBufferDescriptorCount; 
AcpiParamIndex++) {
+          if (CompareGuid 
(&CurrentModuleAcpiParamDescriptors[AcpiParamIndex].HandlerGuid, 
&CurrentHandlerInfoStruct->Identifier)) {
+            CurrentHandlerInfoStruct->AcpiParameterBuffer = (UINT64) (UINTN) (
+                                                              
CurrentModuleAcpiParamDescriptors[AcpiParamIndex].AcpiParameterBufferAddress
+                                                              );
+          }
+        }
+      }
     }
     CurrentModuleInfoStruct = (PRM_MODULE_INFORMATION_STRUCT *) ((UINTN) 
CurrentModuleInfoStruct + CurrentModuleInfoStruct->StructureLength);
   }
-- 
2.28.0.windows.1



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


Reply via email to