diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-16 10:14:34 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-16 10:14:34 +0000 |
commit | d12f75fee2579c7d6087f02bdca4715786f67d70 (patch) | |
tree | 7d60e1e97657accc6da852885546ab34e85f7394 /MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | |
parent | 3076397e4b8f6baaea994da79b3c4e934a5f31d7 (diff) | |
download | edk2-d12f75fee2579c7d6087f02bdca4715786f67d70.zip edk2-d12f75fee2579c7d6087f02bdca4715786f67d70.tar.gz edk2-d12f75fee2579c7d6087f02bdca4715786f67d70.tar.bz2 |
Add CapsuleInfo guid to store the list of capsule image guid.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4299 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c')
-rw-r--r-- | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index 5a923cd..e74a591 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -66,16 +66,27 @@ Returns: CapsuleHeader = NULL;
for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) {
+ //
+ // A capsule which has the CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag must have
+ // CAPSULE_FLAGS_PERSIST_ACROSS_RESET set in its header as well.
+ //
CapsuleHeader = CapsuleHeaderArray[ArrayNumber];
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) {
return EFI_INVALID_PARAMETER;
}
- if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
- return EFI_UNSUPPORTED;
- }
+ //
+ // To remove this check. Capsule update supports non reset image.
+ //
+ // if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ // return EFI_UNSUPPORTED;
+ // }
}
//
+ // Check capsule guid is suppored by this platform. To do
+ //
+
+ //
//Assume that capsules have the same flags on reseting or not.
//
CapsuleHeader = CapsuleHeaderArray[0];
@@ -87,10 +98,18 @@ Returns: if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {
return EFI_UNSUPPORTED;
}
-
- if (ScatterGatherList == 0) {
+ //
+ // ScatterGatherList is only referenced if the capsules are defined to persist across
+ // system reset.
+ //
+ if (ScatterGatherList == (EFI_PHYSICAL_ADDRESS) NULL) {
return EFI_INVALID_PARAMETER;
} else {
+ //
+ // ScatterGatherList is only referenced if the capsules are defined to persist across
+ // system reset. Set its value into NV storage to let pre-boot driver to pick it up
+ // after coming through a system reset.
+ //
Status = EfiSetVariable (
EFI_CAPSULE_VARIABLE_NAME,
&gEfiCapsuleVendorGuid,
@@ -99,21 +118,23 @@ Returns: (VOID *) &ScatterGatherList
);
if (Status != EFI_SUCCESS) {
- return EFI_DEVICE_ERROR;
+ return Status;
}
}
return EFI_SUCCESS;
}
//
- //The rest occurs in the condition of non-reset mode
+ // The rest occurs in the condition of non-reset mode
+ // Current Runtime mode doesn't support the non-reset capsule image.
//
if (EfiAtRuntime ()) {
return EFI_INVALID_PARAMETER;
}
//
- //Here should be in the boot-time
+ // Here should be in the boot-time for non-reset capsule image
+ // Default process to Update Capsule image into Flash for any guid image.
//
for (ArrayNumber = 0; ArrayNumber < CapsuleCount ; ArrayNumber++) {
CapsuleHeader = CapsuleHeaderArray[ArrayNumber];
@@ -121,7 +142,7 @@ Returns: BufferPtr = AllocatePool (CapsuleSize);
if (BufferPtr == NULL) {
- return EFI_DEVICE_ERROR;
+ return EFI_OUT_OF_RESOURCES;
}
CopyMem (BufferPtr, (UINT8*)CapsuleHeader+ CapsuleHeader->HeaderSize, CapsuleSize);
@@ -132,7 +153,7 @@ Returns: Status = gDS->ProcessFirmwareVolume (BufferPtr, CapsuleSize, &FvHandle);
if (Status != EFI_SUCCESS) {
FreePool (BufferPtr);
- return EFI_DEVICE_ERROR;
+ return Status;
}
gDS->Dispatch ();
FreePool (BufferPtr);
@@ -189,12 +210,19 @@ Returns: for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) {
CapsuleHeader = CapsuleHeaderArray[ArrayNumber];
+ //
+ // A capsule which has the CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag must have
+ // CAPSULE_FLAGS_PERSIST_ACROSS_RESET set in its header as well.
+ //
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) {
return EFI_INVALID_PARAMETER;
}
- if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
- return EFI_UNSUPPORTED;
- }
+ //
+ // To remove this check. Capsule update supports non reset image.
+ //
+ // if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ // return EFI_UNSUPPORTED;
+ // }
}
//
|