summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Drivers
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:16 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit91415a36ae7aaeabb2bbab3762f39544f9aed683 (patch)
tree2e851e8e100b2ddb6646d8a7a2c4030a9f80cb85 /StandaloneMmPkg/Drivers
parentc1e126b1196de75e0a4cda21e4551ea9bb05e059 (diff)
downloadedk2-91415a36ae7aaeabb2bbab3762f39544f9aed683.tar.gz
edk2-91415a36ae7aaeabb2bbab3762f39544f9aed683.tar.bz2
edk2-91415a36ae7aaeabb2bbab3762f39544f9aed683.zip
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>
Diffstat (limited to 'StandaloneMmPkg/Drivers')
-rw-r--r--StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c78
-rw-r--r--StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c81
-rw-r--r--StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h26
3 files changed, 100 insertions, 85 deletions
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
index d9d1fe1551..1ac15ddda2 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
@@ -11,7 +11,6 @@
#include <Base.h>
#include <Pi/PiMmCis.h>
-
#include <Library/ArmSvcLib.h>
#include <Library/ArmLib.h>
#include <Library/BaseMemoryLib.h>
@@ -32,7 +31,7 @@ EFI_STATUS
EFIAPI
MmFoundationEntryRegister (
IN CONST EFI_MM_CONFIGURATION_PROTOCOL *This,
- IN EFI_MM_ENTRY_POINT MmEntryPoint
+ IN EFI_MM_ENTRY_POINT MmEntryPoint
);
//
@@ -46,19 +45,19 @@ MmFoundationEntryRegister (
// number of CPUs in the system are made known through the
// MP_INFORMATION_HOB_DATA.
//
-EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext = NULL;
+EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext = NULL;
// Descriptor with whereabouts of memory used for communication with the normal world
EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
-MP_INFORMATION_HOB_DATA *mMpInformationHobData;
+MP_INFORMATION_HOB_DATA *mMpInformationHobData;
-EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = {
+EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = {
0,
MmFoundationEntryRegister
};
-STATIC EFI_MM_ENTRY_POINT mMmEntryPoint = NULL;
+STATIC EFI_MM_ENTRY_POINT mMmEntryPoint = NULL;
/**
The PI Standalone MM entry point for the TF-A CPU driver.
@@ -75,15 +74,15 @@ STATIC EFI_MM_ENTRY_POINT mMmEntryPoint = NULL;
**/
EFI_STATUS
PiMmStandaloneArmTfCpuDriverEntry (
- IN UINTN EventId,
- IN UINTN CpuNumber,
- IN UINTN NsCommBufferAddr
+ IN UINTN EventId,
+ IN UINTN CpuNumber,
+ IN UINTN NsCommBufferAddr
)
{
- EFI_MM_COMMUNICATE_HEADER *GuidedEventContext;
- EFI_MM_ENTRY_CONTEXT MmEntryPointContext;
- EFI_STATUS Status;
- UINTN NsCommBufferSize;
+ EFI_MM_COMMUNICATE_HEADER *GuidedEventContext;
+ EFI_MM_ENTRY_CONTEXT MmEntryPointContext;
+ EFI_STATUS Status;
+ UINTN NsCommBufferSize;
DEBUG ((DEBUG_INFO, "Received event - 0x%x on cpu %d\n", EventId, CpuNumber));
@@ -94,7 +93,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
// between synchronous and asynchronous events.
//
if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) &&
- (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) {
+ (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId))
+ {
DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
return EFI_INVALID_PARAMETER;
}
@@ -109,17 +109,19 @@ PiMmStandaloneArmTfCpuDriverEntry (
}
if ((NsCommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >=
- (mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)) {
+ (mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize))
+ {
return EFI_INVALID_PARAMETER;
}
// Find out the size of the buffer passed
- NsCommBufferSize = ((EFI_MM_COMMUNICATE_HEADER *) NsCommBufferAddr)->MessageLength +
- sizeof (EFI_MM_COMMUNICATE_HEADER);
+ NsCommBufferSize = ((EFI_MM_COMMUNICATE_HEADER *)NsCommBufferAddr)->MessageLength +
+ sizeof (EFI_MM_COMMUNICATE_HEADER);
// perform bounds check.
if (NsCommBufferAddr + NsCommBufferSize >=
- mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize) {
+ mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)
+ {
return EFI_ACCESS_DENIED;
}
@@ -129,7 +131,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
Status = mMmst->MmAllocatePool (
EfiRuntimeServicesData,
NsCommBufferSize,
- (VOID **) &GuidedEventContext
+ (VOID **)&GuidedEventContext
);
if (Status != EFI_SUCCESS) {
@@ -139,7 +141,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
// X1 contains the VA of the normal world memory accessible from
// S-EL0
- CopyMem (GuidedEventContext, (CONST VOID *) NsCommBufferAddr, NsCommBufferSize);
+ CopyMem (GuidedEventContext, (CONST VOID *)NsCommBufferAddr, NsCommBufferSize);
// Stash the pointer to the allocated Event Context for this CPU
PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext;
@@ -147,13 +149,13 @@ PiMmStandaloneArmTfCpuDriverEntry (
ZeroMem (&MmEntryPointContext, sizeof (EFI_MM_ENTRY_CONTEXT));
MmEntryPointContext.CurrentlyExecutingCpu = CpuNumber;
- MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
+ MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
// Populate the MM system table with MP and state information
mMmst->CurrentlyExecutingCpu = CpuNumber;
- mMmst->NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
- mMmst->CpuSaveStateSize = 0;
- mMmst->CpuSaveState = NULL;
+ mMmst->NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
+ mMmst->CpuSaveStateSize = 0;
+ mMmst->CpuSaveState = NULL;
if (mMmEntryPoint == NULL) {
DEBUG ((DEBUG_INFO, "Mm Entry point Not Found\n"));
@@ -164,12 +166,13 @@ PiMmStandaloneArmTfCpuDriverEntry (
// Free the memory allocation done earlier and reset the per-cpu context
ASSERT (GuidedEventContext);
- CopyMem ((VOID *)NsCommBufferAddr, (CONST VOID *) GuidedEventContext, NsCommBufferSize);
+ CopyMem ((VOID *)NsCommBufferAddr, (CONST VOID *)GuidedEventContext, NsCommBufferSize);
- Status = mMmst->MmFreePool ((VOID *) GuidedEventContext);
+ Status = mMmst->MmFreePool ((VOID *)GuidedEventContext);
if (Status != EFI_SUCCESS) {
return EFI_OUT_OF_RESOURCES;
}
+
PerCpuGuidedEventContext[CpuNumber] = NULL;
return Status;
@@ -187,7 +190,7 @@ EFI_STATUS
EFIAPI
MmFoundationEntryRegister (
IN CONST EFI_MM_CONFIGURATION_PROTOCOL *This,
- IN EFI_MM_ENTRY_POINT MmEntryPoint
+ IN EFI_MM_ENTRY_POINT MmEntryPoint
)
{
// store the entry point in a global
@@ -214,14 +217,14 @@ MmFoundationEntryRegister (
EFI_STATUS
EFIAPI
PiMmCpuTpFwRootMmiHandler (
- IN EFI_HANDLE DispatchHandle,
- IN CONST VOID *Context OPTIONAL,
- IN OUT VOID *CommBuffer OPTIONAL,
- IN OUT UINTN *CommBufferSize OPTIONAL
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
)
{
- EFI_STATUS Status;
- UINTN CpuNumber;
+ EFI_STATUS Status;
+ UINTN CpuNumber;
ASSERT (Context == NULL);
ASSERT (CommBuffer == NULL);
@@ -232,9 +235,12 @@ PiMmCpuTpFwRootMmiHandler (
return EFI_NOT_FOUND;
}
- DEBUG ((DEBUG_INFO, "CommBuffer - 0x%x, CommBufferSize - 0x%x\n",
- PerCpuGuidedEventContext[CpuNumber],
- PerCpuGuidedEventContext[CpuNumber]->MessageLength));
+ DEBUG ((
+ DEBUG_INFO,
+ "CommBuffer - 0x%x, CommBufferSize - 0x%x\n",
+ PerCpuGuidedEventContext[CpuNumber],
+ PerCpuGuidedEventContext[CpuNumber]->MessageLength
+ ));
Status = mMmst->MmiManage (
&PerCpuGuidedEventContext[CpuNumber]->HeaderGuid,
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
index 10097f792f..24dff82268 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
@@ -22,27 +22,26 @@
#include <Guid/ZeroGuid.h>
#include <Guid/MmramMemoryReserve.h>
-
#include "StandaloneMmCpu.h"
// GUID to identify HOB with whereabouts of communication buffer with Normal
// World
-extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid;
+extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid;
// GUID to identify HOB where the entry point of this CPU driver will be
// populated to allow the entry point driver to invoke it upon receipt of an
// event
-extern EFI_GUID gEfiArmTfCpuDriverEpDescriptorGuid;
+extern EFI_GUID gEfiArmTfCpuDriverEpDescriptorGuid;
//
// Private copy of the MM system table for future use
//
-EFI_MM_SYSTEM_TABLE *mMmst = NULL;
+EFI_MM_SYSTEM_TABLE *mMmst = NULL;
//
// Globals used to initialize the protocol
//
-STATIC EFI_HANDLE mMmCpuHandle = NULL;
+STATIC EFI_HANDLE mMmCpuHandle = NULL;
/** Returns the HOB data for the matching HOB GUID.
@@ -56,12 +55,12 @@ STATIC EFI_HANDLE mMmCpuHandle = NULL;
**/
EFI_STATUS
GetGuidedHobData (
- IN VOID *HobList,
- IN CONST EFI_GUID *HobGuid,
- OUT VOID **HobData
+ IN VOID *HobList,
+ IN CONST EFI_GUID *HobGuid,
+ OUT VOID **HobData
)
{
- EFI_HOB_GUID_TYPE *Hob;
+ EFI_HOB_GUID_TYPE *Hob;
if ((HobList == NULL) || (HobGuid == NULL) || (HobData == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -93,20 +92,20 @@ GetGuidedHobData (
**/
EFI_STATUS
StandaloneMmCpuInitialize (
- IN EFI_HANDLE ImageHandle, // not actual imagehandle
- IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable
+ IN EFI_HANDLE ImageHandle, // not actual imagehandle
+ IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable
)
{
- ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc;
- EFI_CONFIGURATION_TABLE *ConfigurationTable;
- MP_INFORMATION_HOB_DATA *MpInformationHobData;
- EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange;
+ ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc;
+ EFI_CONFIGURATION_TABLE *ConfigurationTable;
+ MP_INFORMATION_HOB_DATA *MpInformationHobData;
+ EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange;
EFI_STATUS Status;
EFI_HANDLE DispatchHandle;
UINT32 MpInfoSize;
UINTN Index;
UINTN ArraySize;
- VOID *HobStart;
+ VOID *HobStart;
ASSERT (SystemTable != NULL);
mMmst = SystemTable;
@@ -155,7 +154,7 @@ StandaloneMmCpuInitialize (
Status = GetGuidedHobData (
HobStart,
&gEfiArmTfCpuDriverEpDescriptorGuid,
- (VOID **) &CpuDriverEntryPointDesc
+ (VOID **)&CpuDriverEntryPointDesc
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "ArmTfCpuDriverEpDesc HOB data extraction failed - 0x%x\n", Status));
@@ -163,9 +162,12 @@ StandaloneMmCpuInitialize (
}
// Share the entry point of the CPU driver
- DEBUG ((DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx = 0x%lx\n",
- (UINTN) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr,
- (UINTN) PiMmStandaloneArmTfCpuDriverEntry));
+ DEBUG ((
+ DEBUG_INFO,
+ "Sharing Cpu Driver EP *0x%lx = 0x%lx\n",
+ (UINTN)CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr,
+ (UINTN)PiMmStandaloneArmTfCpuDriverEntry
+ ));
*(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandaloneArmTfCpuDriverEntry;
// Find the descriptor that contains the whereabouts of the buffer for
@@ -173,17 +175,17 @@ StandaloneMmCpuInitialize (
Status = GetGuidedHobData (
HobStart,
&gEfiStandaloneMmNonSecureBufferGuid,
- (VOID **) &NsCommBufMmramRange
+ (VOID **)&NsCommBufMmramRange
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "NsCommBufMmramRange HOB data extraction failed - 0x%x\n", Status));
return Status;
}
- DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalStart));
- DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalSize));
+ DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINTN)NsCommBufMmramRange->PhysicalStart));
+ DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINTN)NsCommBufMmramRange->PhysicalSize));
- CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof(EFI_MMRAM_DESCRIPTOR));
+ CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof (EFI_MMRAM_DESCRIPTOR));
DEBUG ((DEBUG_INFO, "mNsCommBuffer: 0x%016lx - 0x%lx\n", mNsCommBuffer.CpuStart, mNsCommBuffer.PhysicalSize));
//
@@ -192,7 +194,7 @@ StandaloneMmCpuInitialize (
Status = GetGuidedHobData (
HobStart,
&gMpInformationHobGuid,
- (VOID **) &MpInformationHobData
+ (VOID **)&MpInformationHobData
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "MpInformationHob extraction failed - 0x%x\n", Status));
@@ -206,11 +208,11 @@ StandaloneMmCpuInitialize (
//
MpInfoSize = sizeof (MP_INFORMATION_HOB_DATA) +
(sizeof (EFI_PROCESSOR_INFORMATION) *
- MpInformationHobData->NumberOfProcessors);
+ MpInformationHobData->NumberOfProcessors);
Status = mMmst->MmAllocatePool (
EfiRuntimeServicesData,
MpInfoSize,
- (VOID **) &mMpInformationHobData
+ (VOID **)&mMpInformationHobData
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "mMpInformationHobData mem alloc failed - 0x%x\n", Status));
@@ -220,15 +222,21 @@ StandaloneMmCpuInitialize (
CopyMem (mMpInformationHobData, MpInformationHobData, MpInfoSize);
// Print MP information
- DEBUG ((DEBUG_INFO, "mMpInformationHobData: 0x%016lx - 0x%lx\n",
- mMpInformationHobData->NumberOfProcessors,
- mMpInformationHobData->NumberOfEnabledProcessors));
+ DEBUG ((
+ DEBUG_INFO,
+ "mMpInformationHobData: 0x%016lx - 0x%lx\n",
+ mMpInformationHobData->NumberOfProcessors,
+ mMpInformationHobData->NumberOfEnabledProcessors
+ ));
for (Index = 0; Index < mMpInformationHobData->NumberOfProcessors; Index++) {
- DEBUG ((DEBUG_INFO, "mMpInformationHobData[0x%lx]: %d, %d, %d\n",
- mMpInformationHobData->ProcessorInfoBuffer[Index].ProcessorId,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Package,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Core,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Thread));
+ DEBUG ((
+ DEBUG_INFO,
+ "mMpInformationHobData[0x%lx]: %d, %d, %d\n",
+ mMpInformationHobData->ProcessorInfoBuffer[Index].ProcessorId,
+ mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Package,
+ mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Core,
+ mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Thread
+ ));
}
//
@@ -240,11 +248,12 @@ StandaloneMmCpuInitialize (
Status = mMmst->MmAllocatePool (
EfiRuntimeServicesData,
ArraySize,
- (VOID **) &PerCpuGuidedEventContext
+ (VOID **)&PerCpuGuidedEventContext
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "PerCpuGuidedEventContext mem alloc failed - 0x%x\n", Status));
return Status;
}
+
return Status;
}
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
index 6f7a3ccd9c..251765eddf 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
@@ -18,20 +18,20 @@
//
// CPU driver initialization specific declarations
//
-extern EFI_MM_SYSTEM_TABLE *mMmst;
+extern EFI_MM_SYSTEM_TABLE *mMmst;
//
// CPU State Save protocol specific declarations
//
-extern EFI_MM_CPU_PROTOCOL mMmCpuState;
+extern EFI_MM_CPU_PROTOCOL mMmCpuState;
//
// MM event handling specific declarations
//
-extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
-extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
-extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
-extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
+extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
+extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
+extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
+extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
/**
The PI Standalone MM entry point for the TF-A CPU driver.
@@ -48,9 +48,9 @@ extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
**/
EFI_STATUS
PiMmStandaloneArmTfCpuDriverEntry (
- IN UINTN EventId,
- IN UINTN CpuNumber,
- IN UINTN NsCommBufferAddr
+ IN UINTN EventId,
+ IN UINTN CpuNumber,
+ IN UINTN NsCommBufferAddr
);
/**
@@ -72,10 +72,10 @@ PiMmStandaloneArmTfCpuDriverEntry (
EFI_STATUS
EFIAPI
PiMmCpuTpFwRootMmiHandler (
- IN EFI_HANDLE DispatchHandle,
- IN CONST VOID *Context OPTIONAL,
- IN OUT VOID *CommBuffer OPTIONAL,
- IN OUT UINTN *CommBufferSize OPTIONAL
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
);
#endif