summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/Dhcp4Dxe: Free NET_BUF data after sent out to avoid memory leakWang Fan2018-01-112-27/+19
| | | | | | | | | | | | | | | | | | | * When build a DHCP message in function DhcpSendMessage() or DhcpRetransmit(), a new NET_BUF is created by the library of NetbufFromExt, but it's not freed after it is sent out. This patch is to fix this memory leak issue. V2: * Since packet has already been referred by DhcpSb->LastPacket, and will be freed when sending another packet or clean up, there is no need to add an extra free function in NetbufFromExt. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex"Bi, Dandan2018-01-101-3/+3
| | | | | | | | | | | | In some case the ArrayIndex with UINT16 may be not large enough to hold the multiplication result of HiiQuestion->VarOffset * 8; So this patch update the data type to fix this potential issue. Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@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/PciBus: Change switch-case to if-else to fix EBC buildRuiyu Ni2018-01-101-13/+7
| | | | | | | | | | | EBC compiler doesn't treat EFI_xxx as constant due to these macros are UINT64 type in 64bit env and UINT32 type in 32bit env. So it reports error when "case EFI_xxx" is used. The patch changes to use if-else to fix EBC build failure. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/MdeModulePkg.uni: clarify Heap Guard usageJian J Wang2018-01-101-2/+10
| | | | | | | | Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/MdeModulePkg.dec: clarify Heap Guard usageJian J Wang2018-01-101-0/+12
| | | | | | | | Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.Jiaxin Wu2018-01-101-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | v2: * Refine the commit log. There are two place to close the ISCSI ExitBootServiceEvent: #1.IScsiOnExitBootService(), which is the callback function of ExitBootServiceEvent. #2.IScsiCleanDriverData(), which will be invoked by ISCSI driver binding stop(). So, the ExitBootServiceEvent will be closed and freed when exit boot server is triggered. But it may be closed and freed again in ISCSI driver binding stop(), which will result in the issue recorded at https://bugzilla.tianocore.org/show_bug.cgi?id=742. This patch is to resolve the issue. 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>
* MdeModulePkg: Freed packet buffer when error occurs to avoid memory leak.Wang Fan2018-01-101-1/+5
| | | | | | | | | | | | | | * In function Mtftp4WrqSendBlock(), when packet is not needed, function returns EFI_ABORTED but not freed the packet buffer. It results some memory leak and this patch is to fix this issue. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg: Fixed two issues when error occurs in Mtftp4Start.Wang Fan2018-01-101-8/+12
| | | | | | | | | | | | | | | | * This function sets returned status as token status and signal token when error occurs, and it results token status not compliance with spec definition. This patch fixed this issue. * This function restore Tpl twice when Mtftp4WrqStart() returns an error, this patch fixed this issue. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg/DxeUdpIoLib: Did some code enhancement for UdpIoLibWang Fan2018-01-092-30/+80
| | | | | | | | | | | | | * Added some ASSERT descriptions for library APIs. * Added "Optional" option for Context parameter in UdpIoCancelDgrams(). * Added function return status check for UdpIoFreeIo(). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/PciBus: Reserve Bus number for non-root and root HPBsRuiyu Ni2018-01-081-2/+2
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=656 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/PciBusDxe: cope with HPCs that request no bus nr paddingRuiyu Ni2018-01-081-5/+14
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/DxeNetLib: Fix an error in packet length counting.Wang Fan2018-01-041-2/+1
| | | | | | | | | | | | | * In old implementation, the operation len-- assumes AsciiSPrint() has counted NULL terminator, and it's not correct. This patch is to fix this issue. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg/DxeNetLib: Add parameter check and ASSERT handling.Wang Fan2018-01-041-14/+105
| | | | | | | | | | | | | | | | * Library API should check the input parameters before use, or ASSERT to tell it has to meet some requirements. But in DxeNetLib, not all functions follows this rule. * ASSERT shouldn't be used as error handling, add some handling code for errors. * Add some ASSERT commence in function notes. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg/DxeNetLib: Fix a potential issue in macro definition.Wang Fan2018-01-041-1/+1
| | | | | | | | | | | | | | The NIC_ITEM_CONFIG_SIZE macro in DxeNetLib is defined as: sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE. This macro should be surrounded with parenthesis to avoid being incorrectly used. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg: Add error handling when IP address is Class EWang Fan2018-01-031-3/+12
| | | | | | | | | | | | | | | | | The Dhcp4.TransmitReceive() API should be able to use at any time according to UEFI spec. While in classless addressing network, the netmask must be explicitly provided together with the station address. But if the DHCP instance haven't be configured with a valid netmask, we need compute it according to the classful addressing rule. In such case, if the user configures with class E IP address, ASSERT will happen, we need to handle this case and return error status code. Cc: Jiaxin Wu <jiaxin.wu@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: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg/DxePrintLibPrint2Protocol: Fix incomplete print outputWang, Jian J2018-01-021-2/+6
| | | | | | | | | | | | | | | This is caused by a previous patch which tried to fix string over-read. It's found that that patch for PrintLib in MdePkg will cause premature terminating of loop used to traversing format string and cause incomplete string output. Because this library uses similar code to do the same job, it has the same issue too. So the fix is also the same. Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg VarCheckPcd: Make sure the bin at required alignmentStar Zeng2018-01-021-1/+5
| | | | | | | | | | | | | | | | According to UEFI/PI spec, the AllocateXXXPool() interfaces should return eight-byte aligned buffer that satisfies the required HEADER_ALIGNMENT which is 4. This patch adds ASSERT to make sure the bin at required alignment, that can help catch the issue earlier about incorrect aligned buffer returned from AllocateXXXPool(). Cc: Jian J Wang <jian.j.wang@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: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg VarCheckHii: Make sure the bin at required alignmentStar Zeng2018-01-021-0/+4
| | | | | | | | | | | | | | | | According to UEFI/PI spec, the AllocateXXXPool() interfaces should return eight-byte aligned buffer that satisfies the required HEADER_ALIGNMENT which is 4. This patch adds ASSERT to make sure the bin at required alignment, that can help catch the issue earlier about incorrect aligned buffer returned from AllocateXXXPool(). Cc: Jian J Wang <jian.j.wang@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: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/DxePrintLibPrint2Protocol: fix GCC5 build breakWang, Jian J2017-12-291-1/+1
| | | | | | | | | | Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: Update debug message to print FV handle correctlyLiming Gao2017-12-281-1/+1
| | | | | | | | | BfvHeader->FvLength is UINT64. Now, it prints with %x. It will cause the late FvHandle to be as zero. So, its type is converted to UINT32. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg HiiDataBase: Fix the potential NULL pointer accessLiming Gao2017-12-281-3/+8
| | | | | | 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/DxePrintLibPrint2Protocol: Fix error in Precision position ↵Jian J Wang2017-12-281-2/+5
| | | | | | | | | | | | | | | | | calculation Due to a potential hole in the stop condition of loop, the two continuous access to ArgumentString (index, index+1) inside the loop might cause the string ending character ('\0') and the byte after it to be read. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg HiiDataBase: Fix the potential NULL pointer referenceLiming Gao2017-12-271-4/+6
| | | | | | | | | | This change is the additional fix of commit 14b351e2ed8586f144dd3cd2e0a25082c1a32837. 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 Variable: Use boolean type value instead of expressionLiming Gao2017-12-271-1/+1
| | | | | | 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/DxeHttpLib: Refine some coding style.Jiaxin Wu2017-12-272-62/+60
| | | | | | | | | Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@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>
* MdeModulePkg/DxeHttpLib: Correct some return Status.Jiaxin Wu2017-12-272-7/+9
| | | | | | | | | Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@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>
* MdeModulePkg/DxeHttpLib: Check the input parameters for some APIs.Jiaxin Wu2017-12-272-5/+21
| | | | | | | | | Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@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
* MdeModulePkg/DxeHttpLib: Avoid the potential memory leak when error happen.Jiaxin Wu2017-12-271-0/+5
| | | | | | | | | Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@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>
* MdeModulePkg/DxeHttpLib: Add boundary condition check.Jiaxin Wu2017-12-271-4/+34
| | | | | | | | | | | | | | | | | v2: * Fix GCC the build error. This patch is to add the boundary condition check to make sure the accessed buffer is valid. Cc: Gary Lin <glin@suse.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@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> Tested-by: Gary Lin <glin@suse.com>
* MdeModulePkg/Core: Fix heap guard issuesJian J Wang2017-12-263-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Three issues addressed here: a. Make NX memory protection and heap guard to be compatible The solution is to check PcdDxeNxMemoryProtectionPolicy in Heap Guard to see if the free memory should be set to NX, and set the Guard page to NX before it's freed back to memory pool. This can solve the issue which NX setting would be overwritten by Heap Guard feature in certain configuration. b. Returned pool address was not 8-byte aligned sometimes This happened only when BIT7 is not set in PcdHeapGuardPropertyMask. Since 8-byte alignment is UEFI spec required, letting allocated pool adjacent to tail guard page cannot be guaranteed. c. NULL address handling due to allocation failure When allocation failure, normally a NULL will be returned. But Heap Guard code will still try to adjust the starting address of it, which will cause a non-NULL pointer returned. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg HiiDataBaseDxe: Add the check for the memory allocation returnLiming Gao2017-12-261-0/+9
| | | | | | | 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 Variable: Update Pointer Minus with UINTN typeLiming Gao2017-12-261-1/+1
| | | | | | | | | | In V2, reduce unnecessary () in the expression. 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> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* MdeModulePkg/Core: Coding style clean-upJian J Wang2017-12-261-0/+5
| | | | | | | | | Cc: Dandan Bi <dandan.bi@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: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeoutWang Fan2017-12-261-3/+2
| | | | | | | Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg HiiDataBaseDxe: Initialize the local variable before referenceLiming Gao2017-12-251-0/+3
| | | | | | | | Make VS2012x86 and GCC48 pass build Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Update PCD driver to support the optimized PcdDataBaseLiming Gao2017-12-258-460/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=546 BaseTools will generate the optimized PCD database to save the image size at build time for multiple SKUs. The optimized PCD database layout will be like below, the PCD database will be composed of the full default SKU data (PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA). PCD driver will build HOB to store the full default SKU data, and patch HOB data based on non-default SKU delta data for the SKU set by SetSku(), it can save memory resource at boot time. // // PCD database layout: // +---------------------------------+ // | PCD_DATABASE_INIT (DEFAULT SKU) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU A) | // +---------------------------------+ // | PCD_DATABASE_SKU_DELTA (SKU B) | // +---------------------------------+ // | ...... | // +---------------------------------+ // BaseTools, PCD database and driver updates are needed for this proposal. For single SKU (default) case, this proposal is expected to have no impact. For multi-SKU case, PCD database format will be changed. So, PcdDataBase Version is also updated from 6 to 7. 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 PCD: Enable Firmware to retrieve the default settingLiming Gao2017-12-253-1/+111
| | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=611 Update PCD driver to retrieve the default setting and set the initial EFI variable when PcdSetNvStoreDefaultId is set. 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 HiiDataBase: Enable Firmware to retrieve the default settingLiming Gao2017-12-253-2/+523
| | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=611 Update HiiDataBase to retrieve the default setting and patch IFR data Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Enable Firmware to retrieve the default settingLiming Gao2017-12-253-0/+89
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=611 Add two PCDs and new PCD DB format definition 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 VariableDxe: Update it supports normal format variable storageLiming Gao2017-12-251-1/+112
| | | | | | | | | | PEI may report the normal format variable storage HOB for the default EFI variable. VariableDxe needs to support it and set them into NV variable region. 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/DpcLib: return error if failed to locate DPC protocol.Fu Siyuan2017-12-221-1/+1
| | | | | | | | | This patch updates the constructor of DpcLib to return error if failed to locate DPC protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg: Clarify usage of PcdHeapGuardPropertyMaskJian J Wang2017-12-222-4/+12
| | | | | | | | Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Ip4Dxe: Clean up IP4 interface if failed to open ARP protocol.Fu Siyuan2017-12-221-0/+1
| | | | | | | | | | This patch fixes a bug in Ip4ConfigProtocol, that new created IP interface is not freed if Open ARP protocol failed. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/Ip4Dxe: Remove redundant code in Ip4Config2InitInstance().Fu Siyuan2017-12-221-12/+0
| | | | | | | | | | Instance->Dhcp4Event is not necessary to be created in Ip4Config2InitInstance. Because it will created in Ip4StartAutoConfig() later. Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/IpIoLib: Check the input parameters before use them.Fu Siyuan2017-12-222-25/+68
| | | | | | | | This patch updates the DxeIpIoLib to check the input parameters before using. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdeModulePkg/IpIoDxe: Update API description to match the function ↵Fu Siyuan2017-12-222-8/+30
| | | | | | | | | | | implementation. This patch updates some API descriptions in DxeIpIoLib to match the real implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg/IpIoLib: add more error handling code to DxeIpIoLib.Fu Siyuan2017-12-222-37/+58
| | | | | | | | | In DxeIpIo, there are several places not check the returned value of called functions. This patch is to add the error handling to these functions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg/Core: Fix incorrect memory map generated in a rare caseJian J Wang2017-12-192-4/+4
| | | | | | | | | | | | | | The root cause is that mImagePropertiesPrivateData.CodeSegmentCountMax was not updated with correct value due to the fact that SortImageRecord() called before might change the content of current ImageRecord. This will in turn cause incorrect memory map entries generated in SplitTable(). Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.fanwang22017-12-187-16/+21
| | | | | | | | | | | | | | | | Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting state handling, and it is forward compatible. So apply this Api in MdeModulePkg. V2: *Define time period in a macro instead of hard code. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Signed-off-by: fanwang2 <fan.wang@intel.com>
* MdeModulePkg/IpIoLib: return error instead of ASSERT if input parameter is ↵Fu Siyuan2017-12-182-13/+23
| | | | | | | | | | | incorrect. This patch updates the DxeIpIoLib to return EFI_INVALID_PARAMETER instead of ASSERT if the input pointers are not correct. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>