+/**\r
+ Function indicate the current completion progress of the firmware\r
+ update. Platform may override with own specific progress function.\r
+\r
+ @param[in] Completion A value between 1 and 100 indicating the current\r
+ completion progress of the firmware update\r
+\r
+ @retval EFI_SUCESS The capsule update progress was updated.\r
+ @retval EFI_INVALID_PARAMETER Completion is greater than 100%.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+UpdateImageProgress (\r
+ IN UINTN Completion\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ UINTN Seconds;\r
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION *Color;\r
+\r
+ DEBUG((DEBUG_INFO, "Update Progress - %d%%\n", Completion));\r
+\r
+ if (Completion > 100) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ //\r
+ // Use a default timeout of 5 minutes if there is not FMP Progress Protocol.\r
+ //\r
+ Seconds = 5 * 60;\r
+ Color = NULL;\r
+ if (mFmpProgress != NULL) {\r
+ Seconds = mFmpProgress->WatchdogSeconds;\r
+ Color = &mFmpProgress->ProgressBarForegroundColor;\r
+ }\r
+\r
+ //\r
+ // Cancel the watchdog timer\r
+ //\r
+ gBS->SetWatchdogTimer (0, 0x0000, 0, NULL);\r
+\r
+ if (Completion != 100) {\r
+ //\r
+ // Arm the watchdog timer from PCD setting\r
+ //\r
+ if (Seconds != 0) {\r
+ DEBUG ((DEBUG_VERBOSE, "Arm watchdog timer %d seconds\n", Seconds));\r
+ gBS->SetWatchdogTimer (Seconds, 0x0000, 0, NULL);\r
+ }\r
+ }\r
+\r
+ Status = DisplayUpdateProgress (Completion, Color);\r
+\r
+ return Status;\r
+}\r
+\r