summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCommunication
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:17 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit053e878bfb5c9d5eca779789b62891add30b14ba (patch)
tree1cdf5bacb37306e373b8d14bd67c5b3e4f3b269f /UefiCpuPkg/PiSmmCommunication
parent91415a36ae7aaeabb2bbab3762f39544f9aed683 (diff)
downloadedk2-053e878bfb5c9d5eca779789b62891add30b14ba.tar.gz
edk2-053e878bfb5c9d5eca779789b62891add30b14ba.tar.bz2
edk2-053e878bfb5c9d5eca779789b62891add30b14ba.zip
UefiCpuPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the UefiCpuPkg 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: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg/PiSmmCommunication')
-rw-r--r--UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c122
-rw-r--r--UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPrivate.h8
-rw-r--r--UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c60
3 files changed, 96 insertions, 94 deletions
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
index e9e2464be7..8bd0612c7b 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.c
@@ -86,14 +86,14 @@ typedef struct {
} EFI_SMM_SYSTEM_TABLE2_64;
typedef struct {
- EFI_GUID VendorGuid;
- UINT64 VendorTable;
+ EFI_GUID VendorGuid;
+ UINT64 VendorTable;
} EFI_CONFIGURATION_TABLE64;
#endif
#if defined (MDE_CPU_X64)
-typedef EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2_64;
-typedef EFI_CONFIGURATION_TABLE EFI_CONFIGURATION_TABLE64;
+typedef EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2_64;
+typedef EFI_CONFIGURATION_TABLE EFI_CONFIGURATION_TABLE64;
#endif
/**
@@ -113,14 +113,14 @@ typedef EFI_CONFIGURATION_TABLE EFI_CONFIGURATION_TABLE64;
EFI_STATUS
EFIAPI
Communicate (
- IN CONST EFI_PEI_SMM_COMMUNICATION_PPI *This,
- IN OUT VOID *CommBuffer,
- IN OUT UINTN *CommSize
+ IN CONST EFI_PEI_SMM_COMMUNICATION_PPI *This,
+ IN OUT VOID *CommBuffer,
+ IN OUT UINTN *CommSize
);
-EFI_PEI_SMM_COMMUNICATION_PPI mSmmCommunicationPpi = { Communicate };
+EFI_PEI_SMM_COMMUNICATION_PPI mSmmCommunicationPpi = { Communicate };
-EFI_PEI_PPI_DESCRIPTOR mPpiList = {
+EFI_PEI_PPI_DESCRIPTOR mPpiList = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiSmmCommunicationPpiGuid,
&mSmmCommunicationPpi
@@ -136,8 +136,8 @@ GetCommunicationContext (
VOID
)
{
- EFI_HOB_GUID_TYPE *GuidHob;
- EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
+ EFI_HOB_GUID_TYPE *GuidHob;
+ EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
GuidHob = GetFirstGuidHob (&gEfiPeiSmmCommunicationPpiGuid);
ASSERT (GuidHob != NULL);
@@ -154,20 +154,20 @@ GetCommunicationContext (
**/
VOID
SetCommunicationContext (
- IN EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext
+ IN EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext
)
{
- EFI_PEI_HOB_POINTERS Hob;
- UINTN BufferSize;
+ EFI_PEI_HOB_POINTERS Hob;
+ UINTN BufferSize;
BufferSize = sizeof (*SmmCommunicationContext);
- Hob.Raw = BuildGuidHob (
- &gEfiPeiSmmCommunicationPpiGuid,
- BufferSize
- );
+ Hob.Raw = BuildGuidHob (
+ &gEfiPeiSmmCommunicationPpiGuid,
+ BufferSize
+ );
ASSERT (Hob.Raw);
- CopyMem ((VOID *)Hob.Raw, SmmCommunicationContext, sizeof(*SmmCommunicationContext));
+ CopyMem ((VOID *)Hob.Raw, SmmCommunicationContext, sizeof (*SmmCommunicationContext));
}
/**
@@ -181,18 +181,18 @@ SetCommunicationContext (
**/
VOID *
InternalSmstGetVendorTableByGuid (
- IN UINT64 Signature,
- IN EFI_SMM_SYSTEM_TABLE2 *Smst,
- IN EFI_GUID *VendorGuid
+ IN UINT64 Signature,
+ IN EFI_SMM_SYSTEM_TABLE2 *Smst,
+ IN EFI_GUID *VendorGuid
)
{
- EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
- UINTN NumberOfTableEntries;
- UINTN Index;
- EFI_SMM_SYSTEM_TABLE2_64 *Smst64;
- EFI_CONFIGURATION_TABLE64 *SmmConfigurationTable64;
+ EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
+ UINTN NumberOfTableEntries;
+ UINTN Index;
+ EFI_SMM_SYSTEM_TABLE2_64 *Smst64;
+ EFI_CONFIGURATION_TABLE64 *SmmConfigurationTable64;
- if ((sizeof(UINTN) == sizeof(UINT32)) && (Signature == SMM_S3_RESUME_SMM_64)) {
+ if ((sizeof (UINTN) == sizeof (UINT32)) && (Signature == SMM_S3_RESUME_SMM_64)) {
//
// 32 PEI + 64 DXE
//
@@ -200,23 +200,25 @@ InternalSmstGetVendorTableByGuid (
DEBUG ((DEBUG_INFO, "InitCommunicationContext - SmmConfigurationTable: %x\n", Smst64->SmmConfigurationTable));
DEBUG ((DEBUG_INFO, "InitCommunicationContext - NumberOfTableEntries: %x\n", Smst64->NumberOfTableEntries));
SmmConfigurationTable64 = (EFI_CONFIGURATION_TABLE64 *)(UINTN)Smst64->SmmConfigurationTable;
- NumberOfTableEntries = (UINTN)Smst64->NumberOfTableEntries;
+ NumberOfTableEntries = (UINTN)Smst64->NumberOfTableEntries;
for (Index = 0; Index < NumberOfTableEntries; Index++) {
if (CompareGuid (&SmmConfigurationTable64[Index].VendorGuid, VendorGuid)) {
return (VOID *)(UINTN)SmmConfigurationTable64[Index].VendorTable;
}
}
+
return NULL;
} else {
DEBUG ((DEBUG_INFO, "InitCommunicationContext - SmmConfigurationTable: %x\n", Smst->SmmConfigurationTable));
DEBUG ((DEBUG_INFO, "InitCommunicationContext - NumberOfTableEntries: %x\n", Smst->NumberOfTableEntries));
SmmConfigurationTable = Smst->SmmConfigurationTable;
- NumberOfTableEntries = Smst->NumberOfTableEntries;
+ NumberOfTableEntries = Smst->NumberOfTableEntries;
for (Index = 0; Index < NumberOfTableEntries; Index++) {
if (CompareGuid (&SmmConfigurationTable[Index].VendorGuid, VendorGuid)) {
return (VOID *)SmmConfigurationTable[Index].VendorTable;
}
}
+
return NULL;
}
}
@@ -229,14 +231,14 @@ InitCommunicationContext (
VOID
)
{
- EFI_SMRAM_DESCRIPTOR *SmramDescriptor;
- SMM_S3_RESUME_STATE *SmmS3ResumeState;
- VOID *GuidHob;
- EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
+ EFI_SMRAM_DESCRIPTOR *SmramDescriptor;
+ SMM_S3_RESUME_STATE *SmmS3ResumeState;
+ VOID *GuidHob;
+ EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
GuidHob = GetFirstGuidHob (&gEfiAcpiVariableGuid);
ASSERT (GuidHob != NULL);
- SmramDescriptor = (EFI_SMRAM_DESCRIPTOR *) GET_GUID_HOB_DATA (GuidHob);
+ SmramDescriptor = (EFI_SMRAM_DESCRIPTOR *)GET_GUID_HOB_DATA (GuidHob);
SmmS3ResumeState = (SMM_S3_RESUME_STATE *)(UINTN)SmramDescriptor->CpuStart;
DEBUG ((DEBUG_INFO, "InitCommunicationContext - SmmS3ResumeState: %x\n", SmmS3ResumeState));
@@ -251,7 +253,7 @@ InitCommunicationContext (
SetCommunicationContext (SmmCommunicationContext);
- return ;
+ return;
}
/**
@@ -271,17 +273,17 @@ InitCommunicationContext (
EFI_STATUS
EFIAPI
Communicate (
- IN CONST EFI_PEI_SMM_COMMUNICATION_PPI *This,
- IN OUT VOID *CommBuffer,
- IN OUT UINTN *CommSize
+ IN CONST EFI_PEI_SMM_COMMUNICATION_PPI *This,
+ IN OUT VOID *CommBuffer,
+ IN OUT UINTN *CommSize
)
{
- EFI_STATUS Status;
- PEI_SMM_CONTROL_PPI *SmmControl;
- PEI_SMM_ACCESS_PPI *SmmAccess;
- UINT8 SmiCommand;
- UINTN Size;
- EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
+ EFI_STATUS Status;
+ PEI_SMM_CONTROL_PPI *SmmControl;
+ PEI_SMM_ACCESS_PPI *SmmAccess;
+ UINT8 SmiCommand;
+ UINTN Size;
+ EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext;
DEBUG ((DEBUG_INFO, "PiSmmCommunicationPei Communicate Enter\n"));
@@ -333,15 +335,15 @@ Communicate (
// Send command
//
SmiCommand = (UINT8)SmmCommunicationContext->SwSmiNumber;
- Size = sizeof(SmiCommand);
- Status = SmmControl->Trigger (
- (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
- SmmControl,
- (INT8 *)&SmiCommand,
- &Size,
- FALSE,
- 0
- );
+ Size = sizeof (SmiCommand);
+ Status = SmmControl->Trigger (
+ (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+ SmmControl,
+ (INT8 *)&SmiCommand,
+ &Size,
+ FALSE,
+ 0
+ );
ASSERT_EFI_ERROR (Status);
//
@@ -366,14 +368,14 @@ Communicate (
EFI_STATUS
EFIAPI
PiSmmCommunicationPeiEntryPoint (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_SERVICES **PeiServices
)
{
- EFI_STATUS Status;
- PEI_SMM_ACCESS_PPI *SmmAccess;
- EFI_BOOT_MODE BootMode;
- UINTN Index;
+ EFI_STATUS Status;
+ PEI_SMM_ACCESS_PPI *SmmAccess;
+ EFI_BOOT_MODE BootMode;
+ UINTN Index;
BootMode = GetBootModeHob ();
if (BootMode != BOOT_ON_S3_RESUME) {
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPrivate.h b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPrivate.h
index cf1c57eeff..c51c012ebc 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPrivate.h
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPrivate.h
@@ -11,12 +11,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#pragma pack(push, 1)
-#define SMM_COMMUNICATION_SIGNATURE SIGNATURE_32 ('S','M','M','C')
+#define SMM_COMMUNICATION_SIGNATURE SIGNATURE_32 ('S','M','M','C')
typedef struct {
- UINT32 Signature;
- UINT32 SwSmiNumber;
- EFI_PHYSICAL_ADDRESS BufferPtrAddress;
+ UINT32 Signature;
+ UINT32 SwSmiNumber;
+ EFI_PHYSICAL_ADDRESS BufferPtrAddress;
} EFI_SMM_COMMUNICATION_CONTEXT;
#pragma pack(pop)
diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
index 4fdea359d8..2e76ade769 100644
--- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
+++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.c
@@ -39,7 +39,7 @@ SetCommunicationContext (
gSmst,
&gEfiPeiSmmCommunicationPpiGuid,
&mSmmCommunicationContext,
- sizeof(mSmmCommunicationContext)
+ sizeof (mSmmCommunicationContext)
);
ASSERT_EFI_ERROR (Status);
}
@@ -66,14 +66,14 @@ PiSmmCommunicationHandler (
IN OUT UINTN *CommBufferSize OPTIONAL
)
{
- UINTN CommSize;
- EFI_STATUS Status;
- EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;
- EFI_PHYSICAL_ADDRESS *BufferPtrAddress;
+ UINTN CommSize;
+ EFI_STATUS Status;
+ EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;
+ EFI_PHYSICAL_ADDRESS *BufferPtrAddress;
DEBUG ((DEBUG_INFO, "PiSmmCommunicationHandler Enter\n"));
- BufferPtrAddress = (EFI_PHYSICAL_ADDRESS *)(UINTN)mSmmCommunicationContext.BufferPtrAddress;
+ BufferPtrAddress = (EFI_PHYSICAL_ADDRESS *)(UINTN)mSmmCommunicationContext.BufferPtrAddress;
CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)(UINTN)*BufferPtrAddress;
DEBUG ((DEBUG_INFO, "PiSmmCommunicationHandler CommunicateHeader - %x\n", CommunicateHeader));
if (CommunicateHeader == NULL) {
@@ -122,28 +122,28 @@ Done:
@return Allocated address for output.
**/
-VOID*
+VOID *
AllocateAcpiNvsMemoryBelow4G (
- IN UINTN Size
+ IN UINTN Size
)
{
UINTN Pages;
EFI_PHYSICAL_ADDRESS Address;
EFI_STATUS Status;
- VOID* Buffer;
+ VOID *Buffer;
- Pages = EFI_SIZE_TO_PAGES (Size);
+ Pages = EFI_SIZE_TO_PAGES (Size);
Address = 0xffffffff;
- Status = gBS->AllocatePages (
- AllocateMaxAddress,
- EfiACPIMemoryNVS,
- Pages,
- &Address
- );
+ Status = gBS->AllocatePages (
+ AllocateMaxAddress,
+ EfiACPIMemoryNVS,
+ Pages,
+ &Address
+ );
ASSERT_EFI_ERROR (Status);
- Buffer = (VOID *) (UINTN) Address;
+ Buffer = (VOID *)(UINTN)Address;
ZeroMem (Buffer, Size);
return Buffer;
@@ -165,11 +165,11 @@ PiSmmCommunicationSmmEntryPoint (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_SMM_SW_DISPATCH2_PROTOCOL *SmmSwDispatch2;
- EFI_SMM_SW_REGISTER_CONTEXT SmmSwDispatchContext;
- EFI_HANDLE DispatchHandle;
- EFI_PHYSICAL_ADDRESS *BufferPtrAddress;
+ EFI_STATUS Status;
+ EFI_SMM_SW_DISPATCH2_PROTOCOL *SmmSwDispatch2;
+ EFI_SMM_SW_REGISTER_CONTEXT SmmSwDispatchContext;
+ EFI_HANDLE DispatchHandle;
+ EFI_PHYSICAL_ADDRESS *BufferPtrAddress;
//
// Register software SMI handler
@@ -182,24 +182,24 @@ PiSmmCommunicationSmmEntryPoint (
ASSERT_EFI_ERROR (Status);
SmmSwDispatchContext.SwSmiInputValue = (UINTN)-1;
- Status = SmmSwDispatch2->Register (
- SmmSwDispatch2,
- PiSmmCommunicationHandler,
- &SmmSwDispatchContext,
- &DispatchHandle
- );
+ Status = SmmSwDispatch2->Register (
+ SmmSwDispatch2,
+ PiSmmCommunicationHandler,
+ &SmmSwDispatchContext,
+ &DispatchHandle
+ );
ASSERT_EFI_ERROR (Status);
DEBUG ((DEBUG_INFO, "SmmCommunication SwSmi: %x\n", (UINTN)SmmSwDispatchContext.SwSmiInputValue));
- BufferPtrAddress = AllocateAcpiNvsMemoryBelow4G (sizeof(EFI_PHYSICAL_ADDRESS));
+ BufferPtrAddress = AllocateAcpiNvsMemoryBelow4G (sizeof (EFI_PHYSICAL_ADDRESS));
ASSERT (BufferPtrAddress != NULL);
DEBUG ((DEBUG_INFO, "SmmCommunication BufferPtrAddress: 0x%016lx, BufferPtr: 0x%016lx\n", (EFI_PHYSICAL_ADDRESS)(UINTN)BufferPtrAddress, *BufferPtrAddress));
//
// Save context
//
- mSmmCommunicationContext.SwSmiNumber = (UINT32)SmmSwDispatchContext.SwSmiInputValue;
+ mSmmCommunicationContext.SwSmiNumber = (UINT32)SmmSwDispatchContext.SwSmiInputValue;
mSmmCommunicationContext.BufferPtrAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)BufferPtrAddress;
SetCommunicationContext ();