From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C2D0207E5401 for ; Fri, 25 May 2018 04:06:14 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2018 04:06:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,439,1520924400"; d="scan'208";a="202404844" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 25 May 2018 04:06:13 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 25 May 2018 04:06:13 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.47]) with mapi id 14.03.0319.002; Fri, 25 May 2018 19:06:11 +0800 From: "Zeng, Star" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: Sean Brogan , "Dong, Eric" , "Zeng, Star" Thread-Topic: [Patch v3 1/3] MdeModulePkg: Add DisplayUpdateProgressLib class Thread-Index: AQHT8+/bBu2p7zEMf0GljCrPi6S/EqRASKyw Date: Fri, 25 May 2018 11:06:11 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAF111E@shsmsx102.ccr.corp.intel.com> References: <20180525061552.19840-1-michael.d.kinney@intel.com> <20180525061552.19840-2-michael.d.kinney@intel.com> In-Reply-To: <20180525061552.19840-2-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v3 1/3] MdeModulePkg: Add DisplayUpdateProgressLib class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2018 11:06:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng after fixing typo ' custoimize= ' to ' customize '. Thanks, Star -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, May 25, 2018 2:16 PM To: edk2-devel@lists.01.org Cc: Sean Brogan ; Zeng, Star ; Dong, Eric Subject: [Patch v3 1/3] MdeModulePkg: Add DisplayUpdateProgressLib class https://bugzilla.tianocore.org/show_bug.cgi?id=3D801 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 p= rogress 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 differen= t firmware devices to use different colors during a firmware update. It al= so provides a watchdog timer value in seconds that is armed each time the P= rogress() service passed into Firmware Management Protocol SetImage() is ca= lled. Cc: Sean Brogan Cc: Star Zeng Cc: Eric Dong Signed-off-by: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 --- .../Include/Library/DisplayUpdateProgressLib.h | 65 ++++++++++++++++++= ++++ .../Include/Protocol/FirmwareManagementProgress.h | 55 ++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 11 ++++ 3 files changed, 131 insertions(+) create mode 100644 MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h create mode 100644 MdeModulePkg/Include/Protocol/FirmwareManagementProgres= s.h diff --git a/MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h b/MdeM= odulePkg/Include/Library/DisplayUpdateProgressLib.h new file mode 100644 index 0000000000..ad1f2cae38 --- /dev/null +++ b/MdeModulePkg/Include/Library/DisplayUpdateProgressLib.h @@ -0,0 +1,65 @@ +/** @file + Provides services to display completion progress when processing a + firmware update that updates the firmware image in a firmware device. + A platform may provide its own instance of this library class to=20 +custoimize + how a user is informed of completion progress. + + Copyright (c) 2016, Microsoft Corporation Copyright (c) 2018, Intel=20 + Corporation. All rights reserved.
+ + All rights reserved. + Redistribution and use in source and binary forms, with or without =20 + modification, are permitted provided that the following conditions are me= t: + 1. Redistributions of source code must retain the above copyright=20 + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright=20 + notice, this list of conditions and the following disclaimer in the docu= mentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=20 + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=20 + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A = PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR=20 + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR=20 + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF=20 + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR=20 + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,=20 + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE =20 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF= ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +**/ + +#ifndef __DISPLAY_PROGRESS_LIB__ +#define __DISPLAY_PROGRESS_LIB__ + +#include + +/** + Indicates the current completion progress of a firmware update. + + @param[in] Completion A value between 0 and 100 indicating the current + completion progress of a firmware update. This + value must the the same or higher than previous + calls to this service. The first call of 0 or a + value of 0 after reaching a value of 100 resets + the progress indicator to 0. + @param[in] Color Color of the progress indicator. Only used when + Completion is 0 to set the color of the progress + indicator. If Color is NULL, then the default co= lor + is used. + + @retval EFI_SUCCESS Progress displayed successfully. + @retval EFI_INVALID_PARAMETER Completion is not in range 0..100. + @retval EFI_INVALID_PARAMETER Completion is less than Completion value = from + a previous call to this service. + @retval EFI_NOT_READY The device used to indicate progress is n= ot + available. +**/ +EFI_STATUS +EFIAPI +DisplayUpdateProgress ( + IN UINTN Completion, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION *Color OPTIONAL + ); + +#endif diff --git a/MdeModulePkg/Include/Protocol/FirmwareManagementProgress.h b/M= deModulePkg/Include/Protocol/FirmwareManagementProgress.h new file mode 100644 index 0000000000..21f91909ae --- /dev/null +++ b/MdeModulePkg/Include/Protocol/FirmwareManagementProgress.h @@ -0,0 +1,55 @@ +/** @file + EDK II Firmware Management Progress Protocol. + + Copyright (c) 2018, Intel Corporation. All rights reserved.
This=20 + program and the accompanying materials are licensed and made available=20 + under the terms and conditions of the BSD License that accompanies this = distribution. + The full text of the license may be found at =20 + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +**/ + +#ifndef __EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_H__ +#define __EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_H__ + +#include + +/// +/// EDK II Firmware Management Progress Protocol GUID value /// #define=20 +EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL_GUID \ + { \ + 0x1849bda2, 0x6952, 0x4e86, { 0xa1, 0xdb, 0x55, 0x9a, 0x3c, 0x47,=20 +0x9d, 0xf1 } \ + } + +/// +/// EDK II Firmware Management Progress Protocol structure /// typedef=20 +struct { + /// + /// The version of this structure. Initial version value is 0x00000001. + /// + UINT32 Version; + /// + /// The foreground color of a progress bar that is used by the=20 +Progress() + /// function that is passed into the Firmware Management Protocol=20 +SetImage() + /// service is called. + /// + EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION ProgressBarForegroundColor; + /// + /// The time in seconds to arm the watchdog timer each time the=20 +Progress() + /// function passed into the Firmware Management Protocol SetImage()=20 +service + /// is called. + /// + UINTN WatchdogSeconds; +} EDKII_FIRMWARE_MANAGEMENT_PROGRESS_PROTOCOL; + +/// +/// EDK II Firmware Management Progress Protocol GUID variable. +/// +extern EFI_GUID gEdkiiFirmwareManagementProgressProtocolGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec = index cc397185f7..d4833ea178 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -175,6 +175,13 @@ [LibraryClasses] # BmpSupportLib|Include/Library/BmpSupportLib.h =20 + ## @libraryclass Provides services to display completion progress=20 + when # processing a firmware update that updates the firmware image=20 + in a firmware # device. A platform may provide its own instance of=20 + this library class to # custoimize how a user is informed of completion= progress. + # + DisplayUpdateProgressLib|Include/Library/DisplayUpdateProgressLib.h + [Guids] ## MdeModule package token space guid # Include/Guid/MdeModulePkgTokenSpace.h @@ -595,6 +602,10 @@ [Protocols] gEdkiiPlatformSpecificResetFilterProtocolGuid =3D { 0x695d7835, 0x8d47,= 0x4c11, { 0xab, 0x22, 0xfa, 0x8a, 0xcc, 0xe7, 0xae, 0x7a } } ## Include/Protocol/PlatformSpecificResetHandler.h gEdkiiPlatformSpecificResetHandlerProtocolGuid =3D { 0x2df6ba0b, 0x7092,= 0x440d, { 0xbd, 0x4, 0xfb, 0x9, 0x1e, 0xc3, 0xf3, 0xc1 } } + + ## Include/Protocol/FirmwareManagementProgress.h + gEdkiiFirmwareManagementProgressProtocolGuid =3D { 0x1849bda2, 0x6952,=20 + 0x4e86, { 0xa1, 0xdb, 0x55, 0x9a, 0x3c, 0x47, 0x9d, 0xf1 } } + # # [Error.gEfiMdeModulePkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. -- 2.14.2.windows.3