IntelFsp2WrapperPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the IntelFsp2WrapperPkg 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: Chasel Chiu <chasel.chiu@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:00 -08:00
committed by mergify[bot]
parent 111f2228dd
commit 7c7184e201
26 changed files with 584 additions and 552 deletions

View File

@ -192,6 +192,7 @@ OnEndOfFirmware (
} else { } else {
DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware Success.\n")); DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware Success.\n"));
} }
Status = gBS->LocateProtocol ( Status = gBS->LocateProtocol (
&gAddPerfRecordProtocolGuid, &gAddPerfRecordProtocolGuid,
NULL, NULL,
@ -274,4 +275,3 @@ FspWrapperNotifyDxeEntryPoint (
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -95,6 +95,7 @@ RelocateImageUnder4GIfNeeded (
} else { } else {
Pages = EFI_SIZE_TO_PAGES ((UINTN)ImageContext.ImageSize); Pages = EFI_SIZE_TO_PAGES ((UINTN)ImageContext.ImageSize);
} }
FfsBuffer = 0xFFFFFFFF; FfsBuffer = 0xFFFFFFFF;
Status = gBS->AllocatePages ( Status = gBS->AllocatePages (
AllocateMaxAddress, AllocateMaxAddress,

View File

@ -8,7 +8,6 @@
**/ **/
#include <PiPei.h> #include <PiPei.h>
#include <Library/PeimEntryPoint.h> #include <Library/PeimEntryPoint.h>
@ -68,7 +67,7 @@ PeiFspMemoryInit (
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize != 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) { if ((PcdGet32 (PcdFspmUpdDataAddress) == 0) && (FspmHeaderPtr->CfgRegionSize != 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
// //
// Copy default FSP-M UPD data from Flash // Copy default FSP-M UPD data from Flash
// //
@ -111,10 +110,10 @@ PeiFspMemoryInit (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status)); DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status));
} }
DEBUG ((DEBUG_INFO, "FspMemoryInit status: 0x%x\n", Status)); DEBUG ((DEBUG_INFO, "FspMemoryInit status: 0x%x\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
Status = TestFspMemoryInitApiOutput (FspmUpdDataPtr, &FspHobListPtr); Status = TestFspMemoryInitApiOutput (FspmUpdDataPtr, &FspHobListPtr);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ERROR - TestFspMemoryInitApiOutput () fail, Status = %r\n", Status)); DEBUG ((DEBUG_ERROR, "ERROR - TestFspMemoryInitApiOutput () fail, Status = %r\n", Status));
@ -236,13 +235,21 @@ TcgPpiNotify (
FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig); FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) { if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) {
MeasureFspFirmwareBlob (0, "FSPT", PcdGet32(PcdFsptBaseAddress), MeasureFspFirmwareBlob (
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFsptBaseAddress))->FvLength); 0,
"FSPT",
PcdGet32 (PcdFsptBaseAddress),
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFsptBaseAddress))->FvLength
);
} }
if ((FspMeasureMask & FSP_MEASURE_FSPM) != 0) { if ((FspMeasureMask & FSP_MEASURE_FSPM) != 0) {
MeasureFspFirmwareBlob (0, "FSPM", PcdGet32(PcdFspmBaseAddress), MeasureFspFirmwareBlob (
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength); 0,
"FSPM",
PcdGet32 (PcdFspmBaseAddress),
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspmBaseAddress))->FvLength
);
} }
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -283,7 +283,7 @@ PeiMemoryDiscoveredNotify (
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (PcdGet32 (PcdFspsUpdDataAddress) == 0 && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) { if ((PcdGet32 (PcdFspsUpdDataAddress) == 0) && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {
// //
// Copy default FSP-S UPD data from Flash // Copy default FSP-S UPD data from Flash
// //
@ -315,6 +315,7 @@ PeiMemoryDiscoveredNotify (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status)); DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status));
} }
DEBUG ((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status)); DEBUG ((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status));
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -468,8 +469,12 @@ TcgPpiNotify (
FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig); FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
if ((FspMeasureMask & FSP_MEASURE_FSPS) != 0) { if ((FspMeasureMask & FSP_MEASURE_FSPS) != 0) {
MeasureFspFirmwareBlob (0, "FSPS", PcdGet32(PcdFspsBaseAddress), MeasureFspFirmwareBlob (
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength); 0,
"FSPS",
PcdGet32 (PcdFspsBaseAddress),
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength
);
} }
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -36,4 +36,5 @@ MeasureFspFirmwareBlob (
IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase, IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
IN UINT64 FirmwareBlobLength IN UINT64 FirmwareBlobLength
); );
#endif #endif

View File

