summaryrefslogtreecommitdiff
path: root/PrmPkg
diff options
context:
space:
mode:
Diffstat (limited to 'PrmPkg')
-rw-r--r--PrmPkg/Application/PrmInfo/PrmInfoStrings.uni6
-rw-r--r--PrmPkg/Include/PrmDataBuffer.h3
-rw-r--r--PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c71
-rw-r--r--PrmPkg/PrmConfigDxe/PrmConfigDxe.c6
-rw-r--r--PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c2
-rw-r--r--PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf6
-rw-r--r--PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf6
7 files changed, 57 insertions, 43 deletions
diff --git a/PrmPkg/Application/PrmInfo/PrmInfoStrings.uni b/PrmPkg/Application/PrmInfo/PrmInfoStrings.uni
index 756cf97..1ca7f69 100644
--- a/PrmPkg/Application/PrmInfo/PrmInfoStrings.uni
+++ b/PrmPkg/Application/PrmInfo/PrmInfoStrings.uni
@@ -29,7 +29,7 @@
#string STR_PRMINFO_HANDLER_GUID #language en-US " Handler GUID: %g\r\n"
#string STR_PRMINFO_HANDLER_NAME #language en-US " Handler Name: %a\r\n"
#string STR_PRMINFO_HANDLER_NAME_HL #language en-US " Handler Name: %H%a%N\r\n"
-#string STR_PRMINFO_HANDLER_PA #language en-US " Handler Physical Address: 0x%016x\r\n"
+#string STR_PRMINFO_HANDLER_PA #language en-US " Handler Physical Address: 0x%016llx\r\n"
#string STR_PRMINFO_HANDLER_ERR_STATUS #language en-US " Return Status: %E%r%N\r\n"
#string STR_PRMINFO_HANDLER_SUCC_STATUS #language en-US " Return Status: %V%r%N\r\n"
#string STR_PRMINFO_HANDLERS_FOUND #language en-US " %d PRM handlers found.\r\n"
@@ -42,8 +42,8 @@
#string STR_PRMINFO_NO_MMIO_RANGES #language en-US " No runtime MMIO ranges used by this module.\r\n"
#string STR_PRMINFO_NO_STATIC_BUFFER #language en-US " This handler does not define a static data buffer.\r\n\r\n"
#string STR_PRMINFO_RUNTIME_MMIO_COUNT #language en-US " Runtime MMIO Range Count: %d\r\n"
-#string STR_PRMINFO_RUNTIME_MMIO_INFO #language en-US " [%d]: Physical Base Address = 0x%016x\r\n Virtual Base Address = 0x%016x\r\n Length = 0x%x\r\n"
-#string STR_PRMINFO_STATIC_DATA_BUFFER #language en-US " Static Data Buffer: 0x%016x\r\n"
+#string STR_PRMINFO_RUNTIME_MMIO_INFO #language en-US " [%d]: Physical Base Address = 0x%016llx\r\n Virtual Base Address = 0x%016llx\r\n Length = 0x%x\r\n"
+#string STR_PRMINFO_STATIC_DATA_BUFFER #language en-US " Static Data Buffer: 0x%016llx\r\n"
#string STR_PRMINFO_UNKNOWN #language en-US "Unknown"
#string STR_PRMINFO_USECS #language en-US "%H%ld.%ld microseconds%N"
#string STR_PRMINFO_NANO_SECS #language en-US "%H%ld nanoseconds%N"
diff --git a/PrmPkg/Include/PrmDataBuffer.h b/PrmPkg/Include/PrmDataBuffer.h
index 3af067a..4613f57 100644
--- a/PrmPkg/Include/PrmDataBuffer.h
+++ b/PrmPkg/Include/PrmDataBuffer.h
@@ -12,7 +12,8 @@
#include <Uefi.h>
-#define PRM_DATA_BUFFER_HEADER_SIGNATURE SIGNATURE_32('P','R','M','S')
+#define PRM_DATA_BUFFER_HEADER_SIGNATURE SIGNATURE_32('P','R','M','S')
+#define PRM_ACPI_PARAMETER_DATA_BUFFER_HEADER_SIGNATURE SIGNATURE_32('P','R','M','P')
#pragma pack(push, 1)
diff --git a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
index a6ad141..b265c19 100644
--- a/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
+++ b/PrmPkg/Library/DxePrmContextBufferLib/DxePrmContextBufferLib.c
@@ -104,37 +104,41 @@ GetModuleContextBuffers (
&HandleCount,
&HandleBuffer
);
- if (!EFI_ERROR (Status)) {
- for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gPrmConfigProtocolGuid,
- (VOID **)&PrmConfigProtocol
- );
- ASSERT_EFI_ERROR (Status);
- if (EFI_ERROR (Status) || (PrmConfigProtocol == NULL)) {
- continue;
- }
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- if (GuidSearchType == ByModuleGuid) {
- if (CompareGuid (&PrmConfigProtocol->ModuleContextBuffers.ModuleGuid, Guid)) {
- DEBUG ((
- DEBUG_INFO,
- " %a %a: Found a PRM configuration protocol for PRM module %g.\n",
- _DBGMSGID_,
- __func__,
- Guid
- ));
-
- *PrmModuleContextBuffers = &PrmConfigProtocol->ModuleContextBuffers;
- return EFI_SUCCESS;
- }
- } else {
- Status = FindContextBufferInModuleBuffers (Guid, &PrmConfigProtocol->ModuleContextBuffers, &PrmContextBuffer);
- if (!EFI_ERROR (Status)) {
- *PrmModuleContextBuffers = &PrmConfigProtocol->ModuleContextBuffers;
- return EFI_SUCCESS;
- }
+ for (Index = 0; Index < HandleCount; Index++) {
+ Status = gBS->HandleProtocol (
+ HandleBuffer[Index],
+ &gPrmConfigProtocolGuid,
+ (VOID **)&PrmConfigProtocol
+ );
+ ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status) || (PrmConfigProtocol == NULL)) {
+ continue;
+ }
+
+ if (GuidSearchType == ByModuleGuid) {
+ if (CompareGuid (&PrmConfigProtocol->ModuleContextBuffers.ModuleGuid, Guid)) {
+ DEBUG ((
+ DEBUG_INFO,
+ " %a %a: Found a PRM configuration protocol for PRM module %g.\n",
+ _DBGMSGID_,
+ __func__,
+ Guid
+ ));
+
+ *PrmModuleContextBuffers = &PrmConfigProtocol->ModuleContextBuffers;
+ Status = EFI_SUCCESS;
+ goto Exit;
+ }
+ } else {
+ Status = FindContextBufferInModuleBuffers (Guid, &PrmConfigProtocol->ModuleContextBuffers, &PrmContextBuffer);
+ if (!EFI_ERROR (Status)) {
+ *PrmModuleContextBuffers = &PrmConfigProtocol->ModuleContextBuffers;
+ Status = EFI_SUCCESS;
+ goto Exit;
}
}
}
@@ -147,7 +151,12 @@ GetModuleContextBuffers (
Guid
));
- return EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
+
+Exit:
+ gBS->FreePool (HandleBuffer);
+
+ return Status;
}
/**
diff --git a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
index f919435..f367454 100644
--- a/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
+++ b/PrmPkg/PrmConfigDxe/PrmConfigDxe.c
@@ -87,7 +87,7 @@ SetRuntimeMemoryRangeAttributes (
));
DEBUG ((
DEBUG_INFO,
- " %a %a: Physical address = 0x%016x. Length = 0x%x.\n",
+ " %a %a: Physical address = 0x%016llx. Length = 0x%x.\n",
_DBGMSGID_,
__func__,
RuntimeMmioRanges->Range[Index].PhysicalBaseAddress,
@@ -144,7 +144,7 @@ SetRuntimeMemoryRangeAttributes (
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
- " %a %a: Error [%r] finding descriptor for runtime memory range 0x%016x.\n",
+ " %a %a: Error [%r] finding descriptor for runtime memory range 0x%016llx.\n",
_DBGMSGID_,
__func__,
Status,
@@ -171,7 +171,7 @@ SetRuntimeMemoryRangeAttributes (
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
- " %a %a: Error [%r] setting descriptor for runtime memory range 0x%016x.\n",
+ " %a %a: Error [%r] setting descriptor for runtime memory range 0x%016llx.\n",
_DBGMSGID_,
__func__,
Status,
diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
index 477c24c..2e576cd 100644
--- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
+++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
@@ -210,7 +210,7 @@ ProcessPrmModules (
CurrentHandlerInfoStruct->PhysicalAddress = HandlerPhysicalAddress;
DEBUG ((
DEBUG_INFO,
- " %a %a: Found %a handler physical address at 0x%016x.\n",
+ " %a %a: Found %a handler physical address at 0x%016llx.\n",
_DBGMSGID_,
__func__,
CurrentExportDescriptorHandlerName,
diff --git a/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf b/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
index 04addec..e3311d7 100644
--- a/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
+++ b/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
@@ -8,6 +8,7 @@
#
# Copyright (c) Microsoft Corporation
# Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+# Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -41,5 +42,6 @@
MSFT:*_*_*_DLINK_FLAGS = /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0
MSFT:*_*_*_GENFW_FLAGS = --keepoptionalheader
- GCC:*_*_AARCH64_GENFW_FLAGS = --prm
- GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckParamBufferPrmHandler
+ GCC:*_*_*_GENFW_FLAGS = --prm
+ GCC:*_*_*_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckParamBufferPrmHandler
+ GCC:*_*_X64_OBJCOPY_STRIPFLAG = --keep-symbol=PrmModuleExportDescriptor --keep-symbol=CheckParamBufferPrmHandler
diff --git a/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf b/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
index ff72a23..31c3863 100644
--- a/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
+++ b/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
@@ -8,6 +8,7 @@
# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation
# Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+# Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -44,5 +45,6 @@
MSFT:*_*_*_DLINK_FLAGS = /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0
MSFT:*_*_*_GENFW_FLAGS = --keepoptionalheader
- GCC:*_*_AARCH64_GENFW_FLAGS = --keepoptionalheader --prm
- GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckStaticDataBufferPrmHandler
+ GCC:*_*_*_GENFW_FLAGS = --keepoptionalheader --prm
+ GCC:*_*_*_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckStaticDataBufferPrmHandler
+ GCC:*_*_X64_OBJCOPY_STRIPFLAG = --keep-symbol=PrmModuleExportDescriptor --keep-symbol=CheckStaticDataBufferPrmHandler