Commit Graph

765 Commits

Author SHA1 Message Date
Nagaraj Hegde e297a0a498 MdeModulePkg:DxeHttpLib: Update to DxeHttpLib API
Rename and update the logic of HttpGenRequestString API provided
by DxeHttpLib. The RequestString size is returned as an argument.
The user is not expected to do a AsciiStrLen anymore, and is not
logical too, since request string can contain message body and
using AsciiStrLen on such a string can provide truncated lengths.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-04-27 10:43:08 +08:00
Liming Gao f447df5d39 MdeModulePkg: Correct PlatformHookLibSerialPortPpi module type.
This library instance is PEIM type, not BASE type. It has the PPI
dependency for PEIM.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-04-25 13:17:05 +08:00
Liming Gao 8d878f84d2 MdeModulePkg: Update Guid/Protocol usages in INF files.
V2: Update VariableSmm inf to align the change in VariableRuntimeDxe.inf.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-13 14:52:59 +08:00
Liming Gao 7a9395cd7b MdeModulePkg: Update PerformanceLib instances not to check Identifier.
In PerformanceLib, Identifier is for single PERF, not the pair of PERF.
When find the matched START and END pair, the identifier will not be checked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-11 16:20:28 +08:00
Zhang Lubo 364f4efa44 MdeModulePkg: Add new macros and refine codes
Add 2 macros inNetLib.h
#define  IP4_MASK_MAX          32
#define  IP6_PREFIX_MAX        128
we will use these two macros to check the max mask/prefix length,
instead of
#define  IP4_MASK_NUM          33
#define  IP6_PREFIX_NUM        129
which means a valid number.
This will make the code readability and maintainability.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
2016-04-11 08:25:33 +08:00
Thomas Palmer 3dc5c1ae5c MdeModulePkg/UefiBootManagerLib: API BmIsValidLoadOptionVariableName
Redfine the BmIsValidLoadOptionVariableName function to allow public use. Change name to EfiBootManagerIsValidLoadOptionVariableName to match naming scheme. Check that VariableName is never NULL and allow OptionType and OptionNumber to be optional.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-04-08 12:28:02 +08:00
Ruiyu Ni 542417972d MdeModulePkg/Bds: Fix build failures of VS tool chain
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-04-07 11:23:07 +08:00
Ruiyu Ni b1bb6f5961 MdeModulePkg/Bds: Fix a boot hang due to Ram Disk boot support
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-04-06 14:49:25 +08:00
Ni, Ruiyu 024bdafc68 MdeModulePkg/Bds: Memory Bins don't count the memory used by RAM Disk
MemoryTypeInformation don't count the reserved memory used by RAM Disk,
but it still check all types of memory and do reset when any type
of memory size changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-04-06 13:27:09 +08:00
Ni, Ruiyu 339ae051f6 MdeModulePkg/Bds: Free resources after ram disk boot finishes
The resource free includes to un-register the ram disk device and
free the memory occupied by the ram disk.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-04-06 13:27:09 +08:00
Ni, Ruiyu 026ede493c MdeModulePkg/Bds: Allocate reserved memory for RAM Disk boot media
Use reserved memory to hold the buffer for the RAM disk to
follow the ACPI spec requirement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-04-06 13:27:09 +08:00
Laszlo Ersek 166a6552a8 MdeModulePkg: DxeUdpIoLib: fix non-empty payload path in UDP reception
Commit 1b31acb66c ("MdeModulePkg: Check received packet size before use
it.") introduced a chunk of code under the new "Resume" label, in function
UdpIoOnDgramRcvdDpc(). The new code is supposed to run only when the
received packet has zero-length payload, but a "return" statement was
forgotten, and the code is reached on the normal (nonzero-length payload)
path as well, after the packet has been processed (and possibly freed) by
RxToken->CallBack(). This is a logic bug, with the direct symptom being
use-after-free / General Protection Fault.

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Cc: "Subramanian, Sriram (EG Servers Platform SW)" <sriram-s@hpe.com>
Fixes: 1b31acb66c
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
2016-04-04 13:53:12 +02:00
Fu Siyuan 1b31acb66c MdeModulePkg: Check received packet size before use it.
Arbitrary length of packet may be received from network, including the
packets with zero payload data or malformed protocol header. So the code
much check the actually received data size before using it. For example, in
current edk2 network stack, an zero payload UDP packet may cause the
platform ASSERT in NetbufFromExt() because of the zero fragment number.
This patch update the IpIoLib and UdpIoLib to check and discard the zero
payload data packet to avoid above assert. Some other network drivers are
also updated to check the packet size to guarantee the minimum length of
protocol header is received from upper layer driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-04-01 13:30:08 +08:00
Thomas Palmer 065e587c17 MdeModulePkg/UefiBootManagerLib: BmGetActiveConsoleIn code cleanup
Check for NULL from AllocateCopyPool before setting Count to 1. Also
change sizeof (EFI_HANDLE*) to sizeof (EFI_HANDLE).  Handles is a
EFI_HANDLE pointer, so the allocated memory must be the size of
EFI_HANDLE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-03-31 09:21:05 +08:00
Laszlo Ersek 3b93b8070d MdeModulePkg: DeviceManagerUiLib: remove set but unused variables
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-25 10:52:29 +01:00
Laszlo Ersek 8192be265e MdeModulePkg: BootMaintenanceManagerUiLib: remove set but unused variables
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-25 10:52:28 +01:00
Ruiyu Ni b99e9ca916 MdeModulePkg/Bds: Fix VS2012 build failure.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-24 11:24:30 +08:00
Dandan Bi c7d1e742ec MdeModulePkg/BootMaintenanceManagerUiLib: Remove type casting in ChooseFile
The type casting is not necessary and now remove it.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@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>
Reviewed-by: Gary Lin <glin@suse.com>
2016-03-23 16:04:03 +08:00
Dandan Bi bdf0da37c9 MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for ChooseFile handler
The BootMaintenanceManagerUiLib use ChooseFile() from FileExplorerLib
to select files. And the third parameter in ChooseFile() is CHOOSE_HANDLER,
per the definition of CHOOSE_HANDLER, it must use EFIAPI as the calling
convention. But the calling convention was not specified for following
handlers: CreateBootOptionFromFile, CreateDriverOptionFromFile,
BootFromFile. Now specifies the calling convention for those functions.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@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>
Reviewed-by: Gary Lin <glin@suse.com>
2016-03-23 16:03:52 +08:00
Ruiyu Ni 2d15a83017 MdeModulePkg/Bds: BDS hotkey shouldn't work on inactive consoles
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@intel.com>
2016-03-23 13:22:30 +08:00
Star Zeng 58f025afd5 MdeModulePkg PlatformVarCleanupLib: Locate VarCheck protocol when using
Do not locate VarCheck protocol in Constructor, then the
gEdkiiVarCheckProtocolGuid could be removed from [Depex].
It will be more flexible for the library Consumer to work without VarCheck
protocol installed, for example at recovery boot mode with EmuRuntimeDxe.

The unused UefiLib is also been removed from [LibraryClasses] in *.inf.

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: Ruiyu Ni <ruiyu.ni@intel.com>
2016-03-18 15:14:34 +08:00
Jiaxin Wu 6ddc2e438b MdeModulePkg: Coding style update for DxeHttpLib.inf
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-03-16 14:01:26 +08:00
Dandan Bi c7d310dd16 MdeModulePkg: Refine the UI code
Remove the ASSERT in UI code that may be triggered,
and clean up the useless code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-16 10:41:25 +08:00
Ghazi Belaam 558b99a6a3 ModulePkg/DxeHttpLib: Adding Functions to HttpLib
There some usefull functions in edk2 private modules that could be used,
so we added them to the httpLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ghazi Belaam <Ghazi.belaam@hpe.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-10 09:51:42 +08:00
Cinnamon Shia 7c50b34343 MdeModulePkg: Increase the maximum number of PEI performance log entries
The maximum number of PEI performance log entries is 255.
Add a new PCD, PcdMaxPeiPerformanceLogEntries16, to increase the maximum
number of PEI performance log entries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Joseph Shifflett <joseph.shifflett@hpe.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-03-08 21:00:04 +08:00
Ruiyu Ni e4c7cefe3d MdeModulePkg/Bds: More user-friendly network boot option description
The patch enhances the UefiBootManagerLib to use more user-friendly
network boot option description.
It builds description like below:
 "PXEv6 (MAC:112233445566 VLAN1)"
 "HTTPv4 (MAC:112233445566)"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-03-07 13:35:43 +08:00
Ruiyu Ni 1f2e80af22 MdeModulePkg/UefiBootManagerLib: Separate boot description functions.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-03-07 13:35:43 +08:00
Ruiyu Ni eeab16c88d MdeModulePkg/Bds: Fix VS2010/VS2012 build failure.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-03-07 13:34:21 +08:00
Ruiyu Ni f5c12172f1 MdeModulePkg/Bds: Support booting from remote file system.
Enhance BDS to support booting from a remote file system exposed
by a HTTP boot option.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04 16:00:50 +08:00
Ruiyu Ni 4a285ec18d MdeModulePkg/Bds: Support short-form URI boot.
The patch adds short-form URI boot support to follow
UEFI Spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04 16:00:50 +08:00
Ruiyu Ni bf5328f088 MdeModulePkg/Bds: Wide match HTTP boot option.
Enhance BDS to wide match the HTTP boot option without matching
the specific device path data in IP device path and URI device
path node.
It's to follow UEFI Spec 2.6.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04 16:00:50 +08:00
Ruiyu Ni 525839edeb MdeModulePkg/Bds: Refine the code to load file from FV.
Change BmGetFileBufferByMemmapFv to BmGetFileBufferByFvFilePath.
The original function gets the file buffer only from memory mapped
FV device path and leaves GUIDed FV device path to the code below;
The new function gets the file buffer from both formats of FV device
paths.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04 16:00:50 +08:00
Ruiyu Ni eea222ced0 MdeModulePkg/PciHostBridgeLib: Correct the function header comments
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
2016-03-03 18:24:25 +01:00
Dandan Bi d0d34cdf1d MdeModulePkg: Add ASSERT to make sure pointers are not NULL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-02 15:18:56 +08:00
Dandan Bi 1b96026e14 MdeModulePkg: FileExplorerLib: Modify the EFI_FILE_EXPLORE_FORMSET_GUID
Currently the EFI_FILE_EXPLORE_FORMSET_GUID value in BdsDxe in
IntelFrameworkModulePkg is same with the GUID VALUE in FileExplorerLib.
This patch is to modify the EFI_FILE_EXPLORE_FORMSET_GUID in
FileExplorerLib to avoid potential issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-02 15:16:45 +08:00
Dandan Bi bbd6b0106e MdeModulePkg: FileExplorerLib: Add check when to call FreePool function
when free up resource allocated for a MenuEntry, there exists
the case that the DevicePath and DisplayString are NULL,
so before calling FreePool function, need to check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-02 12:10:15 +08:00
Fu Siyuan 6796629dbb MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h
This patch is to add a new interface to get the "Path" component according to
the URI parse result, it would be helpful for the library user to extract the
file path value in a URI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-03-01 10:41:45 +08:00
Laszlo Ersek 9b6b938538 MdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 characters
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-02-29 13:08:58 +01:00
Dandan Bi 48c18bd166 MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-02-26 16:47:07 +08:00
Dandan Bi 97033ebfa3 MdeModulePkg: Fix the build fail issue on VS2008\VS2010\GCC
This is caused by my last commit,the LoadOption may
not initialize when call FreePool, and after investigation,
find that we can delete the LoadOption variable, this patch
is to fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-02-25 11:06:19 +08:00
Dandan Bi 2ba36b2f0e MdeModulePkg: Refine the code in BootMaintenanceManagerUiLib
Refine the code in function Var_UpdateDriverOption and Var_UpdateBootOption,
use the existed API(EfiBootManagerInitializeLoadOption and
EfiBootManagerAddLoadOptionVariable) supplied by UefiBootManagerLib
to replace the same logic in the two functions. And remove the useless
code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-02-23 17:03:21 +08:00
Jiaxin Wu dba6e9a935 MdeModulePkg: Define a general function to create DNS QName
This patch is used to define a general function to create
DNS QName.
QName is a domain name represented as a sequence
of labels, where each label consists of a length octet
followed by that number of octets. The domain name terminates
with the zero length octet for the null label of the root.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.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: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-02-18 13:07:56 +08:00
Dandan Bi 3910f66918 MdeModulePkg:Modify related files because of rename action
Rename DeviceManagerLib,need to modify these files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19667 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:30:57 +00:00
Dandan Bi 0b6d3330d8 MdeModulePkg:Rename DeviceManagerLib to DeviceManagerUiLib
Avoid any confusion,add the keyword "Ui",
user can understand the use of the library clearly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19666 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:30:33 +00:00
Dandan Bi 120c88936d MdeModulePkg:Modify relative files because of rename action
Rename BootManagerLib,need to modify these files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19665 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:30:02 +00:00
Dandan Bi d513b3ddcc MdeModulePkg:Rename BootManagerLib to BootManagerUiLib
Avoid any confusion,add the keyword "Ui",
user can understand the use of the library clearly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19664 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:29:40 +00:00
Dandan Bi 13c4e86462 MdeModulePkg:Modify the inf file and c file because of the rename action
Rename BootMaintenanceManagerLib,need to modify these files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19663 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:29:10 +00:00
Dandan Bi 67013151ba MdeModulePkg:Rename BootMaintenanceManagerLib to BootMaintenanceManagerUiLib
Avoid any confusion,add the keyword "Ui",
user can understand the use of the library clearly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19662 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 03:28:46 +00:00
Ruiyu Ni 7ff66d3c4a MdeModulePkg: Add PciHostBridgeLibNull
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19656 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-18 04:49:54 +00:00
Hao Wu 4977ee965f MdeModulePkg BaseSerialPortLib: Fix VS2010 build error
When overriding compiler options '/GL' with '/GL-', VS2010 will report
warning C4701 potentially uninitialized local variable for 'LcrParity'
and 'LcrStop' in function SerialPortSetAttributes().

This commit fixes this build issue.

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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19628 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-11 00:34:15 +00:00
Ruiyu Ni 2e26862c6d MdeModulePkg: DeleteLoadOptionVariable() removes Boot####
Change EfiBootManagerDeleteLoadOptionVariable() to not just
remove #### from BootOrder but also remove Boot#### variable.

The old behavior tries to do less for performance but it leaves
unreferenced Boot#### which cannot be reclaimed in variable
reclaim operation though the Boot#### will be eventually be overwritten
by EfiBootManagerAddLoadOptionVariable().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19626 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-08 07:16:22 +00:00
Eric Dong 20fe162556 Refine error handle code, avoid assert when load this module twice.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19625 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-08 05:21:55 +00:00
Hao Wu 8a1c4a8cf9 MdeModulePkg DxeHttpLib: Fix typos in function descriptions
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>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19597 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 01:11:00 +00:00
Dandan Bi f79865264f MdeModulePkg:Change the type of BootNext
Currently the invalid boot next set to the number of boot option,
when add a new boot option,also need update the boot next value,
otherwise it will be incorrect.Now set the type of BootNext value
to UINT32,the number out of the range of UINT16 means it is an
invalid BootNext Value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19591 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 00:55:12 +00:00
Liming Gao 28bf7f2370 MdeModulePkg: Add the missing library uni files of UI instances
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19508 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 02:29:58 +00:00
Liming Gao 0666a04c2d MdeModulePkg: Add the missing Library uni files of ImageDecode instances
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19507 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 02:29:23 +00:00
Liming Gao 04378ba694 MdeModulePkg: Add the missing Library uni files of Ipmi instances
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19506 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-24 02:28:45 +00:00
Daocheng Bu 12166c2f1b MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.
Add SmmIpmiLibSmmIpmiProtocol Library Instance based on
Ipmi smm protocol in SMM mode.

In V5, change for code style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu <daocheng.bu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19490 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 08:18:14 +00:00
Daocheng Bu ddff9ce318 MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.
Add DxeIpmiLibIpmiProtocol Library Instance based on
Ipmi Protocol in DXE phase.

In V5,change for coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu <daocheng.bu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19489 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 08:17:50 +00:00
Daocheng Bu 0f2bca7642 MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

In V5, change for code style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu <daocheng.bu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19488 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 08:17:26 +00:00
Daocheng Bu 92cd1682aa MdeModulePkg: Add BaseIpmiLib Null Library Instance.
Add BaseIpmiLib Null Library Instance for BMC-LESS
platform.

In V5, change for coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu <daocheng.bu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19487 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23 08:17:02 +00:00
Dandan Bi 1b43162d70 MdeModulePkg:Clear the screen before booting the boot option
When do UiApp remodeling task,miss clearing the screen before booting
the selected boot option,so cause some behaviors change.Now add the code
to fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19441 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 09:37:33 +00:00
Dandan Bi 0034796f6c MdeModulePkg:Update Boot Manager form when enter it.
Currently BootManager is an independent library,used by UiApp.It only load boot
option when enter UiApp.So when add boot option through boot maintenance manager,
it will not display in boot manager. In order to fix this issue,now we update the
boot manager form every time we enter it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19440 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 09:16:21 +00:00
Zhang Lubo 47bda627ee MdeModulePkg:Fix a bug HttpLib can't parse last chunked data well
When HttpLib parsing the last chunked data down, the Http NextMsg pointer
in the HttpBodyParserCallback function should point to the character
after '/n' flag.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19310 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17 01:12:11 +00:00
Eric Dong 850ba6a953 FileExplorerLib: Remove the useless code.
The caller has initial the input parameter before call this function, So this code is useless.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19302 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 11:54:50 +00:00
Eric Dong bd69e72c8a BootManagerLib: Check the pointer to avoid use NULL pointer.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19301 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 11:48:27 +00:00
Eric Dong 4c8274a0d7 MdeModulePkg FileExplorerLib: Change file format which has mixed file format.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19297 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 03:21:44 +00:00
Eric Dong 426ddd0b6a MdeModulePkg DxeFileExplorerProtocol: Change file format which has mixed file format.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19296 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 03:20:21 +00:00
Jordan Justen 3f5287971f MdeModulePkg: Convert all .uni files to utf-8
To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py MdeModulePkg

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19257 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 04:56:23 +00:00
Eric Dong f0afe75ff8 DeviceManagerLib: Update copyright, use BSD license instead of Intel license.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19171 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 13:49:40 +00:00
Eric Dong 91afa21006 BootMaintenanceManagerLib: Update copyright, use BSD license instead of Intel license.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19170 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 13:49:15 +00:00
Eric Dong 5ea7178725 FileExplorerLib: Update copyright, use BSD license instead of Intel license.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19169 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 13:48:35 +00:00
Eric Dong f3b006c852 BootManagerLib: Update copyright, use BSD license instead of Intel license.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19168 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 13:47:23 +00:00
Dandan Bi e750958bbc MdeModulePkg: Use PcdSet##S to replace PcdSet##
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19166 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 08:03:42 +00:00
Chao Zhang 0f4f6d202a MdeModulePkg: VarCheckUefiLib: Add DeployedMode/AuditMode var check logic
DeployedMode & AuditMode are UINT8 Global variable according to Enable Secure Boot feature defined in UEFI2.5 Mantis 1263. Add them to var check list.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19131 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 06:15:49 +00:00
Baraneedharan Anbazhagan 39eccb9c66 MdeModulePkg: DebugAssert enhancement
If the assert happens in a library, then it's hard to determine which module
using that library is generating that assert. Use gEfiCallerBaseName in
DebugAssert to display the module name.

V2: Updated code to use copy mem and ModuleNameSize calculation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19128 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-07 03:06:30 +00:00
Ruiyu Ni 911f3dede2 MdeModulePkg/BootLogoLib: Fix INF comments to follow coding standards
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19083 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-01 06:56:36 +00:00
Ruiyu Ni ecbff74945 MdeModulePkg/BmpImageDecoderLib: Fix function header comments
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19082 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-01 06:52:44 +00:00
Dandan Bi cd32c66f94 MdeModulePkg:Replace unsafe string function with safe one.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19029 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 07:26:07 +00:00
Ruiyu Ni 404bd44294 MdeModulePkg/BDS: Do not pass unnecessary option to boot option
BDS puts a special GUID in boot option optional data for
auto-discovered boot option. But when launching that boot
option, the BDS core unconditionally pass the special GUID
to the executable.

A good written application/OS loader can ignore the unexpected
parameters, but BDS core should still avoid passing the
unnecessary GUID.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19007 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 03:08:49 +00:00
Dandan Bi 21f9922e3c MdeModulePkg:Refine the comments in INF files
Add comments in INF file in BootMaintenanceManagerLib.inf.
Refine the comments in INF file in FileExplorerLib.inf

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18975 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-26 10:00:12 +00:00
Star Zeng c0e6c39315 MdeModulePkg BaseSerialPortLib16550:Implement Get(Set)Control/SetAttributes
Cc: Michael D Kinney <michael.d.kinney@intel.com>
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>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18965 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-26 08:47:44 +00:00
Zhang Lubo b8b65a0320 MdeModulePkg: Clean code to follow C Coding style.
Clean code to follow C Coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18943 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-25 08:08:25 +00:00
Ruiyu Ni 665b26ba33 MdeModulePkg/UefiBootManagerLib: Always create MemoryTypeInfo variable
Align to old BDS behavior (IntelFrameworkModulePkg/BDS) to always create
MemoryTypeInfo variable regardless of the PcdResetOnMemoryTypeInformationChange
value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18926 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-24 06:56:05 +00:00
Dandan Bi 4af04335ac MdeModulePkg:Create Boot Maintenance Manager Library
Split the boot maintenance manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18923 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 09:34:55 +00:00
Dandan Bi 32465d9ae7 MdeModulePkg:Create Device Manager Library
Split the device manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18922 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 09:33:42 +00:00
Dandan Bi 3a2dc0f5a9 MdeModulePkg:Create Boot Manager Library
Split the boot manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18921 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 09:32:08 +00:00
Eric Dong 78b6eb659d MdeModulePkg DxeFileExplorerProtocol: Create wrapper fileexplorer library.
This library wrapper explorer protocol and produce the file explorer library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18919 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 05:42:50 +00:00
Eric Dong ba529e7e5a MdeModulePkg FileExplorerLib: Create file explorer library.
This library support select one file from the specified directory or from system root directory.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18917 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 05:41:28 +00:00
Ruiyu Ni 8084b26e92 MdeModulePkg/BootLogoLib: Fix GCC build failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18916 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-23 00:48:46 +00:00
Star Zeng 02018760ca MdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite()
The "read" word in SerialPortWrite() header comment block should be
"write".

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18910 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-20 01:51:15 +00:00
Ruiyu Ni b9335cf562 MdeModulePkg: Change BootLogoEnableLogo use INTN for minus value
The parameter name is also changed from Coordinate* to Offset* to
reflect that it's the offset to the location specified by Attribute.
For example, when the Attribute is Center, OffsetX and OffsetY are
used to specify the offset to the Center. OffsetX = 100 means
100 pixels right to the Center.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18867 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-18 05:05:22 +00:00
Ruiyu Ni 51b655a8a0 MdeModulePkg/VarCheck: Add VarCheck handler for PlatformRecovery####
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18864 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:16:02 +00:00
Ruiyu Ni 780e05caec MdeModulePkg: Add Platform recovery support
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18859 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:11:44 +00:00
Ruiyu Ni ccb66799e3 MdeModulePkg: Support to expand File device path
To support platform recovery, File device path expanding capability
is added.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18858 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:10:54 +00:00
Ruiyu Ni 121300c452 MdeModulePkg: Use BmForEachVariable to collect all key options
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18857 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:10:16 +00:00
Ruiyu Ni f9a24380b8 MdeModulePkg: Use BM_OPTION_NAME_LEN instead of sizeof L"Boot####"
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18856 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:09:25 +00:00
Ruiyu Ni 418e8cd924 MdeModulePkg: Use BmCharToUint in BmIsKeyOptionVariable
The patch also moves the BmCharToUint to BmMisc.c because it
belongs to misc functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18855 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:08:40 +00:00
Ruiyu Ni d95ff8e8d8 MdeModulePkg: Add Bm prefix for internal functions
Change VARIABLE_VISITOR to BM_VARIABLE_VISITOR
Change ForEachVariable to BmForEachVariable

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18854 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-17 10:07:43 +00:00
Laszlo Ersek bd3afeb1d6 MdeModulePkg: SmmLockBoxPeiLib: work without EFI_PEI_SMM_COMMUNICATION_PPI
The RestoreLockBox() and RestoreAllLockBoxInPlace() functions handle the
case when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns
EFI_NOT_STARTED: they access the SMRAM directly, for restoring LockBox
data.

This occurs if a PEIM needs to restore LockBox data *before* the SMBASE is
relocated and the SMI handler is installed for all processors.

One such PEIM is UefiCpuPkg/Universal/Acpi/S3Resume2Pei. On the S3 resume
path, in function S3RestoreConfig2(), LockBox data are restored *before*
the SmmRestoreCpu() function of UefiCpuPkg/PiSmmCpuDxeSmm is called via
SmmS3ResumeState->SmmS3ResumeEntryPoint. (The latter SmmRestoreCpu()
function is responsible for the SMBASE relocation.)

If a platform knows that its PEIMs restore LockBox data *only* before
SMBASE relocation -- e.g., due to S3Resume2Pei being the platform's only
SmmLockBoxPeiLib client --, then the platform might not want to include
"UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf" at all (hence
not provide EFI_PEI_SMM_COMMUNICATION_PPI) -- because all of those
restores would be serviced by direct SMRAM access anyway.

Currently the absence of EFI_PEI_SMM_COMMUNICATION_PPI is not supported by
SmmLockBoxPeiLib, but it's not hard to implement. Handle it the same as
when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns EFI_NOT_STARTED:
restore LockBox data directly from SMRAM.

Suggested-by: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18823 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-16 18:29:14 +00:00
Ruiyu Ni b3535ab4ef MdeModulePkg/BmpImageDecoderLib: Support ImageFormatUnknown type
Enhance the library to handle unknown image format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18774 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-12 07:14:40 +00:00
Ruiyu Ni 8dfe7fd239 MdeModulePkg: Add BootLogoLib to provide interfaces about logo display.
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: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18772 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-12 05:23:25 +00:00
Ruiyu Ni 328de7ae41 MdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding capability
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: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18771 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-12 05:22:21 +00:00
Ruiyu Ni 345c2b0713 MdeModulePkg: Add ImageDecoderLib to provide image decoding service.
The library itself doesn't provide any image decoding capabilities but
manages the different image decoders.

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: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18770 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-12 05:21:38 +00:00
Dandan Bi d6cc284e6f MdeModulePkg:Modify the pointer type.
Previously the pointer type is EFI_IFR_FORM_SET, it is incorrect when
do pointer addition without conversion.Now change it to UINT8 type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18768 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-11 08:34:04 +00:00
Zhang Lubo e91cc29dd7 MdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 address correctly.
When parsing the authority component of the input URL, it can not distinguish 
the ":" is the flag that indicates the port or the separator between 
the ipv6 address.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Gary Ching-Pang Lin <glin@suse.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18744 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-09 03:45:23 +00:00
Sunny Wang fad21b7c57 MdeModulePkg: Fix memory leak issues
Fix memory leak issues

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18722 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-03 02:58:30 +00:00
Samer El-Haj-Mahmoud 32c8c88df5 MdeModulePkg: Add DEBUG statement when reaching max perf log entries
Add a DEBUG statement when the number of PEI perf log entries
exceeds PcdMaxPeiPerformanceLogEntries

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18714 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-02 02:38:24 +00:00
Dandan Bi 8a4582838b MdeModulePkg:Add new API HiiGetFormSetFromHiiHandle into UefiHiiLib
This function is mainly through the Hii handle to get the formset opcode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18684 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 10:19:29 +00:00
Sunny Wang 5d3a9896f0 MdeModulePkg: Make the BmFindLoadOption function public
Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18662 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 04:49:08 +00:00
Star Zeng d2dbe5b70b MdeModulePkg VarCheckLib: R18611 was thoughtless for property set
R18611 only updated the logic to return correct property
when no property set to variable with wildcard name.
But VariablePropertySet needs the pointer of property data for set.
So roll back the change in VariablePropertyGetWithWildcardName at R18611,
and check the property revision first in VariablePropertyGet and
SetVariableCheck before using the property data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18626 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 06:41:28 +00:00
Star Zeng 1cce53d384 MdeModulepkg VarCheckLib: Return NULL when no property set
to variable with wildcard name.

VarCheckLib has zeroed property for variable with wildcard name
and is waiting for property set. The code should return NULL
when no property set to variable with wildcard name, but not
return the zeroed property that will impact the functionality of
SetVariableCheck.

The issue does not appear with VarCheckUefiLib linked as the library
just has the expected property set.

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: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18611 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 01:31:56 +00:00
Star Zeng ca49b6f9bf MdeModulePkg PiDxeS3BootScriptLib: Use PcdSet64S to instead of PcdSet64
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
For this case, PcdS3BootScriptTablePrivateDataPtr and PcdS3BootScriptTablePrivateSmmDataPtr are expected to be DynamicDefault,
so use PcdSet64S to instead of PcdSet64 and assert when set failure.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18599 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-10 02:53:41 +00:00
Star Zeng 2f931dda52 MdeModulePkg UefiBootManagerLib: Do not assume perf entry count has no change
Current implementation assumes the performance entry count has no change from
multiple GetPerformanceMeasurement() while loops, it may cause the allocated buffer
for PerfEntriesAsDxeHandle at the first loop to be overflowed if the following loop has
the count changed.

This patch is also to sync the change at
commit R17851 "IntelFrameworkModulePkg GenericBdsLib: Resolve array size mismatch".

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18561 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-30 04:29:50 +00:00
Samer El-Haj-Mahmoud 33ecfa8af9 MdeModulePkg: Add SMBIOS 3.0 support in NetLibGetSystemGuid.
NetLibGetSystemGuid gets the UUID from SMBIOS table to use as the System GUID
(in DHCP and other network use cases). This change adds support to get the
UUID from either SMBIOS 2.x or 3.0, since SMBIOS 3.0 uses a different GUID in
the System Configuration Table.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18559 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-30 01:06:57 +00:00
Dandan Bi 2d3e4cd167 MdeModulePkg:Fix the bug the incorrect change of StrCpyS function
The pointer to the destination string changed,the max length also changed.Previous change neglect this point.
And base on the code logic,we can use StrCatS to replace StrCpyS.Now this patch is to fix this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18497 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-17 07:21:22 +00:00
Star Zeng 960f2d533b MdeModulePkg PiDxeS3BootScriptLib: Remove a hidden assumption.
What to do:
1. Remove a hidden assumption "No SMM driver writes BootScript between
SmmReadyToLock and S3SleepEntryCallback".
 1.1. Use SmmExitBootServices and SmmLegacyBoot notification to record
      AtRuntime flag.
 1.2. Use mBootScriptDataBootTimeGuid LockBox to save boot time boot
      script data to handle potential INSERT boot script at runtime in SMM.
2. Do not depend on OS to help restore ACPINvs data and use
EfiReservedMemoryType instead of EfiACPIMemoryNVS.
 2.1. Use mBootScriptSmmPrivateDataGuid LockBox to save boot script
      SMM private data with BackFromS3 = TRUE at runtime. S3 resume
      will help restore it to tell the Library the system is back
      from S3.

Why to do:
1. The hidden assumption "No SMM driver writes BootScript between
SmmReadyToLock and S3SleepEntryCallback" will cause confusion to
the library's consumer and block the usage of "SMM driver writes
BootScript after SmmReadyToLock". So Remove the assumption.
2. In original code, there might be a corner case that malicious
code patch ACPINvs boot TableLength field same as SMM boot script.
So that it can skip the table restore. The impact is that BootScript
in SMM may be overridden by malicious code.
--------------------
    CopyMem ((VOID*)&TableHeader, (VOID*)mS3BootScriptTablePtr->TableBase, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER));
    if (mS3BootScriptTablePtr->TableLength + sizeof(EFI_BOOT_SCRIPT_TERMINATE) != TableHeader.TableLength) { // TableLength is in NVS
      ......
      //
      // NOTE: We should NOT use TableHeader.TableLength, because it is already updated to be whole length.
      //
      mS3BootScriptTablePtr->TableLength = (UINT32)(mLockBoxLength - sizeof(EFI_BOOT_SCRIPT_TERMINATE)); ? This line can be skipped.
--------------------
So use EfiReservedMemoryType instead of EfiACPIMemoryNVS as the code
has been updated to not depend on OS to help restore ACPINvs data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18467 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-15 07:49:12 +00:00
Ruiyu Ni 88cbb6be4e MdeModulePkg: Fix a performance data buffer overrun issue
The mBmPerfHeader.Count isn't reset to 0 in BmWriteBootToOsPerformanceData()
so when the actual performance data entry count exceeds the LimitCount,
the performance data collection breaks on condition
if (mBmPerfHeader.Count == LimitCount), but 2nd time calling this function
will not break on condition if (mBmPerfHeader.Count == LimitCount) because
the mBmPerfHeader.Count always bigger than LimitCount, which results buffer
overrun.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18417 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-09 05:43:44 +00:00
Sunny Wang 4982ea57d9 MdeModulePkg: Remove unused variables from both UefiBootManagerLib and BdsDxe to fix GCC build.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18350 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28 05:41:06 +00:00
Liming Gao d6a55a12c0 MdeModulePkg: Add the missing module UNI files.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18342 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28 02:46:46 +00:00
Eric Dong cf34f86bc2 MdeModulePkg: Replace deprecated function.
Replace GetEfiGlobalVariable with GetEfiGlobalVariable2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18332 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-27 04:52:24 +00:00
Jiaxin Wu f9a149164a MdeModulePkg: Convert the UNIX to DOS end of line format
Convert the UNIX to DOS end of line format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
 

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18324 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-27 01:04:59 +00:00
Ruiyu Ni 5e8df1ba6d MdeModulePkg: Fix UefiBootManagerLib.inf license header.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18298 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 06:27:01 +00:00
Star Zeng c95d9ab81a MdeModulePkg: Add PlatformVarCleanupLib library
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18295 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 03:11:06 +00:00
Star Zeng a2918326ac MdeModulePkg: Add VarCheckPcdLib NULL class library
The check will be based on PcdVarCheck binary that generated
by BaseTools.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18294 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 03:10:32 +00:00
Star Zeng 1241af9510 MdeModulePkg: Add VarCheckHiiLib NULL class library
The check will be based on VarCheckHiiBin that generated
from FV and Hii Database.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18293 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 03:10:04 +00:00
Star Zeng b85488b396 MdeModulePkg: Add VarCheckUefiLib NULL class library
What to do: Implement VarCheckUefiLib NULL class library instance.
The code logic are separated from Variable driver, and it will consume VarCheckLib
to register var check handler and variable property set for UEFI defined variables.

Why to do: Share code.
Separate variable check UEFI code from Variable driver in MdeModulePkg.
We are going to separate generic software logic code from Variable Driver
to benefit other variable driver implementation. Auth services has been done
to be AuthVariableLib, now to cover variable check service.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18279 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 02:58:36 +00:00
Star Zeng 31b183bcf9 MdeModulePkg: Add VarCheckLib library
What to do:
1. Add VarCheckLib LibraryClass definitions.
2. Implement VarCheckLib library instance.
The code logic are separated from Variable driver.

Why to do: Share code.
Separate variable check service from Variable driver in MdeModulePkg.
We are going to separate generic software logic code from Variable Driver
to benefit other variable driver implementation. Auth services has been done
to be AuthVariableLib, now to cover variable check service.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18278 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-25 02:58:09 +00:00
Zhang Lubo 0cd1ecea67 MdeModulePkg: Add codes to support trailer parse in HttpLib.
In HttpLib, the Event BodyParseComplete should return to the
callback function when the whole message body has been parsed
including the trailer if it has.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18213 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12 12:44:31 +00:00
Fu Siyuan 2bd25290f3 MdeModulePkg: Use monotonic count to initialize the NetLib random seed.
NetRandomInitSeed() function use current time to initialize the random seed,
while in some platform the time service is not accuracy that make the random
seed collision. This patch add the monotonic count to the seed to avoid this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18185 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-07 03:22:10 +00:00
Eric Dong 8fa9ac60f5 Support get string from configuration string packages.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18074 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-27 07:40:18 +00:00
Ruiyu Ni d948fe96a5 MdeModulePkg: Make boot option description unique
When there are multiple network boot options, user will see multiple
"UEFI Network" boot options. It's hard to distinguish them using the
description.
The patch enhances the boot option generation logic to append " 2"
/" 3"/" 4"/... number suffix to the non-first network boot options.
So the 2nd one becomes "UEFI Network 2".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18062 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-26 08:07:15 +00:00
Star Zeng c03beb762a MdeModulePkg PiSmmCore: Remove a hidden assumption of SMRAM reservation
that assumes the SMRAM reserved range is only at the end of the SMRAM descriptor.

          //
          // This range has reserved area, calculate the left free size
          //
          gSmmCorePrivate->SmramRanges[Index].PhysicalSize = SmramResRegion->SmramReservedStart - gSmmCorePrivate->SmramRanges[Index].CpuStart;

Imagine the following scenario where we just reserve the first page of the SMRAM range:

SMRAM Descriptor:
  Start: 0x80000000
  Size: 0x02000000

Reserved Range:
  Start: 0x80000000
  Size: 0x00001000

In this case the adjustment to the SMRAM range size yields zero: ReservedStart - SMRAM Start is 0x80000000 - 0x80000000 = 0.
So even though most of the range is still free the IPL code decides its unusable.

The problem comes from the email thread: [edk2] PiSmmIpl SMRAM Reservation Logic.
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/15268

Also to follow the idea in the email thread, the patch is to
1. Keep only one copy of full SMRAM ranges in gSmmCorePrivate->SmramRanges,
split record for SmmConfiguration->SmramReservedRegions and SMM Core that
will be marked to be EFI_ALLOCATED in gSmmCorePrivate->SmramRanges.
2. Handle SmmConfiguration->SmramReservedRegions at beginning of, at end of,
in the middle of, or cross multiple SmramRanges.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18031 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-26 07:38:12 +00:00
Ard Biesheuvel 4c10f95344 MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST
Change the type of mStatusString[] to reflect that it is a CONST
array of pointers to CONST.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18022 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16 06:50:45 +00:00
fanwang2 3f6d5100dc MdeModulePkg: Remove two protocols and add HttpLib access
Remove two protocols never used in DxeNetLib.inf and add HttpLib access in MdeModulePkg.dec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: fanwang2 <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17983 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 02:44:40 +00:00
Ruiyu Ni 579b5ef204 MdeModulePkg: Fix potential integer overflow issue
In certain rare circumstance, the data passed from outside of SMM may be
invalid resulting the integer overflow. The issue are found by code review.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17908 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-10 02:16:42 +00:00
Zhang Lubo 206b5f51be MdeModulePkg: Replace unsafe string functions.
Replace unsafe string functions with new added safe string functions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17881 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 06:35:37 +00:00
jiaxinwu 6c5c70d68d MdeModulePkg: Remove NetLib and Ip4Config Protocol dependency.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jiaxinwu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com> 
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hp.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17873 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 03:08:05 +00:00
Qiu Shumin 8feb7452ac MdeModulePkg: Refine code to use Strn**S safe functions instead of Str**S ones in some cases.
Safe string functions may ASSERT when the source length is larger than the MaxDest. This patch use Strn**S to indicate the copy length.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17867 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 01:08:09 +00:00
Fu Siyuan eb4d0b5e85 MdeModulePkg: Add HttpLib.
This patch add the header file and DXE implementation for the HttpLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17856 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-07 09:29:00 +00:00
Ruiyu Ni ebf735f119 MdeModulePkg: Update UefiBootManagerLib to support HTTP boot option creation
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17849 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-07 05:43:00 +00:00
Qiu Shumin 0ec2bfc857 MdeModulePkg: Use StrnCpyS instead of StrCpyS to indicate the copy length from the source.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17841 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-07 03:01:07 +00:00
Liming Gao de6c0eff30 MdeModulePkg: UefiBootManagerLib to handle LoadFile DevicePath
UEFI Spec HTTP Boot Device Path, after retrieving the boot resource
information, the BootURI device path node will be updated to include
the BootURI information. It means the device path on the child handle
will be updated after the LoadFile() service is called.

To handle this case, UefiBootManagerLib BmGetLoadOptionBuffer API
is updated as the below:
1) Get Device handle based on Device Path
2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer.
3) Retrieve DevicePath from Device handle

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17798 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02 04:27:54 +00:00
Liming Gao 2b75e8cd09 MdeModulePkg: SecurityManagementLib to handle LoadFile DevicePath
UEFI Spec HTTP Boot Device Path, after retrieving the boot resource
information, the BootURI device path node will be updated to include
the BootURI information. It means the device path on the child handle
will be updated after the LoadFile() service is called.