@ -121,7 +121,8 @@ MeasureFspFirmwareBlobWithCfg (
FvName = TpmMeasurementGetFvName (FirmwareBlobBase, FirmwareBlobLength); FvName = TpmMeasurementGetFvName (FirmwareBlobBase, FirmwareBlobLength);
if (((Description != NULL) || (FvName != NULL)) && if (((Description != NULL) || (FvName != NULL)) &&
(PcdGet32(PcdTcgPfpMeasurementRevision) >= TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105)) { (PcdGet32 (PcdTcgPfpMeasurementRevision) >= TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105))
{
if (Description != NULL) { if (Description != NULL) {
AsciiSPrint ((CHAR8 *)FvBlob2.BlobDescription, sizeof (FvBlob2.BlobDescription), "%a", Description); AsciiSPrint ((CHAR8 *)FvBlob2.BlobDescription, sizeof (FvBlob2.BlobDescription), "%a", Description);
AsciiSPrint ((CHAR8 *)UpdBlob2.BlobDescription, sizeof (UpdBlob2.BlobDescription), "%aUDP", Description); AsciiSPrint ((CHAR8 *)UpdBlob2.BlobDescription, sizeof (UpdBlob2.BlobDescription), "%aUDP", Description);
@ -238,11 +239,15 @@ MeasureFspFirmwareBlob (
if ((FspMeasureMask & FSP_MEASURE_FSPUPD) != 0) { if ((FspMeasureMask & FSP_MEASURE_FSPUPD) != 0) {
FspHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (FirmwareBlobBase); FspHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (FirmwareBlobBase);
if (FspHeaderPtr != NULL) { if (FspHeaderPtr != NULL) {
return MeasureFspFirmwareBlobWithCfg(Description, FirmwareBlobBase, FirmwareBlobLength, return MeasureFspFirmwareBlobWithCfg (
FspHeaderPtr->CfgRegionOffset, FspHeaderPtr->CfgRegionSize); Description,
FirmwareBlobBase,
FirmwareBlobLength,
FspHeaderPtr->CfgRegionOffset,
FspHeaderPtr->CfgRegionSize
);
} }
} }
return MeasureFirmwareBlob (PcrIndex, Description, FirmwareBlobBase, FirmwareBlobLength); return MeasureFirmwareBlob (PcrIndex, Description, FirmwareBlobBase, FirmwareBlobLength);
} }

View File

@ -58,7 +58,6 @@ FspFindFspHeader (
CheckPointer = CheckPointer + ((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->HeaderLength; CheckPointer = CheckPointer + ((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->HeaderLength;
} }
CheckPointer = CheckPointer + sizeof (EFI_FFS_FILE_HEADER); CheckPointer = CheckPointer + sizeof (EFI_FFS_FILE_HEADER);
if (((EFI_RAW_SECTION *)CheckPointer)->Type != EFI_SECTION_RAW) { if (((EFI_RAW_SECTION *)CheckPointer)->Type != EFI_SECTION_RAW) {

View File

@ -49,4 +49,3 @@ Execute32BitCode (
return Status; return Status;
} }

View File

@ -34,11 +34,21 @@ typedef union {
#pragma pack() #pragma pack()
GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT mGdtEntries[] = { GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT mGdtEntries[] = {
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 0x0: reserve */ {
{{0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 0, 1, 1, 0}}, /* 0x8: compatibility mode */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
{{0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 1, 0, 1, 0}}, /* 0x10: for long mode */ }, /* 0x0: reserve */
{{0xFFFF, 0, 0, 0x3, 1, 0, 1, 0xF, 0, 0, 1, 1, 0}}, /* 0x18: data */ {
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 0x20: reserve */ { 0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 0, 1, 1, 0 }
}, /* 0x8: compatibility mode */
{
{ 0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 1, 0, 1, 0 }
}, /* 0x10: for long mode */
{
{ 0xFFFF, 0, 0, 0x3, 1, 0, 1, 0xF, 0, 0, 1, 1, 0 }
}, /* 0x18: data */
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
}, /* 0x20: reserve */
}; };
// //
@ -100,4 +110,3 @@ Execute32BitCode (
return Status; return Status;
} }

View File

@ -36,14 +36,17 @@ TestFspMemoryInitApiOutput (
DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n")); DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n"));
break; break;
} }
if ((CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspBootLoaderTolumHobGuid))) { if ((CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspBootLoaderTolumHobGuid))) {
DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid Found\n")); DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid Found\n"));
DEBUG ((DEBUG_INFO, "Fill Boot Loader reserved memory range with 0x5A for testing purpose\n")); DEBUG ((DEBUG_INFO, "Fill Boot Loader reserved memory range with 0x5A for testing purpose\n"));
SetMem ((VOID *)(UINTN)Hob.ResourceDescriptor->PhysicalStart, (UINTN)Hob.ResourceDescriptor->ResourceLength, 0x5A); SetMem ((VOID *)(UINTN)Hob.ResourceDescriptor->PhysicalStart, (UINTN)Hob.ResourceDescriptor->ResourceLength, 0x5A);
break; break;
} }
Hob.Raw = GET_NEXT_HOB (Hob); Hob.Raw = GET_NEXT_HOB (Hob);
} }
DEBUG_CODE_END (); DEBUG_CODE_END ();
return RETURN_SUCCESS; return RETURN_SUCCESS;

