summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot eventStar Zeng2018-08-081-136/+103
| | | | | | | | | | | | | | | | | | Current code just creates ESRT entry in FMP notification and installs ESRT configuration table in ReadyToBoot event. The LastAttemptVersion and LastAttemptStatus in ESRT will be out of date after system continues to boot without reset after capsule update (reset is not required or capsule update is failed). This patches updates the code to create ESRT based on all FMP instances in ReadyToBoot event. 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: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg: Remove DxeSmmPerformanceLibDandan Bi2018-08-064-959/+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/BdsDxe: Move display of test key usage into BDS moduleKinney, Michael D2018-08-022-0/+13
| | | | | | | | | Cc: Ruiyu Ni <ruiyu.ni@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>
* 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 CapsuleApp: Check capsule header for -D and -N optionsStar Zeng2018-07-272-34/+90
| | | | | | | | | | | | Then meaningful error message can be shown when the input image is unexpected. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Prompt info for -C optionStar Zeng2018-07-272-5/+14
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Index need be decimal for -P GET optionStar Zeng2018-07-271-5/+8
| | | | | | | | | | | | Also adjust the help information to be not too long to be suitable for different display resolutions. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Refine -N option help informationStar Zeng2018-07-271-1/+2
| | | | | | | | | | | | -N option is used to append a Capsule Header to an existing FMP capsule image with its ImageTypeId supported by the system. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Fix -D failed to dump Nest FMP capsuleStar Zeng2018-07-271-1/+1
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Fix VS2012 build failure caused by 5410502Star Zeng2018-07-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | The build failure is like below. xxx\CapsuleApp.c(868) : error C2275: 'EFI_GUID' : illegal use of this type as an expression xxx/UefiBaseType.h(29) : see declaration of 'EFI_GUID' xxx\CapsuleApp.c(868) : error C2146: syntax error : missing ';' before identifier 'ImageTypeId' xxx\CapsuleApp.c(868) : error C2065: 'ImageTypeId' : undeclared identifier xxx\CapsuleApp.c(869) : error C2275: 'UINTN' : illegal use of this type as an expression xxx\ProcessorBind.h(224) : see declaration of 'UINTN' xxx\CapsuleApp.c(869) : error C2146: syntax error : missing ';' before identifier 'ImageIndex' xxx\CapsuleApp.c(869) : error C2065: 'ImageIndex' : undeclared identifier Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Dandan Bi <dandan.bi@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> Reviewed-by: Dandan Bi <dandan.bi@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/BdsDxe: Call PlatformBootManagerUnableToBoot()Ruiyu Ni2018-07-271-0/+1
| | | | | | | | | | | | When no boot option can be launched, BDS core calls PlatformBootManagerUnableToBoot() to let platform BdsDxe handle it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
* MdeModulePkg/BdsDxe: Revert "fall back to UI loop before hanging"Ruiyu Ni2018-07-271-56/+4
| | | | | | | | | | | | | | | Commit d1de487dd2e77f4741abcbd71d19a8c93971fda0 "MdeModulePkg/BdsDxe: fall back to a Boot Manager Menu loop before hanging" changed BDS core to fall back to UI loop when no bootable option can be launched. Now since PlatformBootManagerUnableToBoot() is added, the commit can be reverted. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/PlatformBootManager: Add PlatformBootManagerUnableToBootRuiyu Ni2018-07-272-1/+31
| | | | | | | | | | | | | | 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/PciBusDxe: Fix small memory leak in FreePciDeviceThomas Palmer2018-07-271-0/+5
| | | | | | | | | When cleaning the PciIoDevice, also free the BusNumberRange Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg FvSimpleFileSystemDxe: Fix memory leak in Read functionVladimir Olovyannikov2018-07-271-0/+3
| | | | | | | | | | FvSimpleFileSystem on read always allocates a FileBuffer, and never frees it. This causes memory leaks. It is especially bad for reading scripts line-by-line. In some cases memory leak can exceed 1GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vladimir Olovyannikiov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCore: Not update RtCode in MemAttrTable after EndOfDxeJiewen Yao2018-07-261-0/+13
| | | | | | | | | | | | | | | | We want to provide precise info in MemAttribTable to both OS and SMM, and SMM only gets the info at EndOfDxe. So we do not update RtCode entry in EndOfDxe. The impact is that if 3rd part OPROM is runtime, it cannot be executed at UEFI runtime phase. Currently, we do not see compatibility issue, because the only runtime OPROM we found before in UNDI, and UEFI OS will not use UNDI interface in OS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCore: Install UEFI mem attrib table at EndOfDxe.Jiewen Yao2018-07-261-1/+35
| | | | | | | | | So that the SMM can consume it to set page protection for the UEFI runtime page with EFI_MEMORY_RO attribute. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeLoadFunc: Add use case for new Perf macroDandan Bi2018-07-263-1/+7
| | | | | | | | | | | Add an example case for the usage of PERF_EVENT_SIGNAL_BEGIN/PERF_EVENT_SIGNAL_END 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 CapsuleApp: Use EFI_UNSUPPORTED for incorrect Argc caseStar Zeng2018-07-231-7/+8
| | | | | | | | | | | Align code to use EFI_UNSUPPORTED for all incorrect Argc cases. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Check capsule header before using its FlagsStar Zeng2018-07-231-0/+38
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Show clear message when option is unrecognizedStar Zeng2018-07-231-0/+7
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Do not parse bits in CapsuleFlags of ESRTStar Zeng2018-07-231-3/+0
| | | | | | | | | | | | | | | | | | | | According to UEFI spec, only bits 0-15 of CapsuleFlags are meaningful and CapsuleGuid specific, CAPSULE_FLAGS_PERSIST_ACROSS_RESET CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE/CAPSULE_FLAGS_INITIATE_RESET defined in UEFI spec are in bits 16-31, they should not be parsed in CapsuleFlags of ESRT. CapsuleFlags The capsule flags field contains the CapsuleGuid flags (bits 0-15) as defined in the EFI_CAPSULE_HEADER that will be set in the capsule header. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Fix memory leak in DumpFmpImage()Star Zeng2018-07-231-0/+2
| | | | | | | | | | | Image buffer should be freed after using. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Check Arg count for -P GET optionStar Zeng2018-07-231-4/+15
| | | | | | | | | | | Also add help info for CapsuleApp -P GET option. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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: Variable: Re-prioritize TCG/TCG2 protocolZhang, Chao B2018-07-231-5/+5
| | | | | | | | | | | TPM1.2 is obsoleted by TPM2.0. switch TCG/TCG2 protocol check to apply this trend Cc: Long, Qin <qin.long@intel.com> Cc: Yao, Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
* MdeModulePkg/PerformanceMeasurement.h: Correct the licenseDandan Bi2018-07-131-22/+9
| | | | | | | | | | | Corrected to use the BSD license. 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> Reviewed-by: Dmitry Antipov <dmanti@microsoft.com>
* MdeModulePkg CapsuleApp: Fix typo EFI_CAPSULE_RPORT_GUIDStar Zeng2018-07-131-1/+1
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Refine -D option help informationStar Zeng2018-07-131-3/+3
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Check Arg count for -D optionStar Zeng2018-07-131-0/+4
| | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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 CapsuleApp: Fix NestedCapsuleHeader->Flags assigned wrongStar Zeng2018-07-111-1/+1
| | | | | | | | | | | | | (FwType == ESRT_FW_TYPE_DEVICEFIRMWARE) ? system : device should be (FwType == ESRT_FW_TYPE_SYSTEMFIRMWARE) ? system : device 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 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/DisplayEngineDxe: Fix small InitializeDisplayEngine leakThomas Palmer2018-07-061-0/+2
| | | | | | | | | | After calling RegisterHotKey, the allocated memory in NewString should be freed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@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/S3SmmInitDone.h: Fix copyright coding style error.Eric Dong2018-07-051-1/+1
| | | | | | | | | It is caused by change d1102dba7210b95e41d06c2338a22ba6af248645. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Variable: Check EFI_MEMORY_RUNTIME attribute before setting itBrijesh Singh2018-07-041-7/+9
| | | | | | | | | | | | | | Set the EFI_MEMORY_RUNTIME attribute in FtwNotificationEvent() only if the attribute is not already present. This will ensure that the attributes set by the platform drivers (e.g Ovmf pflash) is not lost. Cc: Dong Eric <eric.dong@intel.com> Cc: Justen Jordan L <jordan.l.justen@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Reviewed-by: Star Zeng <star.zeng@intel.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.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 SataControllerDxe: Use compare logic in if conditionStar Zeng2018-07-031-1/+1
| | | | | | | | | | | | Use compare logic in if condition to fix ECC issue. It is caused by aa4240edff41034d709938a15b42cf4fd3214386. Cc: Hao Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg Variable: Add/Correct GetHobVariableStore para descriptionStar Zeng2018-07-032-1/+4
| | | | | | | | | | | It is caused by 09808bd39b0c76559354253639766458ec24da79. Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/ResetSystemRuntimeDxe: Add more info in debug messageRuiyu Ni2018-07-031-1/+4
| | | | | | 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/[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 SataControllerDxe: Calculate ChannelCount based on PI valueStar Zeng2018-07-022-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | Current code calculates ChannelCount based on CAP(NP) value. It only works when the ports implemented number are <= CAP(NP), for example, platform has CAP(NP) = 5 (means 6 ports) and ports implemented are 0, 1, 2, 3, 4 and 5. But we have some platform that has CAP(NP) = 1 (means 2 ports) and ports implemented are 1 and 2, and has no port 0 implemented, then current code does not work. This patch updates the code to calculate ChannelCount based on PI value. Cc: Amy Chan <amy.chan@intel.com> Cc: Hong-chihX Hsueh <hong-chihx.hsueh@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao 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 Wu <hao.a.wu@intel.com> Tested-by: Hong-chihX Hsueh <hong-chihx.hsueh@intel.com>
* MdeModulePkg PeiCore: Not assume PpiDescriptor and Ppi in same rangeStar Zeng2018-07-021-89/+115
| | | | | | | | | | | | | | | Current code assumes PpiDescriptor and Ppi are in same range (heap/stack/hole). This patch removes the assumption. Descriptor needs to be converted first. It is also handled by this patch. Cc: Liming Gao <liming.gao@intel.com> Cc: Qing Huang <qing.huang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg Variable: Make sure no more than one Variable HOBStar Zeng2018-07-022-0/+48
| | | | | | | | | | | | | VariableHob may be built in PcdPeim (by PcdNvStoreDefaultValueBuffer) or some platform module (by some tool). The two solutions should not be co-exist. Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>