To handle this case, SecurityManagementLib ExecuteSecurityHandlers API
is updated as the below:
1) Get Device handle based on Device Path
2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer.
3) Retrieve DevicePath from Device handle

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17797 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02 04:27:32 +00:00
Qiu Shumin b6344b37c9 MdeModulePkg/Library/UefiBootManagerLib: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17782 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 08:21:16 +00:00
Qiu Shumin 93fd37dc0b MdeModulePkg/Library/SmmCorePerformanceLib: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17781 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 08:19:56 +00:00
Qiu Shumin e1565962dc MdeModulePkg/Library/PeiPerformanceLib: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17780 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 08:15:27 +00:00
Qiu Shumin 8f770819a1 MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17779 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 08:14:36 +00:00
Qiu Shumin 96f983fabc MdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17778 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 08:05:00 +00:00
Star Zeng b6477d820b MdeModulePkg: Add AuthVariableLib LibraryClass
What to do:
1. Add AuthVariableLib LibraryClass definitions.
2. Implement a NULL AuthVariableLib library instance.
3. Add VARIABLE_ENTRY_PROPERTY definition to VarCheck.h.
4. Add VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h.

Why to do:
1. Share code.
1.1. Separate auth variable service from Auth Variable driver in
SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.

1.2 The VARIABLE_ENTRY_PROPERTY definition to VarCheck.h,
VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h will be shared
by merged Variable driver and AuthVariableLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17757 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01 03:04:18 +00:00