MdeModulePkg: Apply uncrustify changes

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

Apply uncrustify changes to .c/.h files in the MdeModulePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:02 -08:00
committed by mergify[bot]
parent 7c7184e201
commit 1436aea4d5
994 changed files with 107608 additions and 101311 deletions

View File

@@ -102,7 +102,7 @@ IsValidCapsuleHeader (
**/
BOOLEAN
IsCapsuleNameCapsule (
IN EFI_CAPSULE_HEADER *CapsuleHeader
IN EFI_CAPSULE_HEADER *CapsuleHeader
);
/**
@@ -118,17 +118,17 @@ IsCapsuleNameCapsule (
**/
EFI_PHYSICAL_ADDRESS *
ValidateCapsuleNameCapsuleIntegrity (
IN EFI_CAPSULE_HEADER *CapsuleHeader,
OUT UINTN *CapsuleNameNum
IN EFI_CAPSULE_HEADER *CapsuleHeader,
OUT UINTN *CapsuleNameNum
);
extern BOOLEAN mDxeCapsuleLibEndOfDxe;
BOOLEAN mNeedReset = FALSE;
extern BOOLEAN mDxeCapsuleLibEndOfDxe;
BOOLEAN mNeedReset = FALSE;
VOID **mCapsulePtr;
CHAR16 **mCapsuleNamePtr;
EFI_STATUS *mCapsuleStatusArray;
UINT32 mCapsuleTotalNumber;
VOID **mCapsulePtr;
CHAR16 **mCapsuleNamePtr;
EFI_STATUS *mCapsuleStatusArray;
UINT32 mCapsuleTotalNumber;
/**
The firmware implements to process the capsule image.
@@ -172,7 +172,7 @@ UpdateImageProgress (
UINTN Seconds;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION *Color;
DEBUG((DEBUG_INFO, "Update Progress - %d%%\n", Completion));
DEBUG ((DEBUG_INFO, "Update Progress - %d%%\n", Completion));
if (Completion > 100) {
return EFI_INVALID_PARAMETER;
@@ -216,15 +216,15 @@ InitCapsulePtr (
VOID
)
{
EFI_PEI_HOB_POINTERS HobPointer;
UINTN Index;
UINTN Index2;
UINTN Index3;
UINTN CapsuleNameNumber;
UINTN CapsuleNameTotalNumber;
UINTN CapsuleNameCapsuleTotalNumber;
VOID **CapsuleNameCapsulePtr;
EFI_PHYSICAL_ADDRESS *CapsuleNameAddress;
EFI_PEI_HOB_POINTERS HobPointer;
UINTN Index;
UINTN Index2;
UINTN Index3;
UINTN CapsuleNameNumber;
UINTN CapsuleNameTotalNumber;
UINTN CapsuleNameCapsuleTotalNumber;
VOID **CapsuleNameCapsulePtr;
EFI_PHYSICAL_ADDRESS *CapsuleNameAddress;
CapsuleNameNumber = 0;
CapsuleNameTotalNumber = 0;
@@ -236,44 +236,47 @@ InitCapsulePtr (
//
HobPointer.Raw = GetHobList ();
while ((HobPointer.Raw = GetNextHob (EFI_HOB_TYPE_UEFI_CAPSULE, HobPointer.Raw)) != NULL) {
if (!IsValidCapsuleHeader((VOID *)(UINTN)HobPointer.Capsule->BaseAddress, HobPointer.Capsule->Length)) {
if (!IsValidCapsuleHeader ((VOID *)(UINTN)HobPointer.Capsule->BaseAddress, HobPointer.Capsule->Length)) {
HobPointer.Header->HobType = EFI_HOB_TYPE_UNUSED; // Mark this hob as invalid
} else {
if (IsCapsuleNameCapsule((VOID *)(UINTN)HobPointer.Capsule->BaseAddress)) {
if (IsCapsuleNameCapsule ((VOID *)(UINTN)HobPointer.Capsule->BaseAddress)) {
CapsuleNameCapsuleTotalNumber++;
} else {
mCapsuleTotalNumber++;
}
}
HobPointer.Raw = GET_NEXT_HOB (HobPointer);
}
DEBUG ((DEBUG_INFO, "mCapsuleTotalNumber - 0x%x\n", mCapsuleTotalNumber));
if (mCapsuleTotalNumber == 0) {
return ;
return;
}
//
// Init temp Capsule Data table.
//
mCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber);
mCapsulePtr = (VOID **)AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber);
if (mCapsulePtr == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate mCapsulePtr fail!\n"));
mCapsuleTotalNumber = 0;
return ;
return;
}
mCapsuleStatusArray = (EFI_STATUS *) AllocateZeroPool (sizeof (EFI_STATUS) * mCapsuleTotalNumber);
mCapsuleStatusArray = (EFI_STATUS *)AllocateZeroPool (sizeof (EFI_STATUS) * mCapsuleTotalNumber);
if (mCapsuleStatusArray == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate mCapsuleStatusArray fail!\n"));
FreePool (mCapsulePtr);
mCapsulePtr = NULL;
mCapsulePtr = NULL;
mCapsuleTotalNumber = 0;
return ;
return;
}
SetMemN (mCapsuleStatusArray, sizeof (EFI_STATUS) * mCapsuleTotalNumber, EFI_NOT_READY);
CapsuleNameCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleNameCapsuleTotalNumber);
CapsuleNameCapsulePtr = (VOID **)AllocateZeroPool (sizeof (VOID *) * CapsuleNameCapsuleTotalNumber);
if (CapsuleNameCapsulePtr == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate CapsuleNameCapsulePtr fail!\n"));
FreePool (mCapsulePtr);
@@ -281,28 +284,29 @@ InitCapsulePtr (
mCapsulePtr = NULL;
mCapsuleStatusArray = NULL;
mCapsuleTotalNumber = 0;
return ;
return;
}
//
// Find all capsule images from hob
//
HobPointer.Raw = GetHobList ();
Index = 0;
Index2 = 0;
Index = 0;
Index2 = 0;
while ((HobPointer.Raw = GetNextHob (EFI_HOB_TYPE_UEFI_CAPSULE, HobPointer.Raw)) != NULL) {
if (IsCapsuleNameCapsule ((VOID *) (UINTN) HobPointer.Capsule->BaseAddress)) {
CapsuleNameCapsulePtr [Index2++] = (VOID *) (UINTN) HobPointer.Capsule->BaseAddress;
if (IsCapsuleNameCapsule ((VOID *)(UINTN)HobPointer.Capsule->BaseAddress)) {
CapsuleNameCapsulePtr[Index2++] = (VOID *)(UINTN)HobPointer.Capsule->BaseAddress;
} else {
mCapsulePtr [Index++] = (VOID *) (UINTN) HobPointer.Capsule->BaseAddress;
mCapsulePtr[Index++] = (VOID *)(UINTN)HobPointer.Capsule->BaseAddress;
}
HobPointer.Raw = GET_NEXT_HOB (HobPointer);
}
//
// Find Capsule On Disk Names
//
for (Index = 0; Index < CapsuleNameCapsuleTotalNumber; Index ++) {
for (Index = 0; Index < CapsuleNameCapsuleTotalNumber; Index++) {
CapsuleNameAddress = ValidateCapsuleNameCapsuleIntegrity (CapsuleNameCapsulePtr[Index], &CapsuleNameNumber);
if (CapsuleNameAddress != NULL ) {
CapsuleNameTotalNumber += CapsuleNameNumber;
@@ -310,7 +314,7 @@ InitCapsulePtr (
}
if (CapsuleNameTotalNumber == mCapsuleTotalNumber) {
mCapsuleNamePtr = (CHAR16 **) AllocateZeroPool (sizeof (CHAR16 *) * mCapsuleTotalNumber);
mCapsuleNamePtr = (CHAR16 **)AllocateZeroPool (sizeof (CHAR16 *) * mCapsuleTotalNumber);
if (mCapsuleNamePtr == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate mCapsuleNamePtr fail!\n"));
FreePool (mCapsulePtr);
@@ -319,14 +323,14 @@ InitCapsulePtr (
mCapsulePtr = NULL;
mCapsuleStatusArray = NULL;
mCapsuleTotalNumber = 0;
return ;
return;
}
for (Index = 0, Index3 = 0; Index < CapsuleNameCapsuleTotalNumber; Index ++) {
for (Index = 0, Index3 = 0; Index < CapsuleNameCapsuleTotalNumber; Index++) {
CapsuleNameAddress = ValidateCapsuleNameCapsuleIntegrity (CapsuleNameCapsulePtr[Index], &CapsuleNameNumber);
if (CapsuleNameAddress != NULL ) {
for (Index2 = 0; Index2 < CapsuleNameNumber; Index2 ++) {
mCapsuleNamePtr[Index3 ++] = (CHAR16 *)(UINTN) CapsuleNameAddress[Index2];
for (Index2 = 0; Index2 < CapsuleNameNumber; Index2++) {
mCapsuleNamePtr[Index3++] = (CHAR16 *)(UINTN)CapsuleNameAddress[Index2];
}
}
}
@@ -367,36 +371,37 @@ PopulateCapsuleInConfigurationTable (
VOID
)
{
VOID **CapsulePtrCache;
EFI_GUID *CapsuleGuidCache;
EFI_CAPSULE_HEADER *CapsuleHeader;
EFI_CAPSULE_TABLE *CapsuleTable;
UINT32 CacheIndex;
UINT32 CacheNumber;
UINT32 CapsuleNumber;
UINTN Index;
UINTN Size;
EFI_STATUS Status;
VOID **CapsulePtrCache;
EFI_GUID *CapsuleGuidCache;
EFI_CAPSULE_HEADER *CapsuleHeader;
EFI_CAPSULE_TABLE *CapsuleTable;
UINT32 CacheIndex;
UINT32 CacheNumber;
UINT32 CapsuleNumber;
UINTN Index;
UINTN Size;
EFI_STATUS Status;
if (mCapsuleTotalNumber == 0) {
return ;
return;
}
CapsulePtrCache = NULL;
CapsuleGuidCache = NULL;
CacheIndex = 0;
CacheNumber = 0;
CapsulePtrCache = NULL;
CapsuleGuidCache = NULL;
CacheIndex = 0;
CacheNumber = 0;
CapsulePtrCache = (VOID **) AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber);
CapsulePtrCache = (VOID **)AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber);
if (CapsulePtrCache == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate CapsulePtrCache fail!\n"));
return ;
return;
}
CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool (sizeof (EFI_GUID) * mCapsuleTotalNumber);
CapsuleGuidCache = (EFI_GUID *)AllocateZeroPool (sizeof (EFI_GUID) * mCapsuleTotalNumber);
if (CapsuleGuidCache == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate CapsuleGuidCache fail!\n"));
FreePool (CapsulePtrCache);
return ;
return;
}
//
@@ -410,7 +415,7 @@ PopulateCapsuleInConfigurationTable (
// array for later sorting capsules by CapsuleGuid.
//
for (Index = 0; Index < mCapsuleTotalNumber; Index++) {
CapsuleHeader = (EFI_CAPSULE_HEADER*) mCapsulePtr [Index];
CapsuleHeader = (EFI_CAPSULE_HEADER *)mCapsulePtr[Index];
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0) {
//
// For each capsule, we compare it with known CapsuleGuid in the CacheArray.
@@ -419,13 +424,15 @@ PopulateCapsuleInConfigurationTable (
//
CacheIndex = 0;
while (CacheIndex < CacheNumber) {
if (CompareGuid(&CapsuleGuidCache[CacheIndex],&CapsuleHeader->CapsuleGuid)) {
if (CompareGuid (&CapsuleGuidCache[CacheIndex], &CapsuleHeader->CapsuleGuid)) {
break;
}
CacheIndex++;
}
if (CacheIndex == CacheNumber) {
CopyMem(&CapsuleGuidCache[CacheNumber++],&CapsuleHeader->CapsuleGuid,sizeof(EFI_GUID));
CopyMem (&CapsuleGuidCache[CacheNumber++], &CapsuleHeader->CapsuleGuid, sizeof (EFI_GUID));
}
}
}
@@ -442,34 +449,36 @@ PopulateCapsuleInConfigurationTable (
for (CacheIndex = 0; CacheIndex < CacheNumber; CacheIndex++) {
CapsuleNumber = 0;
for (Index = 0; Index < mCapsuleTotalNumber; Index++) {
CapsuleHeader = (EFI_CAPSULE_HEADER*) mCapsulePtr [Index];
CapsuleHeader = (EFI_CAPSULE_HEADER *)mCapsulePtr[Index];
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0) {
if (CompareGuid (&CapsuleGuidCache[CacheIndex], &CapsuleHeader->CapsuleGuid)) {
//
// Cache Caspuleheader to the array, this array is uniqued with certain CapsuleGuid.
//
CapsulePtrCache[CapsuleNumber++] = (VOID*)CapsuleHeader;
CapsulePtrCache[CapsuleNumber++] = (VOID *)CapsuleHeader;
}
}
}
if (CapsuleNumber != 0) {
Size = sizeof(EFI_CAPSULE_TABLE) + (CapsuleNumber - 1) * sizeof(VOID*);
Size = sizeof (EFI_CAPSULE_TABLE) + (CapsuleNumber - 1) * sizeof (VOID *);
CapsuleTable = AllocateRuntimePool (Size);
if (CapsuleTable == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate CapsuleTable (%g) fail!\n", &CapsuleGuidCache[CacheIndex]));
continue;
}
CapsuleTable->CapsuleArrayNumber = CapsuleNumber;
CopyMem(&CapsuleTable->CapsulePtr[0], CapsulePtrCache, CapsuleNumber * sizeof(VOID*));
Status = gBS->InstallConfigurationTable (&CapsuleGuidCache[CacheIndex], (VOID*)CapsuleTable);
CopyMem (&CapsuleTable->CapsulePtr[0], CapsulePtrCache, CapsuleNumber * sizeof (VOID *));
Status = gBS->InstallConfigurationTable (&CapsuleGuidCache[CacheIndex], (VOID *)CapsuleTable);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "InstallConfigurationTable (%g) fail!\n", &CapsuleGuidCache[CacheIndex]));
}
}
}
FreePool(CapsuleGuidCache);
FreePool(CapsulePtrCache);
FreePool (CapsuleGuidCache);
FreePool (CapsulePtrCache);
}
/**
@@ -492,15 +501,15 @@ ProcessTheseCapsules (
IN BOOLEAN FirstRound
)
{
EFI_STATUS Status;
EFI_CAPSULE_HEADER *CapsuleHeader;
UINT32 Index;
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
UINT16 EmbeddedDriverCount;
BOOLEAN ResetRequired;
CHAR16 *CapsuleName;
EFI_STATUS Status;
EFI_CAPSULE_HEADER *CapsuleHeader;
UINT32 Index;
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
UINT16 EmbeddedDriverCount;
BOOLEAN ResetRequired;
CHAR16 *CapsuleName;
REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeProcessCapsulesBegin)));
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeProcessCapsulesBegin)));
if (FirstRound) {
InitCapsulePtr ();
@@ -527,20 +536,20 @@ ProcessTheseCapsules (
PopulateCapsuleInConfigurationTable ();
}
REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeUpdatingFirmware)));
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeUpdatingFirmware)));
//
// If Windows UX capsule exist, process it first
//
for (Index = 0; Index < mCapsuleTotalNumber; Index++) {
CapsuleHeader = (EFI_CAPSULE_HEADER*) mCapsulePtr [Index];
CapsuleName = (mCapsuleNamePtr == NULL) ? NULL : mCapsuleNamePtr[Index];
CapsuleHeader = (EFI_CAPSULE_HEADER *)mCapsulePtr[Index];
CapsuleName = (mCapsuleNamePtr == NULL) ? NULL : mCapsuleNamePtr[Index];
if (CompareGuid (&CapsuleHeader->CapsuleGuid, &gWindowsUxCapsuleGuid)) {
DEBUG ((DEBUG_INFO, "ProcessThisCapsuleImage (Ux) - 0x%x\n", CapsuleHeader));
DEBUG ((DEBUG_INFO, "Display logo capsule is found.\n"));
Status = ProcessThisCapsuleImage (CapsuleHeader, CapsuleName, NULL);
mCapsuleStatusArray [Index] = EFI_SUCCESS;
DEBUG((DEBUG_INFO, "ProcessThisCapsuleImage (Ux) - %r\n", Status));
Status = ProcessThisCapsuleImage (CapsuleHeader, CapsuleName, NULL);
mCapsuleStatusArray[Index] = EFI_SUCCESS;
DEBUG ((DEBUG_INFO, "ProcessThisCapsuleImage (Ux) - %r\n", Status));
break;
}
}
@@ -551,46 +560,47 @@ ProcessTheseCapsules (
// All capsules left are recognized by platform.
//
for (Index = 0; Index < mCapsuleTotalNumber; Index++) {
if (mCapsuleStatusArray [Index] != EFI_NOT_READY) {
if (mCapsuleStatusArray[Index] != EFI_NOT_READY) {
// already processed
continue;
}
CapsuleHeader = (EFI_CAPSULE_HEADER*) mCapsulePtr [Index];
CapsuleName = (mCapsuleNamePtr == NULL) ? NULL : mCapsuleNamePtr[Index];
CapsuleHeader = (EFI_CAPSULE_HEADER *)mCapsulePtr[Index];
CapsuleName = (mCapsuleNamePtr == NULL) ? NULL : mCapsuleNamePtr[Index];
if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &gWindowsUxCapsuleGuid)) {
//
// Call capsule library to process capsule image.
//
EmbeddedDriverCount = 0;
if (IsFmpCapsule(CapsuleHeader)) {
if (IsFmpCapsule (CapsuleHeader)) {
Status = ValidateFmpCapsule (CapsuleHeader, &EmbeddedDriverCount);
if (EFI_ERROR(Status)) {
DEBUG((DEBUG_ERROR, "ValidateFmpCapsule failed. Ignore!\n"));
mCapsuleStatusArray [Index] = EFI_ABORTED;
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ValidateFmpCapsule failed. Ignore!\n"));
mCapsuleStatusArray[Index] = EFI_ABORTED;
continue;
}
} else {
mCapsuleStatusArray [Index] = EFI_ABORTED;
mCapsuleStatusArray[Index] = EFI_ABORTED;
continue;
}
if ((!FirstRound) || (EmbeddedDriverCount == 0)) {
DEBUG((DEBUG_INFO, "ProcessThisCapsuleImage - 0x%x\n", CapsuleHeader));
ResetRequired = FALSE;
Status = ProcessThisCapsuleImage (CapsuleHeader, CapsuleName, &ResetRequired);
mCapsuleStatusArray [Index] = Status;
DEBUG((DEBUG_INFO, "ProcessThisCapsuleImage - %r\n", Status));
DEBUG ((DEBUG_INFO, "ProcessThisCapsuleImage - 0x%x\n", CapsuleHeader));
ResetRequired = FALSE;
Status = ProcessThisCapsuleImage (CapsuleHeader, CapsuleName, &ResetRequired);
mCapsuleStatusArray[Index] = Status;
DEBUG ((DEBUG_INFO, "ProcessThisCapsuleImage - %r\n", Status));
if (Status != EFI_NOT_READY) {
if (EFI_ERROR(Status)) {
REPORT_STATUS_CODE(EFI_ERROR_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeUpdateFirmwareFailed)));
if (EFI_ERROR (Status)) {
REPORT_STATUS_CODE (EFI_ERROR_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeUpdateFirmwareFailed)));
DEBUG ((DEBUG_ERROR, "Capsule process failed!\n"));
} else {
REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeUpdateFirmwareSuccess)));
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeUpdateFirmwareSuccess)));
}
mNeedReset |= ResetRequired;
if ((CapsuleHeader->Flags & PcdGet16(PcdSystemRebootAfterCapsuleProcessFlag)) != 0) {
if ((CapsuleHeader->Flags & PcdGet16 (PcdSystemRebootAfterCapsuleProcessFlag)) != 0) {
mNeedReset = TRUE;
}
}
@@ -598,16 +608,17 @@ ProcessTheseCapsules (
}
}
Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, (VOID **)&EsrtManagement);
Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, (VOID **)&EsrtManagement);
//
// Always sync ESRT Cache from FMP Instance
//
if (!EFI_ERROR(Status)) {
EsrtManagement->SyncEsrtFmp();
if (!EFI_ERROR (Status)) {
EsrtManagement->SyncEsrtFmp ();
}
Status = EFI_SUCCESS;
REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeProcessCapsulesEnd)));
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeProcessCapsulesEnd)));
return Status;
}
@@ -620,13 +631,13 @@ DoResetSystem (
VOID
)
{
DEBUG((DEBUG_INFO, "Capsule Request Cold Reboot."));
DEBUG ((DEBUG_INFO, "Capsule Request Cold Reboot."));
REPORT_STATUS_CODE(EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32(PcdStatusCodeSubClassCapsule) | PcdGet32(PcdCapsuleStatusCodeResettingSystem)));
REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE | PcdGet32 (PcdStatusCodeSubClassCapsule) | PcdGet32 (PcdCapsuleStatusCodeResettingSystem)));
gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
CpuDeadLoop();
CpuDeadLoop ();
}
/**
@@ -666,26 +677,27 @@ ProcessCapsules (
VOID
)
{
EFI_STATUS Status;
EFI_STATUS Status;
if (!mDxeCapsuleLibEndOfDxe) {
Status = ProcessTheseCapsules(TRUE);
Status = ProcessTheseCapsules (TRUE);
//
// Reboot System if and only if all capsule processed.
// If not, defer reset to 2nd process.
//
if (mNeedReset && AreAllImagesProcessed()) {
DoResetSystem();
if (mNeedReset && AreAllImagesProcessed ()) {
DoResetSystem ();
}
} else {
Status = ProcessTheseCapsules(FALSE);
Status = ProcessTheseCapsules (FALSE);
//
// Reboot System if required after all capsule processed
//
if (mNeedReset) {
DoResetSystem();
DoResetSystem ();
}
}
return Status;
}