View File

@ -50,8 +50,9 @@ GetMemorySizeInMemoryTypeInformation (
Status = (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES **)PeiServices, (VOID **)&Hob.Raw); Status = (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES **)PeiServices, (VOID **)&Hob.Raw);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
while (!END_OF_HOB_LIST (Hob)) { while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION && if ((Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) &&
CompareGuid (&Hob.Guid->Name, &gEfiMemoryTypeInformationGuid)) { CompareGuid (&Hob.Guid->Name, &gEfiMemoryTypeInformationGuid))
{
MemoryData = (EFI_MEMORY_TYPE_INFORMATION *)(Hob.Raw + sizeof (EFI_HOB_GENERIC_HEADER) + sizeof (EFI_GUID)); MemoryData = (EFI_MEMORY_TYPE_INFORMATION *)(Hob.Raw + sizeof (EFI_HOB_GENERIC_HEADER) + sizeof (EFI_GUID));
break; break;
} }
@ -177,7 +178,8 @@ PostFspmHobProcess (
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw)) != NULL) { while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw)) != NULL) {
DEBUG ((DEBUG_INFO, "\nResourceType: 0x%x\n", Hob.ResourceDescriptor->ResourceType)); DEBUG ((DEBUG_INFO, "\nResourceType: 0x%x\n", Hob.ResourceDescriptor->ResourceType));
if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) || if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) ||
(Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED)) { (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED))
{
DEBUG ((DEBUG_INFO, "ResourceAttribute: 0x%x\n", Hob.ResourceDescriptor->ResourceAttribute)); DEBUG ((DEBUG_INFO, "ResourceAttribute: 0x%x\n", Hob.ResourceDescriptor->ResourceAttribute));
DEBUG ((DEBUG_INFO, "PhysicalStart: 0x%x\n", Hob.ResourceDescriptor->PhysicalStart)); DEBUG ((DEBUG_INFO, "PhysicalStart: 0x%x\n", Hob.ResourceDescriptor->PhysicalStart));
DEBUG ((DEBUG_INFO, "ResourceLength: 0x%x\n", Hob.ResourceDescriptor->ResourceLength)); DEBUG ((DEBUG_INFO, "ResourceLength: 0x%x\n", Hob.ResourceDescriptor->ResourceLength));
@ -186,7 +188,8 @@ PostFspmHobProcess (
if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) // Found the low memory length below 4G if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) // Found the low memory length below 4G
&& (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB) && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
&& (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB)) { && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB))
{
LowMemorySize += Hob.ResourceDescriptor->ResourceLength; LowMemorySize += Hob.ResourceDescriptor->ResourceLength;
Hob.Raw = GET_NEXT_HOB (Hob); Hob.Raw = GET_NEXT_HOB (Hob);
continue; continue;
@ -195,7 +198,8 @@ PostFspmHobProcess (
if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) // Found the low memory length below 4G if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) // Found the low memory length below 4G
&& (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB) && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
&& (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB) && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB)
&& (CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspReservedMemoryResourceHobGuid))) { && (CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspReservedMemoryResourceHobGuid)))
{
FoundFspMemHob = TRUE; FoundFspMemHob = TRUE;
FspMemoryBase = Hob.ResourceDescriptor->PhysicalStart; FspMemoryBase = Hob.ResourceDescriptor->PhysicalStart;
FspMemorySize = Hob.ResourceDescriptor->ResourceLength; FspMemorySize = Hob.ResourceDescriptor->ResourceLength;
@ -361,6 +365,7 @@ ProcessFspHobList (
); );
} }
} }
FspHob.Raw = GET_NEXT_HOB (FspHob); FspHob.Raw = GET_NEXT_HOB (FspHob);
} }
} }
@ -392,5 +397,6 @@ PostFspsHobProcess (
ASSERT (FspHobList != NULL); ASSERT (FspHobList != NULL);
ProcessFspHobList (FspHobList); ProcessFspHobList (FspHobList);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -6,7 +6,6 @@
**/ **/
#include <PiPei.h> #include <PiPei.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/SerialPortLib.h> #include <Library/SerialPortLib.h>

View File

@ -33,8 +33,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
// //
0x02, 0x02,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
}
}, },
// //
// If platform does not support FSP spec 2.2 remove FSPT_ARCH_UPD structure. // If platform does not support FSP spec 2.2 remove FSPT_ARCH_UPD structure.
@ -58,4 +57,3 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
FixedPcdGet32 (PcdFlashCodeCacheSize), FixedPcdGet32 (PcdFlashCodeCacheSize),
} }
}; };