UefiPayloadPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the UefiPayloadPkg 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>
This commit is contained in:
committed by
mergify[bot]
parent
053e878bfb
commit
e5efcf8be8
@@ -15,20 +15,20 @@
|
||||
#include <Guid/NvVariableInfoGuid.h>
|
||||
#include <Library/HobLib.h>
|
||||
|
||||
#define FVB_MEDIA_BLOCK_SIZE 0x1000
|
||||
#define FVB_MEDIA_BLOCK_SIZE 0x1000
|
||||
|
||||
typedef struct {
|
||||
EFI_FIRMWARE_VOLUME_HEADER FvInfo;
|
||||
EFI_FV_BLOCK_MAP_ENTRY End[1];
|
||||
EFI_FIRMWARE_VOLUME_HEADER FvInfo;
|
||||
EFI_FV_BLOCK_MAP_ENTRY End[1];
|
||||
} EFI_FVB2_MEDIA_INFO;
|
||||
|
||||
//
|
||||
// This data structure contains a template of FV header which is used to restore
|
||||
// Fv header if it's corrupted.
|
||||
//
|
||||
EFI_FVB2_MEDIA_INFO mFvbMediaInfo = {
|
||||
EFI_FVB2_MEDIA_INFO mFvbMediaInfo = {
|
||||
{
|
||||
{0,}, // ZeroVector[16]
|
||||
{ 0, }, // ZeroVector[16]
|
||||
EFI_SYSTEM_NV_DATA_FV_GUID,
|
||||
0,
|
||||
EFI_FVH_SIGNATURE,
|
||||
@@ -36,7 +36,7 @@ EFI_FVB2_MEDIA_INFO mFvbMediaInfo = {
|
||||
sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),
|
||||
0, // CheckSum which will be calucated dynamically.
|
||||
0, // ExtHeaderOffset
|
||||
{0,},
|
||||
{ 0, },
|
||||
EFI_FVH_REVISION,
|
||||
{
|
||||
{
|
||||
@@ -64,14 +64,14 @@ InitVariableStore (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 NvStorageBase;
|
||||
UINT32 NvStorageSize;
|
||||
UINT32 NvVariableSize;
|
||||
UINT32 FtwWorkingSize;
|
||||
UINT32 FtwSpareSize;
|
||||
EFI_HOB_GUID_TYPE *GuidHob;
|
||||
NV_VARIABLE_INFO *NvVariableInfo;
|
||||
EFI_STATUS Status;
|
||||
UINT32 NvStorageBase;
|
||||
UINT32 NvStorageSize;
|
||||
UINT32 NvVariableSize;
|
||||
UINT32 FtwWorkingSize;
|
||||
UINT32 FtwSpareSize;
|
||||
EFI_HOB_GUID_TYPE *GuidHob;
|
||||
NV_VARIABLE_INFO *NvVariableInfo;
|
||||
|
||||
//
|
||||
// Find SPI flash variable hob
|
||||
@@ -81,7 +81,8 @@ InitVariableStore (
|
||||
ASSERT (FALSE);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
NvVariableInfo = (NV_VARIABLE_INFO *) GET_GUID_HOB_DATA (GuidHob);
|
||||
|
||||
NvVariableInfo = (NV_VARIABLE_INFO *)GET_GUID_HOB_DATA (GuidHob);
|
||||
|
||||
//
|
||||
// Get variable region base and size.
|
||||
@@ -104,27 +105,27 @@ InitVariableStore (
|
||||
if (NvVariableSize >= 0x80000000) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
Status = PcdSet32S(PcdFlashNvStorageVariableSize, NvVariableSize);
|
||||
|
||||
Status = PcdSet32S (PcdFlashNvStorageVariableSize, NvVariableSize);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = PcdSet32S(PcdFlashNvStorageVariableBase, NvStorageBase);
|
||||
Status = PcdSet32S (PcdFlashNvStorageVariableBase, NvStorageBase);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = PcdSet64S(PcdFlashNvStorageVariableBase64, NvStorageBase);
|
||||
Status = PcdSet64S (PcdFlashNvStorageVariableBase64, NvStorageBase);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = PcdSet32S(PcdFlashNvStorageFtwWorkingSize, FtwWorkingSize);
|
||||
Status = PcdSet32S (PcdFlashNvStorageFtwWorkingSize, FtwWorkingSize);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = PcdSet32S(PcdFlashNvStorageFtwWorkingBase, NvStorageBase + NvVariableSize);
|
||||
Status = PcdSet32S (PcdFlashNvStorageFtwWorkingBase, NvStorageBase + NvVariableSize);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = PcdSet32S(PcdFlashNvStorageFtwSpareSize, FtwSpareSize);
|
||||
Status = PcdSet32S (PcdFlashNvStorageFtwSpareSize, FtwSpareSize);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = PcdSet32S(PcdFlashNvStorageFtwSpareBase, NvStorageBase + FtwSpareSize);
|
||||
Status = PcdSet32S (PcdFlashNvStorageFtwSpareBase, NvStorageBase + FtwSpareSize);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get a heathy FV header used for variable store recovery
|
||||
|
||||
@@ -136,16 +137,15 @@ GetFvHeaderTemplate (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
||||
UINTN FvSize;
|
||||
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
|
||||
UINTN FvSize;
|
||||
|
||||
FvSize = PcdGet32(PcdFlashNvStorageFtwSpareSize) * 2;
|
||||
FvSize = PcdGet32 (PcdFlashNvStorageFtwSpareSize) * 2;
|
||||
FvHeader = &mFvbMediaInfo.FvInfo;
|
||||
FvHeader->FvLength = FvSize;
|
||||
FvHeader->BlockMap[0].NumBlocks = (UINT32) (FvSize / FvHeader->BlockMap[0].Length);
|
||||
FvHeader->Checksum = 0;
|
||||
FvHeader->Checksum = CalculateCheckSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength);
|
||||
FvHeader->BlockMap[0].NumBlocks = (UINT32)(FvSize / FvHeader->BlockMap[0].Length);
|
||||
FvHeader->Checksum = 0;
|
||||
FvHeader->Checksum = CalculateCheckSum16 ((UINT16 *)FvHeader, FvHeader->HeaderLength);
|
||||
|
||||
return FvHeader;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user