StandaloneMmPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the StandaloneMmPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
committed by
mergify[bot]
parent
c1e126b119
commit
91415a36ae
@@ -22,7 +22,7 @@ MmDispatcher (
|
||||
//
|
||||
// Globals used to initialize the protocol
|
||||
//
|
||||
EFI_HANDLE mMmCpuHandle = NULL;
|
||||
EFI_HANDLE mMmCpuHandle = NULL;
|
||||
|
||||
//
|
||||
// Physical pointer to private structure shared between MM IPL and the MM Core
|
||||
@@ -33,7 +33,6 @@ MM_CORE_PRIVATE_DATA *gMmCorePrivate;
|
||||
// MM Core global variable for MM System Table. Only accessed as a physical structure in MMRAM.
|
||||
//
|
||||
EFI_MM_SYSTEM_TABLE gMmCoreMmst = {
|
||||
|
||||
// The table header for the MMST.
|
||||
{
|
||||
MM_MMST_SIGNATURE,
|
||||
@@ -49,12 +48,12 @@ EFI_MM_SYSTEM_TABLE gMmCoreMmst = {
|
||||
// I/O Service
|
||||
{
|
||||
{
|
||||
(EFI_MM_CPU_IO) MmEfiNotAvailableYetArg5, // MmMemRead
|
||||
(EFI_MM_CPU_IO) MmEfiNotAvailableYetArg5 // MmMemWrite
|
||||
(EFI_MM_CPU_IO)MmEfiNotAvailableYetArg5, // MmMemRead
|
||||
(EFI_MM_CPU_IO)MmEfiNotAvailableYetArg5 // MmMemWrite
|
||||
},
|
||||
{
|
||||
(EFI_MM_CPU_IO) MmEfiNotAvailableYetArg5, // MmIoRead
|
||||
(EFI_MM_CPU_IO) MmEfiNotAvailableYetArg5 // MmIoWrite
|
||||
(EFI_MM_CPU_IO)MmEfiNotAvailableYetArg5, // MmIoRead
|
||||
(EFI_MM_CPU_IO)MmEfiNotAvailableYetArg5 // MmIoWrite
|
||||
}
|
||||
},
|
||||
// Runtime memory services
|
||||
@@ -85,16 +84,16 @@ EFI_MM_SYSTEM_TABLE gMmCoreMmst = {
|
||||
// Table of MMI Handlers that are registered by the MM Core when it is initialized
|
||||
//
|
||||
MM_CORE_MMI_HANDLERS mMmCoreMmiHandlers[] = {
|
||||
{ MmReadyToLockHandler, &gEfiDxeMmReadyToLockProtocolGuid, NULL, TRUE },
|
||||
{ MmEndOfDxeHandler, &gEfiEndOfDxeEventGroupGuid, NULL, FALSE },
|
||||
{ MmExitBootServiceHandler,&gEfiEventExitBootServicesGuid, NULL, FALSE },
|
||||
{ MmReadyToBootHandler, &gEfiEventReadyToBootGuid, NULL, FALSE },
|
||||
{ NULL, NULL, NULL, FALSE },
|
||||
{ MmReadyToLockHandler, &gEfiDxeMmReadyToLockProtocolGuid, NULL, TRUE },
|
||||
{ MmEndOfDxeHandler, &gEfiEndOfDxeEventGroupGuid, NULL, FALSE },
|
||||
{ MmExitBootServiceHandler, &gEfiEventExitBootServicesGuid, NULL, FALSE },
|
||||
{ MmReadyToBootHandler, &gEfiEventReadyToBootGuid, NULL, FALSE },
|
||||
{ NULL, NULL, NULL, FALSE },
|
||||
};
|
||||
|
||||
EFI_SYSTEM_TABLE *mEfiSystemTable;
|
||||
UINTN mMmramRangeCount;
|
||||
EFI_MMRAM_DESCRIPTOR *mMmramRanges;
|
||||
EFI_SYSTEM_TABLE *mEfiSystemTable;
|
||||
UINTN mMmramRangeCount;
|
||||
EFI_MMRAM_DESCRIPTOR *mMmramRanges;
|
||||
|
||||
/**
|
||||
Place holder function until all the MM System Table Service are available.
|
||||
@@ -113,11 +112,11 @@ EFI_MMRAM_DESCRIPTOR *mMmramRanges;
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MmEfiNotAvailableYetArg5 (
|
||||
UINTN Arg1,
|
||||
UINTN Arg2,
|
||||
UINTN Arg3,
|
||||
UINTN Arg4,
|
||||
UINTN Arg5
|
||||
UINTN Arg1,
|
||||
UINTN Arg2,
|
||||
UINTN Arg3,
|
||||
UINTN Arg4,
|
||||
UINTN Arg5
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -148,20 +147,21 @@ MmExitBootServiceHandler (
|
||||
IN OUT UINTN *CommBufferSize OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_HANDLE MmHandle;
|
||||
EFI_STATUS Status;
|
||||
STATIC BOOLEAN mInExitBootServices = FALSE;
|
||||
EFI_HANDLE MmHandle;
|
||||
EFI_STATUS Status;
|
||||
STATIC BOOLEAN mInExitBootServices = FALSE;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
if (!mInExitBootServices) {
|
||||
MmHandle = NULL;
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiEventExitBootServicesGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiEventExitBootServicesGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
mInExitBootServices = TRUE;
|
||||
return Status;
|
||||
}
|
||||
@@ -187,20 +187,21 @@ MmReadyToBootHandler (
|
||||
IN OUT UINTN *CommBufferSize OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_HANDLE MmHandle;
|
||||
EFI_STATUS Status;
|
||||
STATIC BOOLEAN mInReadyToBoot = FALSE;
|
||||
EFI_HANDLE MmHandle;
|
||||
EFI_STATUS Status;
|
||||
STATIC BOOLEAN mInReadyToBoot = FALSE;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
if (!mInReadyToBoot) {
|
||||
MmHandle = NULL;
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiEventReadyToBootGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiEventReadyToBootGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
mInReadyToBoot = TRUE;
|
||||
return Status;
|
||||
}
|
||||
@@ -249,36 +250,35 @@ MmReadyToLockHandler (
|
||||
// Install MM Ready to lock protocol
|
||||
//
|
||||
MmHandle = NULL;
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiMmReadyToLockProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiMmReadyToLockProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
|
||||
//
|
||||
// Make sure MM CPU I/O 2 Protocol has been installed into the handle database
|
||||
//
|
||||
//Status = MmLocateProtocol (&EFI_MM_CPU_IO_PROTOCOL_GUID, NULL, &Interface);
|
||||
// Status = MmLocateProtocol (&EFI_MM_CPU_IO_PROTOCOL_GUID, NULL, &Interface);
|
||||
|
||||
//
|
||||
// Print a message on a debug build if the MM CPU I/O 2 Protocol is not installed
|
||||
//
|
||||
//if (EFI_ERROR (Status)) {
|
||||
//DEBUG ((DEBUG_ERROR, "\nSMM: SmmCpuIo Arch Protocol not present!!\n"));
|
||||
//}
|
||||
|
||||
// if (EFI_ERROR (Status)) {
|
||||
// DEBUG ((DEBUG_ERROR, "\nSMM: SmmCpuIo Arch Protocol not present!!\n"));
|
||||
// }
|
||||
|
||||
//
|
||||
// Assert if the CPU I/O 2 Protocol is not installed
|
||||
//
|
||||
//ASSERT_EFI_ERROR (Status);
|
||||
// ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Display any drivers that were not dispatched because dependency expression
|
||||
// evaluated to false if this is a debug build
|
||||
//
|
||||
//MmDisplayDiscoveredNotDispatched ();
|
||||
// MmDisplayDiscoveredNotDispatched ();
|
||||
|
||||
return Status;
|
||||
}
|
||||
@@ -314,17 +314,15 @@ MmEndOfDxeHandler (
|
||||
// Install MM EndOfDxe protocol
|
||||
//
|
||||
MmHandle = NULL;
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiMmEndOfDxeProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
Status = MmInstallProtocolInterface (
|
||||
&MmHandle,
|
||||
&gEfiMmEndOfDxeProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
NULL
|
||||
);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
The main entry point to MM Foundation.
|
||||
|
||||
@@ -338,9 +336,9 @@ VOID
|
||||
EFIAPI
|
||||
MmEntryPoint (
|
||||
IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext
|
||||
)
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
EFI_MM_COMMUNICATE_HEADER *CommunicateHeader;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "MmEntryPoint ...\n"));
|
||||
@@ -353,7 +351,7 @@ MmEntryPoint (
|
||||
//
|
||||
// Call platform hook before Mm Dispatch
|
||||
//
|
||||
//PlatformHookBeforeMmDispatch ();
|
||||
// PlatformHookBeforeMmDispatch ();
|
||||
|
||||
//
|
||||
// If a legacy boot has occurred, then make sure gMmCorePrivate is not accessed
|
||||
@@ -377,23 +375,23 @@ MmEntryPoint (
|
||||
// If CommunicationBuffer is not in valid address scope, return EFI_INVALID_PARAMETER
|
||||
//
|
||||
gMmCorePrivate->CommunicationBuffer = 0;
|
||||
gMmCorePrivate->ReturnStatus = EFI_INVALID_PARAMETER;
|
||||
gMmCorePrivate->ReturnStatus = EFI_INVALID_PARAMETER;
|
||||
} else {
|
||||
CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)gMmCorePrivate->CommunicationBuffer;
|
||||
CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)gMmCorePrivate->CommunicationBuffer;
|
||||
gMmCorePrivate->BufferSize -= OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
|
||||
Status = MmiManage (
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
(UINTN *)&gMmCorePrivate->BufferSize
|
||||
);
|
||||
Status = MmiManage (
|
||||
&CommunicateHeader->HeaderGuid,
|
||||
NULL,
|
||||
CommunicateHeader->Data,
|
||||
(UINTN *)&gMmCorePrivate->BufferSize
|
||||
);
|
||||
//
|
||||
// Update CommunicationBuffer, BufferSize and ReturnStatus
|
||||
// Communicate service finished, reset the pointer to CommBuffer to NULL
|
||||
//
|
||||
gMmCorePrivate->BufferSize += OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
|
||||
gMmCorePrivate->BufferSize += OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
|
||||
gMmCorePrivate->CommunicationBuffer = 0;
|
||||
gMmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
||||
gMmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,12 +424,12 @@ MmEntryPoint (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MmConfigurationMmNotify (
|
||||
IN CONST EFI_GUID *Protocol,
|
||||
IN VOID *Interface,
|
||||
IN CONST EFI_GUID *Protocol,
|
||||
IN VOID *Interface,
|
||||
IN EFI_HANDLE Handle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
EFI_MM_CONFIGURATION_PROTOCOL *MmConfiguration;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "MmConfigurationMmNotify(%g) - %x\n", Protocol, Interface));
|
||||
@@ -465,17 +463,18 @@ MmConfigurationMmNotify (
|
||||
**/
|
||||
UINTN
|
||||
GetHobListSize (
|
||||
IN VOID *HobStart
|
||||
IN VOID *HobStart
|
||||
)
|
||||
{
|
||||
EFI_PEI_HOB_POINTERS Hob;
|
||||
|
||||
ASSERT (HobStart != NULL);
|
||||
|
||||
Hob.Raw = (UINT8 *) HobStart;
|
||||
Hob.Raw = (UINT8 *)HobStart;
|
||||
while (!END_OF_HOB_LIST (Hob)) {
|
||||
Hob.Raw = GET_NEXT_HOB (Hob);
|
||||
}
|
||||
|
||||
//
|
||||
// Need plus END_OF_HOB_LIST
|
||||
//
|
||||
@@ -529,23 +528,24 @@ StandaloneMmMain (
|
||||
// Allocate and zero memory for a MM_CORE_PRIVATE_DATA table and then
|
||||
// initialise it
|
||||
//
|
||||
gMmCorePrivate = (MM_CORE_PRIVATE_DATA *) AllocateRuntimePages(EFI_SIZE_TO_PAGES(sizeof (MM_CORE_PRIVATE_DATA)));
|
||||
gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)AllocateRuntimePages (EFI_SIZE_TO_PAGES (sizeof (MM_CORE_PRIVATE_DATA)));
|
||||
SetMem ((VOID *)(UINTN)gMmCorePrivate, sizeof (MM_CORE_PRIVATE_DATA), 0);
|
||||
gMmCorePrivate->Signature = MM_CORE_PRIVATE_DATA_SIGNATURE;
|
||||
gMmCorePrivate->Signature = MM_CORE_PRIVATE_DATA_SIGNATURE;
|
||||
gMmCorePrivate->MmEntryPointRegistered = FALSE;
|
||||
gMmCorePrivate->InMm = FALSE;
|
||||
gMmCorePrivate->ReturnStatus = EFI_SUCCESS;
|
||||
gMmCorePrivate->InMm = FALSE;
|
||||
gMmCorePrivate->ReturnStatus = EFI_SUCCESS;
|
||||
|
||||
//
|
||||
// Extract the MMRAM ranges from the MMRAM descriptor HOB
|
||||
//
|
||||
MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart);
|
||||
if (MmramRangesHob == NULL)
|
||||
if (MmramRangesHob == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
|
||||
ASSERT (MmramRangesHobData != NULL);
|
||||
MmramRanges = MmramRangesHobData->Descriptor;
|
||||
MmramRanges = MmramRangesHobData->Descriptor;
|
||||
MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
|
||||
ASSERT (MmramRanges);
|
||||
ASSERT (MmramRangeCount);
|
||||
@@ -555,7 +555,7 @@ StandaloneMmMain (
|
||||
// code relies on them being present there
|
||||
//
|
||||
gMmCorePrivate->MmramRangeCount = (UINT64)MmramRangeCount;
|
||||
gMmCorePrivate->MmramRanges =
|
||||
gMmCorePrivate->MmramRanges =
|
||||
(EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePool (MmramRangeCount * sizeof (EFI_MMRAM_DESCRIPTOR));
|
||||
ASSERT (gMmCorePrivate->MmramRanges != 0);
|
||||
CopyMem (
|
||||
@@ -565,7 +565,7 @@ StandaloneMmMain (
|
||||
);
|
||||
} else {
|
||||
DataInHob = GET_GUID_HOB_DATA (GuidHob);
|
||||
gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
|
||||
gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
|
||||
MmramRanges = (EFI_MMRAM_DESCRIPTOR *)(UINTN)gMmCorePrivate->MmramRanges;
|
||||
MmramRangeCount = (UINTN)gMmCorePrivate->MmramRangeCount;
|
||||
}
|
||||
@@ -575,9 +575,13 @@ StandaloneMmMain (
|
||||
//
|
||||
DEBUG ((DEBUG_INFO, "MmramRangeCount - 0x%x\n", MmramRangeCount));
|
||||
for (Index = 0; Index < MmramRangeCount; Index++) {
|
||||
DEBUG ((DEBUG_INFO, "MmramRanges[%d]: 0x%016lx - 0x%lx\n", Index,
|
||||
MmramRanges[Index].CpuStart,
|
||||
MmramRanges[Index].PhysicalSize));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"MmramRanges[%d]: 0x%016lx - 0x%lx\n",
|
||||
Index,
|
||||
MmramRanges[Index].CpuStart,
|
||||
MmramRanges[Index].PhysicalSize
|
||||
));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -600,7 +604,7 @@ StandaloneMmMain (
|
||||
gMmCorePrivate->StandaloneBfvAddress = BfvHob->BaseAddress;
|
||||
}
|
||||
|
||||
gMmCorePrivate->Mmst = (EFI_PHYSICAL_ADDRESS)(UINTN)&gMmCoreMmst;
|
||||
gMmCorePrivate->Mmst = (EFI_PHYSICAL_ADDRESS)(UINTN)&gMmCoreMmst;
|
||||
gMmCorePrivate->MmEntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)MmEntryPoint;
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user