summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
AgeCommit message (Collapse)AuthorFilesLines
2017-03-30MdeModulePkg/DxeHttpLib: Fix the incorrect return status if URI port is invalidJiaxin Wu2-1/+19
Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2017-03-29MdeModulePkg: Add Brotli algorithm decompression librarySong, BinX13-8/+693
- Add Brotli algorithm decompression library support Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-29MdeModulePkg: Copy Brotli algorithm 3rd party source code for librarySong, BinX20-0/+15026
- Copy Brotli algorithm 3rd party source code for library Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-20MdeModulePkg/DxeCapsuleLibFmp: Fix build failureDandan Bi2-4/+4
Move the definition of variable "mEsrtTable" and "mIsVirtualAddrConverted" to DxeCapsuleLib.c. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: jiewen.yao@intel.com
2017-03-17MdeModulePkg: Fix bug in DxeHttplib when converting port number.Zhang Lubo1-1/+5
Http boot on X64 platform is faild, this is caused by the incorrect type conversion when getting port number from Url. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2017-03-17MdeModulePkg/DxeCapsuleLibFmp: Fix build failure issuesDandan Bi1-0/+3
Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-03-16MdeModulePkg/CapsuleLib: Fix runtime issueJiewen Yao1-21/+32
The previous patch has problem on handling capsule request at runtime. This patch fixed the issue. Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
2017-03-16MdeModulePkg BmPerf: Handle "/" separator in debug path for GCC buildStar Zeng1-2/+2
Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-03-13MdeModulePkg/SmiHandlerProfile: Add Context support in UnregisterJiewen Yao1-2/+8
The reason is that we observe that a platform may use same Handler for different context. In order to support Unregister such handler, we have to input context information as well. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-13MdeModulePkg/PrintLib: Refine the comment for AsciiValueToStringS APIHao Wu1-2/+1
The commit refines the comment description for PrintLib API AsciiValueToStringS. This API will not ASSERT when the input/output parameter 'Buffer' is not aligned on a 16-bit boundary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-13MdeModulePkg/UefiBootManagerLib: Generate boot description for NVMERuiyu Ni3-2/+107
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2017-03-13MdeModulePkg/CapsuleLib: Free the buffer returned by GetVariable2 APIHao Wu1-0/+4
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-03-13MdeModulePkg/CapsuleLib: Add lib destructors to handle unclosed eventsHao Wu4-13/+65
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-03-13MdeModulePkg/PlatVarCleanupLib: Add lib destructor for unclosed eventHao Wu2-4/+32
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-03-06MdeModulePkg: Refine casting expression result to bigger sizeHao Wu10-19/+19
There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-06MdeModulePkg: Refine type cast for pointer subtractionHao Wu5-9/+9
For pointer subtraction, the result is of type "ptrdiff_t". According to the C11 standard (Committee Draft - April 12, 2011): "When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. The size of the result is implementation-defined, and its type (a signed integer type) is ptrdiff_t defined in the <stddef.h> header. If the result is not representable in an object of that type, the behavior is undefined." In our codes, there are cases that the pointer subtraction is not performed by pointers to elements of the same array object. This might lead to potential issues, since the behavior is undefined according to C11 standard. Also, since the size of type "ptrdiff_t" is implementation-defined. Some static code checkers may warn that the pointer subtraction might underflow first and then being cast to a bigger size. For example: UINT8 *Ptr1, *Ptr2; UINTN PtrDiff; ... PtrDiff = (UINTN) (Ptr1 - Ptr2); The commit will refine the pointer subtraction expressions by casting each pointer to UINTN first and then perform the subtraction: PtrDiff = (UINTN) Ptr1 - (UINTN) Ptr2; Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-02MdeModulePkg/PrintLib: Add deprecated flag for APIs [A|U]ValueToStringHao Wu1-0/+12
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-02MdeModulePkg: Replace [Ascii|Unicode]ValueToStringHao Wu5-15/+78
It is the follow up of commits 51f0ceb..9e32e97 to replace AsciiValueToString/UnicodeValueToString with AsciiValueToStringS/UnicodeValueToStringS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-02-28MdeModulePkg: Fix coding style issuesDandan Bi1-1/+1
1. Make function comments align with the function. 2. Change the FILE_GUID value in SmmSmiHandlerProfileLib.inf since it is duplicated with the FILE_GUID value in SmiHandlerProfileLibNull.inf 3. Add missing PCD PROMPT&HELP string to uni file. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-02-28MdeModulePkg/BMMUiLib: Replace same logic with API in UefiBootManagerLibDandan Bi2-228/+11
Use the API EfiBootManagerDeleteLoadOptionVariable in UefiBootManagerLib to replace the same logic in function Var_DelBootOption/Var_DelDriverOption. This can make code clean and prevent potential bugs. https://bugzilla.tianocore.org/show_bug.cgi?id=391 Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-02-28MdeModulePkg/NetLib: Use StrToIpv4/6Address in BaseLibRuiyu Ni1-351/+31
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2017-02-24MdeModulePkg PerformanceLib: Fix GCC build failure caused by cfb0abaStar Zeng2-3/+3
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-24MdeModulePkg SmmSmiHandlerProfileLib: Fix GCC build failureStar Zeng1-1/+1
Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-02-23MdeModulePkg: Add performance property configuration tableStar Zeng5-4/+47
Define PERFORMANCE_PROPERTY, and install performance property configuration table in DxeCorePerformanceLib and SmmCorePerformanceLib. Cc: Andrew Fish <afish@apple.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-02-22MdeModulePkg/SmmSmiHandlerProfileLib: Add SMM instance.Jiewen Yao3-0/+173
This instance should be linked by SmmChildDispatcher if SMI handler profile feature is enabled. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-02-21MdeModulePkg/BMMUiLib: Remove old useless data before new save actionDandan Bi2-2/+47
There exits the case that when saving changes in form A, the old saved data in form B are not cleaned, will be saved again with the new save. Thus incorrect UI behavior will be shown. This patch is to remove some useless data. https://bugzilla.tianocore.org/show_bug.cgi?id=385 Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-02-21MdeModulePkg/PrintLib: Add safe print functions [A|U]ValueToStringSHao Wu1-0/+127
Add the following 2 APIs: UnicodeValueToStringS AsciiValueToStringS These safe version APIs are used to enhance their counterpart (APIs without trailing 'S' in function names). They perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. These APIs in the MdeModulePkg/DxePrintLibPrint2Protocol instance follow the same rules with MdePkg/BasePrintLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-21MdeModulePkg/PrintLib: Use EFI_PRINT2S_PROTOCOL for this instanceHao Wu3-21/+49
The commit updates the PrintLib instance MdeModulePkg/Library/DxePrintLibPrint2Protocol to use EFI_PRINT2S_PROTOCOL to implement the APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-21MdeModulePkg/PrintLib: Refine the SPrint functionsHao Wu2-225/+344
For the following 12 APIs in MdeModulePkg/DxePrintLibPrint2Protocol: UnicodeVSPrint UnicodeBSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeBSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiBSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiBSPrintUnicodeFormat AsciiSPrintUnicodeFormat They will ASSERT when: 1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 3) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. 4) The produced string contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. This commits removes the ASSERT case 4) and add the following new ASSERT case: 4) The input parameter 'BufferSize' is greater than (PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format string. And for those ASSERT cases, 0 will be returned by those 12 APIs. For the following 2 APIs in MdeModulePkg/DxePrintLibPrint2Protocol: SPrintLength SPrintLengthAsciiFormat They will ASSERT when: 1) The input parameter 'FormatString' is NULL. 2) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. And for those ASSERT cases, 0 will be returned by those 2 APIs. Now these APIs in the MdeModulePkg/DxePrintLibPrint2Protocol instance follow the same rules with MdePkg/BasePrintLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-16MdeModulePkg UefiBootManagerLib: Correct usages of GUID and ProtocolLiming Gao1-25/+29
https://bugzilla.tianocore.org/show_bug.cgi?id=316 Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-02-09MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP ↵Jiaxin Wu1-5/+3
Port/ContentLength Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the correct status for the HTTP Port/ContentLength. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-02-08MdeModulePkg/UefiBootManagerLib: Initialize Handle before using itRuiyu Ni1-4/+6
BmExpandMediaDevicePath contains a bug that it uses the uninitialized Handle. Since the function is called when the Handle supports BlockIo or SimpleFileSystem, when there is no SimpleFileSystem installed on the Handle, BlockIo is *guaranteed* to be installed on the Handle. The fix initializes the Handle by locating the BlockIo protocol from the device path. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2017-02-08MdeModulePkg: Fix some typos of "according"Liming Gao1-1/+1
Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Rebecca Cran <rebecca@bluestop.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: He Junjie <junjie.he@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2017-01-24MdeModulePkg/FrameBufferBltLib: Use dynamic allocated line bufferRuiyu Ni1-12/+12
https://bugzilla.tianocore.org/show_bug.cgi?id=339 The patch uses dynamic allocated line buffer to reduce memory usage of frame buffer configure. (Original implementation uses 0x4000 bytes for line buffer.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-24MdeModulePkg/FrameBufferBltLib: Refine ConfigurePixelBitMaskFormatRuiyu Ni1-28/+43
https://bugzilla.tianocore.org/show_bug.cgi?id=339 The patch refines ConfigurePixelBitMaskFormat() to prepare the enhancement in next commit: Enhance this library to use dynamic allocated line buffer to reduce memory usage of frame buffer configure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-20MdeModulePkg: Use EfiEventEmptyFunction from UefiLibStar Zeng1-17/+2
Use EfiEventEmptyFunction from UefiLib and remove the duplication of event empty function. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298 Cc: Feng Tian <feng.tian@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-19MdeModulePkg/FileExplorer: Enable functionality of creating new file/folderDandan Bi5-6/+267
https://bugzilla.tianocore.org/show_bug.cgi?id=324 Enhance the FileExplorerlib so that user can create a new file/folder through the UI page. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-01-19MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore formDandan Bi2-5/+9
https://bugzilla.tianocore.org/show_bug.cgi?id=342 When user select and enter a directory, File Explorer will update the form based on the new folders and files in the directory. But when creating question opcodes, the question id is same with previous one and this will cause browser to show the highlight menu incorrectly. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-01-19MdeModulePkg/FileExplorer: Remove the codes of searching load file protocolDandan Bi3-59/+3
https://bugzilla.tianocore.org/show_bug.cgi?id=323 FileExplorer no need to search load file protocol to show files. Now remove the codes. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2017-01-13MdeModulePkg DxeCorePerformanceLib: Only support linking with DxeCoreStar Zeng1-2/+2
DxeCorePerformanceLib is the performance log manager of PEI and DXE phase, and it will also produce Performance(Ex) protocol, it should only support linking with DxeCore. Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-12MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address typeHao Wu1-1/+1
Refine the codes to compare the definition 'SIZE_4GB' with type EFI_PHYSICAL_ADDRESS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-01-12MdeModulePkg/UefiBootManagerLib: Remove redundant type castHao Wu1-3/+3
The type of return value for function EfiBootManagerFindLoadOption() is INTN. When checking its return value, it is unnecessary to type cast -1 to type UINTN. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2017-01-06MdeModulePkg/Bds: Fix a bug that may causes S4 fails to resumeRuiyu Ni1-6/+13
When firmware boots to UiApp, the memory type information settings are saved to NV storage and the settings in HOB are changed as well. Because UiApp is an APPLICATION type of boot option, system doesn't reset when settings change. But when user selects OS to boot in UiApp, because the settings in HOB was updated when booting to UiApp, the BDS doesn't think the settings change, expected reset doesn't happen. The patch fixes this issue to not update the settings in HOB. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2017-01-05MdeModulePkg/DxeCapsuleLibFmp: Fix incorrect MODULE_TYPEDandan Bi1-1/+1
Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-01-03MdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit LoopTimesLaszlo Ersek1-1/+1
The BaseNull instance of S3BootScriptLib obviously doesn't care about the type of the S3BootScriptSaveMemPoll() function's LoopTimes parameter; this lib instance doesn't do anything with the parameters received in S3BootScriptSaveMemPoll(). The PiDxe instance saves the LoopTimes parameter in EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This target field already has UINT64 type. Furthermore, the BootScriptExecuteMemPoll() function in the same library instance already uses a local UINT64 variable called LoopTimes to count up to EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This means that the the UINTN type for S3BootScriptSaveMemPoll()'s LoopTimes parameter is an unnecessary restriction. The callers of S3BootScriptSaveMemPoll() will be updated in the next patches, functionally. At this stage, they will continue to compile, since UINT64 parameters can accept UINTN arguments. Cc: Feng Tian <feng.tian@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2017-01-03MdeModulePkg/PrintLib: Add missing return status check for Print APIsHao Wu1-38/+56
https://bugzilla.tianocore.org/show_bug.cgi?id=307 For the following APIs in PrintLib instance MdeModulePkg\Library\DxePrintLibPrint2Protocol: UnicodeVSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiSPrintUnicodeFormat The internal function DxePrintLibPrint2ProtocolVaListToBaseList() will be called to convert a VA_LIST to a BASE_LIST. However, those APIs miss checking the return value of the internal function. This commit adds codes to check the return value. If the VA_LIST fails to be converted to a BASE_LIST, those PrintLib APIs will return 0 and leave the output 'StartOfBuffer' unmodified. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-12-26MdeModulePkg/CapsuleLib: Follow UEFI 22.2.3 to process FMP.Jiewen Yao4-560/+785
Previous logic does not follow UEFI 22.2.3 to process FMP strictly. It may cause FMP image not be processed in some corner case. The updated logic follows UEFI 22.2.3. The way to check if a capsule is processed is also simplified. The function - ProcessFmpCapsuleImage() is too big, so that we created sub-functions - StartFmpImage(), DumpAllFmpInfo(), GetFmpHandleBufferByType(), SetFmpImageData(), RecordFmpCapsuleStatus() to improve the readability. The function - ProcessTheseCapsules() is too big, so that we created sub-functions - InitCapsulePtr(), AreAllImagesProcessed(), PopulateCapsuleInConfigurationTable() to improve the readability. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-12-26MdeModulePkg/CapsuleLib: Support result rolling over.Jiewen Yao1-5/+4
According to UEFI spec, capsule result variable may roll over to 0. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-12-26MdeModulePkg/CapsuleLib: Add CapsuleTarget support.Jiewen Yao3-9/+40
UEFI spec requires CapsuleTarget to be a device path associated with FMP producer. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-12-23MdeModulePkg/CapsuleLib: remove ImageIndex check.Jiewen Yao1-2/+1
UEFI specification does not require ImageIndex check, it only requires ImageTypeId check. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>