]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add DisplayUpdateProgressLib class
authorMichael D Kinney <michael.d.kinney@intel.com>
Sun, 11 Feb 2018 22:58:05 +0000 (14:58 -0800)
committerMichael D Kinney <michael.d.kinney@intel.com>
Mon, 28 May 2018 16:30:10 +0000 (09:30 -0700)
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

Add the DisplayUpdateProgressLib class that is used
to inform the user of progress during updates of
firmware images in firmware devices.  A platform
specific instance of this library can be used to
customize how the user is informed of progress.

Add the EDK II Firmware Management Progress Protocol.
This is an optional protocol that must be installed
onto the same handle as a Firmware Management Protocol.
This new protocol provides the color of a progress
bar that allows different firmware devices to use
different colors during a firmware update.  It also
provides a watchdog timer value in seconds that is
armed each time the Progress() service passed
into Firmware Management Protocol SetImage()
is called.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h [new file with mode: 0644]
MdeModulePkg/Include/Protocol/FirmwareManagementProgress.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h b/MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h
new file mode 100644 (file)
index 0000000..ad1f2ca
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+  Provides services to display completion progress when processing a\r
+  firmware update that updates the firmware image in a firmware device.\r
+  A platform may provide its own instance of this library class to custoimize\r
+  how a user is informed of completion progress.\r
+\r
+  Copyright (c) 2016, Microsoft Corporation\r
+  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+\r
+  All rights reserved.\r
+  Redistribution and use in source and binary forms, with or without\r
+  modification, are permitted provided that the following conditions are met:\r
+  1. Redistributions of source code must retain the above copyright notice,\r
+  this list of conditions and the following disclaimer.\r
+  2. Redistributions in binary form must reproduce the above copyright notice,\r
+  this list of conditions and the following disclaimer in the documentation\r
+   and/or other materials provided with the distribution.\r
+\r
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\r
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r
+  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
+  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
+  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+**/\r
+\r
+#ifndef __DISPLAY_PROGRESS_LIB__\r
+#define __DISPLAY_PROGRESS_LIB__\r
+\r
+#include <Protocol/GraphicsOutput.h>\r
+\r
+/**\r
+  Indicates the current completion progress of a firmware update.\r
+\r
+  @param[in] Completion  A value between 0 and 100 indicating the current\r
+                         completion progress of a firmware update.  This\r
+                         value must the the same or higher than previous\r
+                         calls to this service.  The first call of 0 or a\r
+                         value of 0 after reaching a value of 100 resets\r
+                         the progress indicator to 0.\r
+  @param[in] Color       Color of the progress indicator.  Only used when\r
+                         Completion is 0 to set the color of the progress\r
+                         indicator.  If Color is NULL, then the default color\r
+                         is used.\r
+\r
+  @retval EFI_SUCCESS            Progress displayed successfully.\r
+  @retval EFI_INVALID_PARAMETER  Completion is not in range 0..100.\r
+  @retval EFI_INVALID_PARAMETER  Completion is less than Completion value from\r
+                                 a previous call to this service.\r
+  @retval EFI_NOT_READY          The device used to indicate progress is not\r
+                                 available.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DisplayUpdateProgress (\r
+  IN UINTN                                Completion,\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  *Color       OPTIONAL\r
+  );\r
+\r
+#endif\r
diff --git a/MdeModulePkg/Include/Protocol/FirmwareManagementProgress.h b/MdeModulePkg/Include/Protocol/FirmwareManagementProgress.h
new file mode 100644 (file)
index 0000000..21f9190
--- /dev/null
@@ -0,0 +1,55 @@
+/** @file\r
+  EDK II Firmware Management Progress Protocol.\r
+\r
+  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_H__\r
+#define __EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_H__\r
+\r
+#include <Protocol/GraphicsOutput.h>\r
+\r
+///\r
+/// EDK II Firmware Management Progress Protocol GUID value\r
+///\r
+#define EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_GUID \\r
+  { \\r
+    0x1849bda2, 0x6952, 0x4e86, { 0xa1, 0xdb, 0x55, 0x9a, 0x3c, 0x47, 0x9d, 0xf1 } \\r
+  }\r
+\r
+///\r
+/// EDK II Firmware Management Progress Protocol structure\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The version of this structure.  Initial version value is 0x00000001.\r
+  ///\r
+  UINT32                               Version;\r
+  ///\r
+  /// The foreground color of a progress bar that is used by the Progress()\r
+  /// function that is passed into the Firmware Management Protocol SetImage()\r
+  /// service is called.\r
+  ///\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  ProgressBarForegroundColor;\r
+  ///\r
+  /// The time in seconds to arm the watchdog timer each time the Progress()\r
+  /// function passed into the  Firmware Management Protocol SetImage() service\r
+  /// is called.\r
+  ///\r
+  UINTN                                WatchdogSeconds;\r
+} EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL;\r
+\r
+///\r
+/// EDK II Firmware Management Progress Protocol GUID variable.\r
+///\r
+extern EFI_GUID gEdkiiFirmwareManagementProgressProtocolGuid;\r
+\r
+#endif\r
index cc397185f7b90d7c421d60f3b5e819839a474188..97ec87e1cf30f574ffedc0d8fc0839b7936b76bb 100644 (file)
   #\r
   BmpSupportLib|Include/Library/BmpSupportLib.h\r
 \r
+  ## @libraryclass  Provides services to display completion progress when\r
+  #  processing a firmware update that updates the firmware image in a firmware\r
+  #  device.  A platform may provide its own instance of this library class to\r
+  #  customize how a user is informed of completion progress.\r
+  #\r
+  DisplayUpdateProgressLib|Include/Library/DisplayUpdateProgressLib.h\r
+\r
 [Guids]\r
   ## MdeModule package token space guid\r
   # Include/Guid/MdeModulePkgTokenSpace.h\r
   gEdkiiPlatformSpecificResetFilterProtocolGuid  = { 0x695d7835, 0x8d47, 0x4c11, { 0xab, 0x22, 0xfa, 0x8a, 0xcc, 0xe7, 0xae, 0x7a } }\r
   ## Include/Protocol/PlatformSpecificResetHandler.h\r
   gEdkiiPlatformSpecificResetHandlerProtocolGuid = { 0x2df6ba0b, 0x7092, 0x440d, { 0xbd, 0x4, 0xfb, 0x9, 0x1e, 0xc3, 0xf3, 0xc1 } }\r
+\r
+  ## Include/Protocol/FirmwareManagementProgress.h\r
+  gEdkiiFirmwareManagementProgressProtocolGuid = { 0x1849bda2, 0x6952, 0x4e86, { 0xa1, 0xdb, 0x55, 0x9a, 0x3c, 0x47, 0x9d, 0xf1 } }\r
+\r
 #\r
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r