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>
This commit is contained in:
Michael Kubacki 2020-06-08 16:59:01 -07:00 committed by mergify[bot]
parent 0b469caff6
commit be2c927d7c
1 changed files with 17 additions and 0 deletions

View File

@ -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);
}