Enable UEFI firmware to support FMP capsule format.
signed-off-by : Chao Zhang <chao.b.zhang@intel.com> reviewed-by : Gao Liming <liming.gao@intel.com> reviewed-by : Yao Jiewen <Jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14773 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
BDS routines to handle capsules.
|
||||
|
||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -52,14 +52,16 @@ BdsProcessCapsules (
|
||||
VOID **CapsulePtr;
|
||||
VOID **CapsulePtrCache;
|
||||
EFI_GUID *CapsuleGuidCache;
|
||||
BOOLEAN NeedReset;
|
||||
|
||||
CapsuleNumber = 0;
|
||||
CapsuleNumber = 0;
|
||||
CapsuleTotalNumber = 0;
|
||||
CacheIndex = 0;
|
||||
CacheNumber = 0;
|
||||
CapsulePtr = NULL;
|
||||
CapsulePtrCache = NULL;
|
||||
CapsuleGuidCache = NULL;
|
||||
CacheIndex = 0;
|
||||
CacheNumber = 0;
|
||||
CapsulePtr = NULL;
|
||||
CapsulePtrCache = NULL;
|
||||
CapsuleGuidCache = NULL;
|
||||
NeedReset = FALSE;
|
||||
|
||||
//
|
||||
// We don't do anything else if the boot mode is not flash-update
|
||||
@@ -190,6 +192,13 @@ BdsProcessCapsules (
|
||||
for (Index = 0; Index < CapsuleTotalNumber; Index++) {
|
||||
CapsuleHeader = (EFI_CAPSULE_HEADER*) CapsulePtr [Index];
|
||||
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
|
||||
//
|
||||
// Always reset system after all capsule processed if FMP capsule exist
|
||||
//
|
||||
if (CompareGuid (&gEfiFmpCapsuleGuid, &CapsuleHeader->CapsuleGuid)){
|
||||
NeedReset = TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// Call capsule library to process capsule image.
|
||||
//
|
||||
@@ -197,6 +206,19 @@ BdsProcessCapsules (
|
||||
}
|
||||
}
|
||||
|
||||
if (NeedReset) {
|
||||
Print(L"Capsule Request Cold Reboot.\n");
|
||||
|
||||
for (Index = 5; Index > 0; Index--) {
|
||||
Print(L"\rResetting system in %d seconds ...", Index);
|
||||
gBS->Stall (1000000);
|
||||
}
|
||||
|
||||
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
||||
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
PlatformBdsLockNonUpdatableFlash ();
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user