summaryrefslogtreecommitdiffstats
path: root/PrmPkg/PrmLoaderDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2022-03-15 14:46:34 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-05 00:42:38 +0000
commita298a84478053872ed9da660a75f182ce81b8ddc (patch)
tree95b97a9ee3a91ec1340c15e5e3264bd5f8723292 /PrmPkg/PrmLoaderDxe
parentf3c11224b55cbad10b357f83d0324588b85862bb (diff)
downloadedk2-a298a84478053872ed9da660a75f182ce81b8ddc.tar.gz
edk2-a298a84478053872ed9da660a75f182ce81b8ddc.tar.bz2
edk2-a298a84478053872ed9da660a75f182ce81b8ddc.zip
PrmPkg: Apply uncrustify changes
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in PrmPkg. 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/PrmLoaderDxe')
-rw-r--r--PrmPkg/PrmLoaderDxe/PrmAcpiTable.h66
-rw-r--r--PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c179
2 files changed, 125 insertions, 120 deletions
diff --git a/PrmPkg/PrmLoaderDxe/PrmAcpiTable.h b/PrmPkg/PrmLoaderDxe/PrmAcpiTable.h
index 6f9ba8f777..e2034d4738 100644
--- a/PrmPkg/PrmLoaderDxe/PrmAcpiTable.h
+++ b/PrmPkg/PrmLoaderDxe/PrmAcpiTable.h
@@ -14,11 +14,11 @@
#include <Base.h>
#include <IndustryStandard/Acpi10.h>
-#define PRM_TABLE_SIGNATURE SIGNATURE_32 ('P', 'R', 'M', 'T')
+#define PRM_TABLE_SIGNATURE SIGNATURE_32 ('P', 'R', 'M', 'T')
-#define PRM_TABLE_REVISION 0x0
-#define PRM_MODULE_INFORMATION_STRUCT_REVISION 0x00
-#define PRM_HANDLER_INFORMATION_STRUCT_REVISION 0x00
+#define PRM_TABLE_REVISION 0x0
+#define PRM_MODULE_INFORMATION_STRUCT_REVISION 0x00
+#define PRM_HANDLER_INFORMATION_STRUCT_REVISION 0x00
#pragma pack(push, 1)
@@ -26,13 +26,13 @@
// Platform Runtime Mechanism (PRM) ACPI Table (PRMT) structures
//
typedef struct {
- UINT16 StructureRevision; ///< Revision of this structure
- UINT16 StructureLength; ///< Length in bytes of this structure
- GUID Identifier; ///< GUID of the PRM handler for this structure
- UINT64 PhysicalAddress; ///< Physical address of this PRM handler
- UINT64 StaticDataBuffer; ///< Physical address of the static data buffer for
+ UINT16 StructureRevision; ///< Revision of this structure
+ UINT16 StructureLength; ///< Length in bytes of this structure
+ GUID Identifier; ///< GUID of the PRM handler for this structure
+ UINT64 PhysicalAddress; ///< Physical address of this PRM handler
+ UINT64 StaticDataBuffer; ///< Physical address of the static data buffer for
///< this PRM handler (PRM_DATA_BUFFER *)
- UINT64 AcpiParameterBuffer; ///< Physical address of the parameter buffer
+ UINT64 AcpiParameterBuffer; ///< Physical address of the parameter buffer
///< for this PRM handler (PRM_DATA_BUFFER *)
///< that is only used in the case of _DSM invocation.
///< If _DSM invocation is not used, this value is
@@ -40,29 +40,29 @@ typedef struct {
} PRM_HANDLER_INFORMATION_STRUCT;
typedef struct {
- UINT16 StructureRevision; ///< Revision of this structure
- UINT16 StructureLength; ///< Length in bytes of this structure including the
+ UINT16 StructureRevision; ///< Revision of this structure
+ UINT16 StructureLength; ///< Length in bytes of this structure including the
///< variable length PRM Handler Info array
- GUID Identifier; ///< GUID of the PRM module for this structure
- UINT16 MajorRevision; ///< PRM module major revision
- UINT16 MinorRevision; ///< PRM module minor revision
- UINT16 HandlerCount; ///< Number of entries in the Handler Info array
- UINT32 HandlerInfoOffset; ///< Offset in bytes from the beginning of this
+ GUID Identifier; ///< GUID of the PRM module for this structure
+ UINT16 MajorRevision; ///< PRM module major revision
+ UINT16 MinorRevision; ///< PRM module minor revision
+ UINT16 HandlerCount; ///< Number of entries in the Handler Info array
+ UINT32 HandlerInfoOffset; ///< Offset in bytes from the beginning of this
///< structure to the Handler Info array
- UINT64 RuntimeMmioRanges; ///< Physical address of the PRM MMIO Ranges
+ UINT64 RuntimeMmioRanges; ///< Physical address of the PRM MMIO Ranges
///< structure (PRM_MODULE_RUNTIME_MMIO_RANGES *)
- PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure[1];
+ PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure[1];
} PRM_MODULE_INFORMATION_STRUCT;
typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header; ///< Standard ACPI description header
- GUID PrmPlatformGuid; ///< A GUID that uniquely identifies this platform.
+ EFI_ACPI_DESCRIPTION_HEADER Header; ///< Standard ACPI description header
+ GUID PrmPlatformGuid; ///< A GUID that uniquely identifies this platform.
///< Used to check for compatibility in PRM module
///< runtime updates.
- UINT32 PrmModuleInfoOffset; ///< Offset in bytes from the beginning of this
+ UINT32 PrmModuleInfoOffset; ///< Offset in bytes from the beginning of this
///< structure to the PRM Module Info array
- UINT32 PrmModuleInfoCount; ///< Number of entries in the PRM Module Info array
- PRM_MODULE_INFORMATION_STRUCT PrmModuleInfoStructure[1];
+ UINT32 PrmModuleInfoCount; ///< Number of entries in the PRM Module Info array
+ PRM_MODULE_INFORMATION_STRUCT PrmModuleInfoStructure[1];
} PRM_ACPI_DESCRIPTION_TABLE;
#pragma pack(pop)
@@ -72,19 +72,19 @@ typedef struct {
//
// Todo: Revisit whether to use; currently both macros are not used
//
-#define PRM_MODULE_INFORMATION_STRUCTURE(ModuleGuid, ModuleRevision, HandlerCount, PrmHanderInfoStructureArray) { \
+#define PRM_MODULE_INFORMATION_STRUCTURE(ModuleGuid, ModuleRevision, HandlerCount, PrmHanderInfoStructureArray) { \
{ \
- PRM_MODULE_INFORMATION_STRUCT_REVISION, /* UINT16 StructureRevision; */ \
- (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) + (HandlerCount * sizeof (PRM_HANDLER_INFORMATION_STRUCT))) /* UINT16 StructureLength; */ \
- ModuleGuid, /* GUID ModuleGuid; */ \
- ModuleRevision, /* UINT16 ModuleRevision */ \
- HandlerCount, /* UINT16 HandlerCount */ \
- OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoOffset), /* UINT32 HandlerInfoOffset */ \
- PrmHanderInfoStructureArray /* PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure */ \
+ PRM_MODULE_INFORMATION_STRUCT_REVISION, /* UINT16 StructureRevision; */ \
+ (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) + (HandlerCount * sizeof (PRM_HANDLER_INFORMATION_STRUCT))) /* UINT16 StructureLength; */ \
+ ModuleGuid, /* GUID ModuleGuid; */ \
+ ModuleRevision, /* UINT16 ModuleRevision */ \
+ HandlerCount, /* UINT16 HandlerCount */ \
+ OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoOffset), /* UINT32 HandlerInfoOffset */ \
+ PrmHanderInfoStructureArray /* PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure */ \
} \
}
-#define PRM_HANDLER_INFORMATION_STRUCTURE(HandlerGuid, PhysicalAddress) { \
+#define PRM_HANDLER_INFORMATION_STRUCTURE(HandlerGuid, PhysicalAddress) { \
{ \
PRM_HANDLER_INFORMATION_STRUCT_REVISION, /* UINT16 StructureRevision; */ \
sizeof (PRM_HANDLER_INFORMATION_STRUCT), /* UINT16 StructureLength; */ \
diff --git a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
index e2779f5c17..5a223d783d 100644
--- a/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
+++ b/PrmPkg/PrmLoaderDxe/PrmLoaderDxe.c
@@ -30,8 +30,8 @@
#define _DBGMSGID_ "[PRMLOADER]"
-UINTN mPrmHandlerCount;
-UINTN mPrmModuleCount;
+UINTN mPrmHandlerCount;
+UINTN mPrmModuleCount;
/**
Processes a list of PRM context entries to build a PRM ACPI table.
@@ -50,34 +50,35 @@ UINTN mPrmModuleCount;
**/
EFI_STATUS
ProcessPrmModules (
- OUT PRM_ACPI_DESCRIPTION_TABLE **PrmAcpiDescriptionTable
+ OUT PRM_ACPI_DESCRIPTION_TABLE **PrmAcpiDescriptionTable
)
{
- EFI_IMAGE_EXPORT_DIRECTORY *CurrentImageExportDirectory;
- PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *CurrentExportDescriptorStruct;
- PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiTable;
- PRM_MODULE_IMAGE_CONTEXT *CurrentPrmModuleImageContext;
- CONST CHAR8 *CurrentExportDescriptorHandlerName;
-
- ACPI_PARAMETER_BUFFER_DESCRIPTOR *CurrentModuleAcpiParamDescriptors;
- PRM_CONTEXT_BUFFER *CurrentContextBuffer;
- PRM_MODULE_CONTEXT_BUFFERS *CurrentModuleContextBuffers;
- PRM_MODULE_INFORMATION_STRUCT *CurrentModuleInfoStruct;
- PRM_HANDLER_INFORMATION_STRUCT *CurrentHandlerInfoStruct;
-
- EFI_STATUS Status;
- EFI_PHYSICAL_ADDRESS CurrentImageAddress;
- UINTN AcpiParamIndex;
- UINTN HandlerIndex;
- UINT32 PrmAcpiDescriptionTableBufferSize;
-
- UINT64 HandlerPhysicalAddress;
+ EFI_IMAGE_EXPORT_DIRECTORY *CurrentImageExportDirectory;
+ PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT *CurrentExportDescriptorStruct;
+ PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiTable;
+ PRM_MODULE_IMAGE_CONTEXT *CurrentPrmModuleImageContext;
+ CONST CHAR8 *CurrentExportDescriptorHandlerName;
+
+ ACPI_PARAMETER_BUFFER_DESCRIPTOR *CurrentModuleAcpiParamDescriptors;
+ PRM_CONTEXT_BUFFER *CurrentContextBuffer;
+ PRM_MODULE_CONTEXT_BUFFERS *CurrentModuleContextBuffers;
+ PRM_MODULE_INFORMATION_STRUCT *CurrentModuleInfoStruct;
+ PRM_HANDLER_INFORMATION_STRUCT *CurrentHandlerInfoStruct;
+
+ EFI_STATUS Status;
+ EFI_PHYSICAL_ADDRESS CurrentImageAddress;
+ UINTN AcpiParamIndex;
+ UINTN HandlerIndex;
+ UINT32 PrmAcpiDescriptionTableBufferSize;
+
+ UINT64 HandlerPhysicalAddress;
DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
if (PrmAcpiDescriptionTable == NULL) {
return EFI_INVALID_PARAMETER;
}
+
*PrmAcpiDescriptionTable = NULL;
//
@@ -96,42 +97,42 @@ ProcessPrmModules (
DEBUG ((DEBUG_INFO, " %a %a: %d total PRM modules to process.\n", _DBGMSGID_, __FUNCTION__, mPrmModuleCount));
DEBUG ((DEBUG_INFO, " %a %a: %d total PRM handlers to process.\n", _DBGMSGID_, __FUNCTION__, mPrmHandlerCount));
- PrmAcpiDescriptionTableBufferSize = (UINT32) (OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure) +
- (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) * mPrmModuleCount) +
- (sizeof (PRM_HANDLER_INFORMATION_STRUCT) * mPrmHandlerCount)
- );
+ PrmAcpiDescriptionTableBufferSize = (UINT32)(OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure) +
+ (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) * mPrmModuleCount) +
+ (sizeof (PRM_HANDLER_INFORMATION_STRUCT) * mPrmHandlerCount)
+ );
DEBUG ((DEBUG_INFO, " %a %a: Total PRM ACPI table size: 0x%x.\n", _DBGMSGID_, __FUNCTION__, PrmAcpiDescriptionTableBufferSize));
- PrmAcpiTable = AllocateZeroPool ((UINTN) PrmAcpiDescriptionTableBufferSize);
+ PrmAcpiTable = AllocateZeroPool ((UINTN)PrmAcpiDescriptionTableBufferSize);
if (PrmAcpiTable == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- PrmAcpiTable->Header.Signature = PRM_TABLE_SIGNATURE;
- PrmAcpiTable->Header.Length = PrmAcpiDescriptionTableBufferSize;
- PrmAcpiTable->Header.Revision = PRM_TABLE_REVISION;
- PrmAcpiTable->Header.Checksum = 0x0;
+ PrmAcpiTable->Header.Signature = PRM_TABLE_SIGNATURE;
+ PrmAcpiTable->Header.Length = PrmAcpiDescriptionTableBufferSize;
+ PrmAcpiTable->Header.Revision = PRM_TABLE_REVISION;
+ PrmAcpiTable->Header.Checksum = 0x0;
CopyMem (&PrmAcpiTable->Header.OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (PrmAcpiTable->Header.OemId));
- PrmAcpiTable->Header.OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
- PrmAcpiTable->Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
- PrmAcpiTable->Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
- PrmAcpiTable->Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
+ PrmAcpiTable->Header.OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
+ PrmAcpiTable->Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ PrmAcpiTable->Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ PrmAcpiTable->Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
CopyGuid (&PrmAcpiTable->PrmPlatformGuid, &gEdkiiDscPlatformGuid);
- PrmAcpiTable->PrmModuleInfoOffset = OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure);
- PrmAcpiTable->PrmModuleInfoCount = (UINT32) mPrmModuleCount;
+ PrmAcpiTable->PrmModuleInfoOffset = OFFSET_OF (PRM_ACPI_DESCRIPTION_TABLE, PrmModuleInfoStructure);
+ PrmAcpiTable->PrmModuleInfoCount = (UINT32)mPrmModuleCount;
//
// Iterate across all PRM Modules on the list
//
CurrentModuleInfoStruct = &PrmAcpiTable->PrmModuleInfoStructure[0];
for (
- CurrentPrmModuleImageContext = NULL, Status = GetNextPrmModuleEntry (&CurrentPrmModuleImageContext);
- !EFI_ERROR (Status);
- Status = GetNextPrmModuleEntry (&CurrentPrmModuleImageContext)) {
-
- CurrentImageAddress = CurrentPrmModuleImageContext->PeCoffImageContext.ImageAddress;
- CurrentImageExportDirectory = CurrentPrmModuleImageContext->ExportDirectory;
- CurrentExportDescriptorStruct = CurrentPrmModuleImageContext->ExportDescriptor;
+ CurrentPrmModuleImageContext = NULL, Status = GetNextPrmModuleEntry (&CurrentPrmModuleImageContext);
+ !EFI_ERROR (Status);
+ Status = GetNextPrmModuleEntry (&CurrentPrmModuleImageContext))
+ {
+ CurrentImageAddress = CurrentPrmModuleImageContext->PeCoffImageContext.ImageAddress;
+ CurrentImageExportDirectory = CurrentPrmModuleImageContext->ExportDirectory;
+ CurrentExportDescriptorStruct = CurrentPrmModuleImageContext->ExportDescriptor;
CurrentModuleAcpiParamDescriptors = NULL;
DEBUG ((
@@ -139,39 +140,39 @@ ProcessPrmModules (
" %a %a: PRM Module - %a with %d handlers.\n",
_DBGMSGID_,
__FUNCTION__,
- (CHAR8 *) ((UINTN) CurrentImageAddress + CurrentImageExportDirectory->Name),
+ (CHAR8 *)((UINTN)CurrentImageAddress + CurrentImageExportDirectory->Name),
CurrentExportDescriptorStruct->Header.NumberPrmHandlers
));
CurrentModuleInfoStruct->StructureRevision = PRM_MODULE_INFORMATION_STRUCT_REVISION;
- CurrentModuleInfoStruct->StructureLength = (
- OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) +
- (CurrentExportDescriptorStruct->Header.NumberPrmHandlers * sizeof (PRM_HANDLER_INFORMATION_STRUCT))
- );
+ CurrentModuleInfoStruct->StructureLength = (
+ OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) +
+ (CurrentExportDescriptorStruct->Header.NumberPrmHandlers * sizeof (PRM_HANDLER_INFORMATION_STRUCT))
+ );
CopyGuid (&CurrentModuleInfoStruct->Identifier, &CurrentExportDescriptorStruct->Header.ModuleGuid);
- CurrentModuleInfoStruct->HandlerCount = (UINT32) CurrentExportDescriptorStruct->Header.NumberPrmHandlers;
- CurrentModuleInfoStruct->HandlerInfoOffset = OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure);
+ CurrentModuleInfoStruct->HandlerCount = (UINT32)CurrentExportDescriptorStruct->Header.NumberPrmHandlers;
+ CurrentModuleInfoStruct->HandlerInfoOffset = OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure);
CurrentModuleInfoStruct->MajorRevision = 0;
CurrentModuleInfoStruct->MinorRevision = 0;
- Status = GetImageVersionInPeCoffImage (
- (VOID *) (UINTN) CurrentImageAddress,
- &CurrentPrmModuleImageContext->PeCoffImageContext,
- &CurrentModuleInfoStruct->MajorRevision,
- &CurrentModuleInfoStruct->MinorRevision
- );
+ Status = GetImageVersionInPeCoffImage (
+ (VOID *)(UINTN)CurrentImageAddress,
+ &CurrentPrmModuleImageContext->PeCoffImageContext,
+ &CurrentModuleInfoStruct->MajorRevision,
+ &CurrentModuleInfoStruct->MinorRevision
+ );
ASSERT_EFI_ERROR (Status);
// It is currently valid for a PRM module not to use a context buffer
Status = GetModuleContextBuffers (
- ByModuleGuid,
- &CurrentModuleInfoStruct->Identifier,
- (CONST PRM_MODULE_CONTEXT_BUFFERS **) &CurrentModuleContextBuffers
- );
+ ByModuleGuid,
+ &CurrentModuleInfoStruct->Identifier,
+ (CONST PRM_MODULE_CONTEXT_BUFFERS **)&CurrentModuleContextBuffers
+ );
ASSERT (!EFI_ERROR (Status) || Status == EFI_NOT_FOUND);
- if (!EFI_ERROR (Status) && CurrentModuleContextBuffers != NULL) {
- CurrentModuleInfoStruct->RuntimeMmioRanges = (UINT64) (UINTN) CurrentModuleContextBuffers->RuntimeMmioRanges;
- CurrentModuleAcpiParamDescriptors = CurrentModuleContextBuffers->AcpiParameterBufferDescriptors;
+ if (!EFI_ERROR (Status) && (CurrentModuleContextBuffers != NULL)) {
+ CurrentModuleInfoStruct->RuntimeMmioRanges = (UINT64)(UINTN)CurrentModuleContextBuffers->RuntimeMmioRanges;
+ CurrentModuleAcpiParamDescriptors = CurrentModuleContextBuffers->AcpiParameterBufferDescriptors;
}
//
@@ -181,21 +182,21 @@ ProcessPrmModules (
CurrentHandlerInfoStruct = &(CurrentModuleInfoStruct->HandlerInfoStructure[HandlerIndex]);
CurrentHandlerInfoStruct->StructureRevision = PRM_HANDLER_INFORMATION_STRUCT_REVISION;
- CurrentHandlerInfoStruct->StructureLength = sizeof (PRM_HANDLER_INFORMATION_STRUCT);
+ CurrentHandlerInfoStruct->StructureLength = sizeof (PRM_HANDLER_INFORMATION_STRUCT);
CopyGuid (
&CurrentHandlerInfoStruct->Identifier,
&CurrentExportDescriptorStruct->PrmHandlerExportDescriptors[HandlerIndex].PrmHandlerGuid
);
- CurrentExportDescriptorHandlerName = (CONST CHAR8 *) CurrentExportDescriptorStruct->PrmHandlerExportDescriptors[HandlerIndex].PrmHandlerName;
+ CurrentExportDescriptorHandlerName = (CONST CHAR8 *)CurrentExportDescriptorStruct->PrmHandlerExportDescriptors[HandlerIndex].PrmHandlerName;
Status = GetContextBuffer (
&CurrentHandlerInfoStruct->Identifier,
CurrentModuleContextBuffers,
- (CONST PRM_CONTEXT_BUFFER **) &CurrentContextBuffer
+ (CONST PRM_CONTEXT_BUFFER **)&CurrentContextBuffer
);
if (!EFI_ERROR (Status)) {
- CurrentHandlerInfoStruct->StaticDataBuffer = (UINT64) (UINTN) CurrentContextBuffer->StaticDataBuffer;
+ CurrentHandlerInfoStruct->StaticDataBuffer = (UINT64)(UINTN)CurrentContextBuffer->StaticDataBuffer;
}
Status = GetExportEntryAddress (
@@ -223,15 +224,17 @@ ProcessPrmModules (
if (CurrentModuleAcpiParamDescriptors != NULL) {
for (AcpiParamIndex = 0; AcpiParamIndex < CurrentModuleContextBuffers->AcpiParameterBufferDescriptorCount; AcpiParamIndex++) {
if (CompareGuid (&CurrentModuleAcpiParamDescriptors[AcpiParamIndex].HandlerGuid, &CurrentHandlerInfoStruct->Identifier)) {
- CurrentHandlerInfoStruct->AcpiParameterBuffer = (UINT64) (UINTN) (
- CurrentModuleAcpiParamDescriptors[AcpiParamIndex].AcpiParameterBufferAddress
- );
+ CurrentHandlerInfoStruct->AcpiParameterBuffer = (UINT64)(UINTN)(
+ CurrentModuleAcpiParamDescriptors[AcpiParamIndex].AcpiParameterBufferAddress
+ );
}
}
}
}
- CurrentModuleInfoStruct = (PRM_MODULE_INFORMATION_STRUCT *) ((UINTN) CurrentModuleInfoStruct + CurrentModuleInfoStruct->StructureLength);
+
+ CurrentModuleInfoStruct = (PRM_MODULE_INFORMATION_STRUCT *)((UINTN)CurrentModuleInfoStruct + CurrentModuleInfoStruct->StructureLength);
}
+
*PrmAcpiDescriptionTable = PrmAcpiTable;
return EFI_SUCCESS;
@@ -252,18 +255,18 @@ ProcessPrmModules (
**/
EFI_STATUS
PublishPrmAcpiTable (
- IN PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable
+ IN PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable
)
{
- EFI_STATUS Status;
- EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
- UINTN TableKey;
+ EFI_STATUS Status;
+ EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
+ UINTN TableKey;
- if (PrmAcpiDescriptionTable == NULL || PrmAcpiDescriptionTable->Header.Signature != PRM_TABLE_SIGNATURE) {
+ if ((PrmAcpiDescriptionTable == NULL) || (PrmAcpiDescriptionTable->Header.Signature != PRM_TABLE_SIGNATURE)) {
return EFI_INVALID_PARAMETER;
}
- Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **) &AcpiTableProtocol);
+ Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (!EFI_ERROR (Status)) {
TableKey = 0;
//
@@ -279,6 +282,7 @@ PublishPrmAcpiTable (
DEBUG ((DEBUG_INFO, "%a %a: The PRMT ACPI table was installed successfully.\n", _DBGMSGID_, __FUNCTION__));
}
}
+
ASSERT_EFI_ERROR (Status);
return Status;
@@ -305,12 +309,12 @@ PublishPrmAcpiTable (
VOID
EFIAPI
PrmLoaderEndOfDxeNotification (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
- EFI_STATUS Status;
- PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable;
+ EFI_STATUS Status;
+ PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable;
DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
@@ -326,6 +330,7 @@ PrmLoaderEndOfDxeNotification (
if (PrmAcpiDescriptionTable != NULL) {
FreePool (PrmAcpiDescriptionTable);
}
+
gBS->CloseEvent (Event);
}
@@ -342,12 +347,12 @@ PrmLoaderEndOfDxeNotification (
EFI_STATUS
EFIAPI
PrmLoaderEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_EVENT EndOfDxeEvent;
+ EFI_STATUS Status;
+ EFI_EVENT EndOfDxeEvent;
DEBUG ((DEBUG_INFO, "%a %a - Entry.\n", _DBGMSGID_, __FUNCTION__));
@@ -355,7 +360,7 @@ PrmLoaderEntryPoint (
// Discover and process installed PRM modules at the End of DXE
// The PRM ACPI table is published if one or PRM modules are discovered
//
- Status = gBS->CreateEventEx(
+ Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
PrmLoaderEndOfDxeNotification,