summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Remove DxeSmmPerformanceLibDandan Bi2018-08-063-958/+0
| | | | | | | | | | | | | | | | DxeSmmPerformanceLib previously is used by DP tool. But in new pweformance infrastructure, we have updated Dp tool to get the performance data from firmware performance data table in ACPI. Now the DxeSmmPerformanceLib is not used by any module. So remove it from edk2 code base to avoid being used by mistake. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg DxeCapsuleLibFmp: Add NULL check to the return buffersStar Zeng2018-08-031-1/+3
| | | | | | | | | | Add NULL check to the return buffers from GetFmpHandleBufferByType(). Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Hao A Wu <Hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Hao A Wu <Hao.a.wu@intel.com>
* MdeModulePkg DxeCapsuleLibFmp: Free HandleBuffer after it is usedStar Zeng2018-08-011-0/+4
| | | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg DxeCapsuleLib: Use Attr to know whether reset is requiredStar Zeng2018-08-012-40/+134
| | | | | | | | | | | | Current DxeCapsuleLibFmp always do reset for FMP capsule. Actually, the code should use Attributes from FMP descriptor to know whether reset is required or not. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg DxeCapsuleLibFmp: Fix typo "EsrtSyncFmp" to "SyncEsrtFmp"Star Zeng2018-07-281-1/+1
| | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg DxeCapsuleLibFmp: Refine the code to check FmpImageSizeStar Zeng2018-07-271-4/+4
| | | | | | | | | | | The code to check FmpImageSize again OFFSET_OF (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER, UpdateHardwareInstance) can be refined to check against FmpImageHeaderSize. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBootRuiyu Ni2018-07-271-1/+18
| | | | | | | | | | | | | | The patch adds a new API PlatformBootManagerUnableToBoot() to PlatformBootManagerLib. The new API is provided by platform bds library and is called when no boot option could be launched. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
* MdeModulePkg DxeCapsuleLibFmp: Fix typo 'Press' to 'Process'Star Zeng2018-07-111-1/+1
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ming Shao <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/UefiBootManagerLib: Fix small LoadOptionToVariable leakThomas Palmer2018-07-061-8/+11
| | | | | | | | | After calling SetVariable, the allocated memory in Variable should be freed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/SmmCorePerformanceLib: Update mPerformanceLengthDandan Bi2018-07-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | In mSmmBootPerformanceTable there are two parts, one is the FPDT table header and the other is FPDT records. Currently: mPerformanceLength: The length of existing FPDT records. mMaxPerformanceLength: The maximum length allocated for mSmmBootPerformanceTable(including FPDT table header length and existing FPDT records length) But when compare mPerformanceLength with mMaxPerformanceLength to check whether need to allocate new buffer for new FPDT record, we miss to add mPerformanceLength with header length, which will cause pool allocation behavior is not correct. Now update the mPerformanceLength to fix this issue: updated mPerformanceLength = FPDT table header length + existing FPDT records length. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/[Pei|Dxe]ResetSystemLib: Add PPI/Protocol dependencyRuiyu Ni2018-07-032-0/+5
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ResetUtilityLib: Add pack(1) for reset data structureRuiyu Ni2018-07-031-1/+8
| | | | | | | | | | | | | | | RESET_UTILITY_GUID_SPECIFIC_RESET_DATA structure should be declared as pack(1). The patch adds the missing pack(1) pragma. (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, ResetSubtype)) is used to replace &ResetData.ResetSubType to resolve C4366 VS compiler warning. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0Ruiyu Ni2018-07-031-0/+9
| | | | | | | | | | | The patch adds check logic to make sure that for a input BMP file, the width or height is not 0; for a input GOP blt buffer, the width or height is not 0. Otherwise, UNSUPPORTED status is returned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/BmpSupportLib: Correct debug messageRuiyu Ni2018-07-031-2/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/PerformanceLib: Add NULL pointer checkDandan Bi2018-06-283-17/+32
| | | | | | | | | | | | | 1. Add NULL pointer check for the "Guid" parameter when handle FPDT_DUAL_GUID_STRING_EVENT_TYPE. 2. Make the code logic in DxeCore/SmmCore/PeiPerformanceLib aligned when handle FPDT_DUAL_GUID_STRING_EVENT_TYPE. Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: Clean up source filesLiming Gao2018-06-28158-2028/+2028
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Use new added Perf macrosBi, Dandan2018-06-262-7/+4
| | | | | | | | | | | Replace old Perf macros with the new added ones. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Update performance library instancesBi, Dandan2018-06-267-714/+1565
| | | | | | | | | | | | | | | Update the performance library instances in MdeModulePkg to implement the APIs used for new added Perf macros. V2: Share the common logics of creating FPDT record for new added Perf macros and existing Perf macros. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Update Performance instances to use new protocolBi, Dandan2018-06-2610-1078/+283
| | | | | | | | | | | Update Performance instances in MdeModulePkg to use new PerformanceMeasurement protocol. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg BootMaintenanceManagerUiLib: Move refresh boot option laterLiming Gao2018-06-251-2/+1
| | | | | | | | | | Constructor is too early that ConnectAll() may not do. Move refresh boot option in form open. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Xu WeiX <weix.xu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: pass progress callback only if it worksArd Biesheuvel2018-06-151-3/+10
| | | | | | | | | | | | | If the first call to UpdateImageProgress() fails, there is no point in passing a pointer to it to Fmp->SetImage(), since it is highly unlikely to succeed on any subsequent calls. This permits the FMP implementation to fall back to an alternate means of providing feedback to the user, e.g., via the console. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled ModeLeo Duran2018-06-111-4/+12
| | | | | | | | | | | | Put the UART in FIFO Polled Mode by clearing IER after setting FCR. Also, add comments to show DLAB state for registers 0 and 1. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran <leo.duran@amd.com> Cc: Star Zeng <star.zeng@intel.com> CC: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: Add progress bar supportKinney, Michael D2018-06-085-36/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 * Change Update_Image_Progress() to UpdateImageProcess() * Call DisplayUpdateProgressLib from UpdateImageProgress(). * Split out a boot service and runtime version of UpdateImageProgress() so the DisplayUpdateProgressLib is not used at runtime. * If gEdkiiFirmwareManagementProgressProtocolGuid is present, then use its progress bar color and watchdog timer value. * If gEdkiiFirmwareManagementProgressProtocolGuid is not present, then use default progress bar color and 5 min watchdog timer. * Remove Print() calls during capsule processing. Instead, the DisplayUpdateProgressLib is used to inform the user of progress during a capsule update. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DisplayUpdateProgressLib: Fix ECC issuesDandan Bi2018-06-072-4/+4
| | | | | | | | | | Make the comment align with Edk2 coding style. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLibRuiyu Ni2018-06-052-8/+7
| | | | | | | | | | | | | | | | | | | | | | | Current DxeResetSystemLib depends on UefiRuntimeLib because it calls EfiResetSystem() API exposed by UefiRuntimeLib. Due to the commit: "MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driver" which reverts UefiRuntimeLib to only support DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib can be used by DXE drivers. The patch also disallows the DxeResetSystemLib to be linked by runtime driver, SMM drivers. Runtime driver cannot link to this library because the gRT is not converted when entering to RT. SMM driver cannot link to this library because calling RT services from SMM after EndOfDxe violates security guideline. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/DxeCorePerformanceLib: use AllocatePeiAccessiblePagesArd Biesheuvel2018-05-291-41/+7
| | | | | | | | | | | | Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to AllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Add DisplayUpdateProgressLib instancesMichael D Kinney2018-05-286-0/+798
| | | | | | | | | | | | | | | | | | 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 DisplayUpdateProgressLib instances for text consoles and graphical consoles. 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/UefiBootManagerLib: fix AddLoadOptionVariable docs/prototypeRuiyu Ni2018-04-231-4/+8
| | | | | | | | | | | | | | | | | | | | | Clean up the leading comment and the prototype of EfiBootManagerAddLoadOptionVariable(): - the function may modify Option on output, annotate the parameter with OUT and update the documentation; - "@retval EFI_STATUS" and "@retval Others" are not idiomatic documentation, use @return instead; - sync comment and prototype between lib instance and lib class header. Change-Id: I8a609d6502b6f8929b2f568acaa147065003b6f4 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.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is usedStar Zeng2018-04-201-1/+1
| | | | | | | | | | | | | | | | DEBUG(( DEBUG_ERROR, "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n", Index, ItemOffsetList[Index], Index, // Should be Index - 1 ItemOffsetList[Index - 1] )); Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg: Fix coding style issues in file/function commentsDandan Bi2018-03-192-0/+2
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: Add more check for the UX capsuleRuiyu Ni2018-03-161-2/+19
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg BrotliLib: Rename function with the specific lib nameLiming Gao2018-03-164-13/+13
| | | | | | | | | This change is to avoid the function conflict. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg LockBoxLib: Support LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLYStar Zeng2018-03-083-5/+236
| | | | | | | | | | | | With this flag, the LockBox can be restored in S3 resume only. The LockBox can not be restored after SmmReadyToLock in normal boot and after EndOfS3Resume in S3 resume. It can not be set together with LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/UefiBootManagerLib: limit recursive call depthHeyi Guo2018-03-073-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | Function BmRepairAllControllers may recursively call itself if some driver health protocol returns EfiDriverHealthStatusReconnectRequired. However, driver health protocol of some buggy third party driver may always return such status even after one and another reconnect. The endless iteration will cause stack overflow and then system exception, and it may be not easy to find that the exception is actually caused by stack overflow. So we limit the number of reconnect retry to 10 to improve code robustness, and DEBUG_CODE is moved ahead before recursive repair to track the repair result. We also remove a duplicated declaration of BmRepairAllControllers() in InternalBm.h in this patch, for it is only a trivial change. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERTDandan Bi2018-03-021-3/+2
| | | | | | | | | | | | | | Currently DxeCorePerformanceLib will get SMM performance data based on SMM communication handler. If SMM communication handler returns error, the library will ASSERT. In fact, if SMM perf data is not found. DXE perf data can still be dumped. So using status check instead of ASSERT is better. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/DebugLibReportStatusCode: Fix hang if format is too longRuiyu Ni2018-03-021-0/+5
| | | | | | | | | | | | | The previous commit 137ed15511e2045a7333e33ae7f1e873ce1961dd * MdeModulePkg/DebugLib: Print partial when format string is too long copies partial format string to DEBUG_INFO buffer but when parsing the format modifier, the original format string is still used. The patch fixes this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/BootLogoLib: Use Boot Logo 2 ProtocolKinney, Michael D2018-02-282-2/+32
| | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=799 Based on content from the following branch/commit: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d Add check to see if the Boot Logo 2 Protocol is available and attempt to set the location and size of the boot logo using both the Boot Logo Protocol and the Boot Logo 2 Protocol. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
* MdeModulePkg/ResetUtilityLib: Fix GCC build failureRuiyu Ni2018-02-141-2/+2
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/BmpSupportLib: Refine type cast for pointer subtractionHao Wu2018-02-141-1/+1
| | | | | | | | | | | | | | | | | | Since the pointer subtraction here is not performed by pointers to elements of the same array object. This might lead to potential issues, such behavior is undefined according to C11 standard. Refine the pointer subtraction expressions by casting each pointer to UINTN first and then perform the subtraction. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/UefiBootManagerLib: remove superfluous TimerLib dependencyLaszlo Ersek2018-02-132-2/+0
| | | | | | | | | | | | | | | | | | In commit 3a039a567a5f ("MdeModulePkg/UefiBootManagerLib: Remove the useless perf codes", 2018-02-12), the BmWriteBootToOsPerformanceData() function was removed. No TimerLib API calls are left, thus remove the TimerLib class dependency from "InternalBm.h" and "UefiBootManagerLib.inf" as well. Cc: Eric Dong <eric.dong@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* MdeModulePkg/UefiBootManagerLib: Remove the useless perf codesDandan Bi2018-02-124-339/+26
| | | | | | | | | | | | | | | | | | | V2: Just update the commit message to reference the hash value of new performance infrastructure. Our new performance infrastructure (edk2 trunk commit hash value: SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~ SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to dump performance date form ACPI table in OS. So we can remove the old perf code to write performance data to OS. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: Verify nested capsule with FMPKinney, Michael D2018-02-112-12/+14
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=873 Update IsNestedFmpCapsule() to verify the CapsuleGuid in the CapsuleHeader against the installed Firmware Management Protocol instances. The current logic that uses the ESRT Table does not work because capsules are processed before the ESRT Table is published at the Ready To Boot event. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
* MdeModulePkg/DxeCapsuleLibFmp: Use BmpSupportLibMichael D Kinney2018-02-113-264/+10
| | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=800 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61 https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b Use BmpSupportLib to convert a BMP graphics image to a GOP BLT buffer. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
* MdeModulePkg: Add BmpSupportLib class and instanceKinney, Michael D2018-02-113-0/+652
| | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=800 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61 https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b Add BmpSupportLib class and instances that provides services to convert a BMP graphics image to a GOP BLT buffer and to convert a GOP BLT buffer to a BMP graphics image. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
* MdeModulePkg/PerfLib: Add NULL pointer check for "Token"Dandan Bi2018-02-113-3/+15
| | | | | | | | | | | | "Token" is passed through the perf entry, it's may be NULL. So we need to add NULL pointer check before reference it. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Add ResetUtility library class and BASE instanceMichael D Kinney2018-02-092-0/+260
| | | | | | | | | | | | | The library class that provides services to generate a GUID specific reset, parse the GUID from a GUID specific reset, and build the ResetData buffer for any type of reset that requires extra data. Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg: Add ResetSystemLib instances that call core servicesMichael D Kinney2018-02-096-0/+316
| | | | | | | | | | | | | | | | | | | | | | Add a PEI instance of ResetSystemLib that calls the ResetSystem2() service in the PEI Services Table. Add a DXE instance of ResetSystemLib that calls the ResetSystem() service in the UEFI Runtime Services Table. These 2 library instances should be the default ResetSystemLib mapping for most PEIMs and DXE drivers so all reset system requests go through the core service. Only the implementation of the core servies should use the platform specific instance of the ResetSystemLib that actually performs the hardware actions to reset the platform. Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/SmmCorePerformanceLib:Track FPDT record in SMM phaseDandan Bi2018-02-083-440/+649
| | | | | | | | | | | | | | | | | | | | | V3: a. Handle the case when string is empty in String Record. b. Use gEdkiiFpdtExtendedFirmwarePerformanceGuid to report status code. c. Refine the code logic. V2: Update SmmCorePerformanceLib to report the buffer address of boot performance records instead of records contents. Updated to convert Pref entry to FPDT record in SMM phase and then export records to FPDT table. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/DxeCorePerformanceLib:Track FPDT record in DXE phaseDandan Bi2018-02-083-318/+1086
| | | | | | | | | | | | | | | | | | | | | | | | | | V4: a.Update the GUID for status code in DxeCorePerformanceLib and FirmwarePerformanceDxe. b. Add check for Insert FPDT record in DxeCorePerformanceLib to avoid re-entry case. V3: a. Handle the case when string is empty in String Record. b. refine the code logic. V2: Update DxecorePerformanceLib to report the boot performance table address instead of records contents. Updated to convert Pref entry to FPDT record in DXE phase and then allocate boot performance table to save the record and report the address of boot performance table to FirmwarePerformanceDxe. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PeiPerformance:Updated to track FPDT record in PEI phaseDandan Bi2018-02-082-199/+382
| | | | | | | | | | | | | V3:Handle the case when string is empty in String Record. Updated to convert Pref entry to FPDT record in PEI phase and then report the records to DxeCorePerfLib through GUID hob. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>