diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2020-06-08 16:59:01 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-05 00:42:38 +0000 |
commit | be2c927d7c61bedbf898d346c536368708e57c0c (patch) | |
tree | 568e2a5b092aa2304b314afe9ba490206303a77c /PrmPkg | |
parent | 0b469caff6ba9553def05b95f12078e2ad86bcff (diff) | |
download | edk2-be2c927d7c61bedbf898d346c536368708e57c0c.tar.gz edk2-be2c927d7c61bedbf898d346c536368708e57c0c.tar.bz2 edk2-be2c927d7c61bedbf898d346c536368708e57c0c.zip |
PrmPkg/PrmLoaderDxe: Add ACPI parameter buffer support
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 <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
Diffstat (limited to 'PrmPkg')
-rw-r--r-- | PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c index 433d81cf80..6416e388a6 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);
}
|