Commit Graph

765 Commits

Author SHA1 Message Date
Liming Gao 8953d69a5c MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenu from LoadFile
BootManagerMenu boot option is handled by EfiBootManagerGetBootManagerMenu.
Don't need to handle it again when parse LoadFile protocol.

In V2, use "BootManagerMenu" instead of "BootMenuApp".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-09-02 15:45:55 +08:00
Liming Gao 7c69fbf20d MdeModulePkg UefiBootManagerLib: Rename BootMenuApp to BootManagerMenu
Rename local function name BootMenuApp to BootManagerMenu to align to
other public function name.

In V2, use "BootManagerMenu" instead of "BootMenuApp".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-09-02 15:45:54 +08:00
Ruiyu Ni eeef069d6c MdeModulePkg/BaseResetSystemLibNull: Implement ResetPlatformSpecific
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
2016-09-02 10:07:14 +08:00
Star Zeng 6c59c7c2f4 MdeModulePkg VarCheck: #### in L"Boot####" are upper case hex
UEFI spec:
Each load option entry resides in a Boot####, Driver####, SysPrep####,
OsRecovery#### or PlatformRecovery#### variable where #### is replaced
by a unique option number in printable hexadecimal representation using
the digits 0-9, and the upper case versions of the characters A-F
(0000-FFFF).

The patch also makes L"HwErrRec####" follow this rule.

Cc: Ruiyu Ni <ruiyu.ni@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-08-31 15:23:42 +08:00
Hao Wu 39cde03cc5 MdeModulePkg: Use IsZeroGuid API for zero GUID checking
Instead of comparing a GUID with gZeroGuid via the CompareGuid API, the
commit uses the IsZeroGuid API to check if the given GUID is a zero GUID.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
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>
2016-08-31 11:14:01 +08:00
Zhang Lubo d82d59edb0 MdeModulePkg:Fix bug in function AsciiStrToIp4.
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4
will return success as the HostName has a valid IP address. So we
need to check if it is a decimal character before using AsciiStrDecimalToUintn.

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: Sriram Subramanian <sriram-s@hpe.com>
2016-08-24 13:44:02 +08:00
Liming Gao e9e44f6547 MdeModulePkg UefiBootManagerLib: Fix VS2012 build failure
Initialize local variable Description as NULL first.

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-08-03 15:20:42 +08:00
Liming Gao fa9f986cfb MdeModulePkg UefiBootManagerLib: Update LoadFile boot description
Update boot description to support LoadFile protocol based on FV file.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-08-01 12:58:27 +08:00
Liming Gao 2f01478894 MdeModulePkg UefiBootManagerLib: Support LoadFile Protocol based on FV
New LoadFileOnFv2 driver will install LoadFile protocol based on FV file.
Update UefiBootManagerLib to find BootMenuApp with LoadFile protocol.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-08-01 12:58:23 +08:00
Liming Gao 0aa09042dd MdeModulePkg UefiBootManagerLib: Add BmIsBootMenuAppFilePath internal API
This function abstracts the common logic to find BootMenuApp file.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-08-01 12:58:20 +08:00
Giri P Mudusuru 2048c585b4 MdeModulePkg: Fix typos in comments and variables
- abstrated to abstracted
  - accessibla to accessible
  - addres to address
  - apropriate to appropriate
  - arry to array
  - availabe to available
  - avaliable to available
  - becasue to because
  - correponding to corresponding
  - etablished to established
  - exeuction to execution
  - extensiable to extensible
  - fileds to fields
  - loadding to loading
  - ptototypes to prototypes
  - prococol protocol
  - requried to required
  - resoruce to resource
  - runing to running
  - uild to build

Cc: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-07-11 10:29:48 +08:00
Dandan Bi 984cb6462a MdeModulePkg/BootMaintUiLib: Update menus when open BMM form
BootMaintenanceManagerUiLib depend on the LeagcyBootMaintUiLib to show the
legacy menus. So we need to do the actions related to LegacyUi in BMM
after the LeagcyBootMaintUiLib have been initialized. So now : 1). update
menus (including legacy menus), 2) re-scan boot options (including legacy
boot option) when opening the BMM form. We think when opening BMM form,
the LeagcyBootMaintUiLib must have been initialized.

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: Liming Gao <liming.gao@intel.com>
2016-07-07 12:49:01 +08:00
Ruiyu Ni 3a986a353d MdeModulePkg/Bds: MemoryTypeInformation excludes boot option mem use
The patch re-orders the sequences by putting updating memory type
information before loading the boot option so that the reserved
memory usage by HTTP RAM disk boot can be excluded by the memory
type information updating.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-07-07 09:57:31 +08:00
Bi, Dandan a91f1a0e88 MdeModulePkg/BootMaintUi: Add error handling codes when AllocatePool fail
The AllocateCopyPool in function ExtractFileNameFromDevicePath
may return NULL, so need to do error handling. This patch is to
add error handling codes for function ExtractFileNameFromDevicePath
and its caller functions.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao Wu <hao.a.wu@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: Hao Wu <hao.a.wu@intel.com>
2016-07-06 16:23:02 +08:00
Bi, Dandan ae9026ddfa MdeModulePkg/UefiHiiLib: Add error handling codes when AllocatePool fail
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-07-06 16:22:52 +08:00
Sunny Wang e58f1ae5c9 MdeModulePkg: Skip registering BootManagerMenu if absent
This is a enhancement to support the case when platform firmware
doesn't support Boot Manager Menu. For now, if BootManagerMenu FFS
can not be retrieved from FV, BDS core code will still register a
boot option for it. Then, this non-functional boot option will
still be booted by user's request (like HotKey or Exit from shell)
to cause additional boot time and error status code reported.
Therefore, it would be good to skip BootManagerMenu boot option
registration and then return error status and Invalid BootOption
data for this case so that the BootManagerBoot() or other consumers
can directly return without doing anything.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-07-05 17:33:05 +08:00
Star Zeng cdad7675e6 MdeModulePkg PiSmmCoreMemoryAllocLib: Extend to support MemoryProfileLib
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>
2016-07-01 09:39:59 +08:00
Star Zeng e273569285 MdeModulePkg DxeCoreMemoryAllocationLib: Extend to support MemoryProfileLib
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>
2016-07-01 09:39:58 +08:00
Star Zeng 022a9bf79c MdeModulePkg: Implement new library instance SmmMemoryAllocationProfileLib
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>
2016-07-01 09:39:58 +08:00
Star Zeng 1439c25537 MdeModulePkg: Implement new library instance UefiMemoryAllocationProfileLib
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>
2016-07-01 09:39:57 +08:00
Star Zeng fd3fac0fb2 MdeModulePkg DxeSmmPerformanceLib: Add missing UefiLib in *.inf at de2459d
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>
2016-06-29 12:54:53 +08:00
Star Zeng a7636346cb MdeModulePkg PiDxeS3BootScriptLib: Use a specific name for mSmst
When a driver also uses a same name, there will be a link error:
one or more multiply defined symbols found.
Use a specific name for mSmst to avoid the link error.

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>
2016-06-27 11:11:09 +08:00
Sunny Wang fb5848c588 MdeModulePkg/UefiBootManagerLib: Fix data in MemoryTypeInformation
After booting a large-size ISO RAM disk (HTTP boot option pointing to
a ISO file) and reboot system, system will possibly run into the
following ASSERT because the BDS core code doesn't consider the
case that Memory page management (Page.c) would possibly NOT update
current memory usage statistics(CurrentMemoryTypeInformation) if
system allocates a memory buffer with a large number of pages.
ASSERT [DxeCore] u:\MdeModulePkg\Core\Dxe\Gcd\Gcd.c(2273):
Length >= MinimalMemorySizeNeeded

The BDS code block for skipping counting reserved memory occupied
by RAM Disk didn't consider the Memory page management's behavior
mentioned above, which caused that the
CurrentMemoryTypeInformation[Index1].NumberOfPages will be updated
to a "very big value" because RamDiskSizeInPages is bigger than
CurrentMemoryTypeInformation[Index1].NumberOfPages. For example,
NumberOfPages is 0x9000 (current use) and RamDiskSizeInPages is
0xC0000 (ISO image size). The result will become a very big value
0xFFF49000.

Therefore, we need to add a check to prevent BDS core code updating
wrong data (very big value) to MemoryTypeInformation variable. This
code change is a improvement for fixing this issue for most cases.
There is still a corner case even when the memory bins don't include
the RAM disk memory, the memory used by all other modules exceeds
RamDiskSizeInPages. Ray will send the other patch to fix this corner
case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-06-27 10:38:09 +08:00
Star Zeng b68ccac17c MdeModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
It is the follow up of 3ab41b7a32
to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with
UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-06-21 12:46:24 +08:00
Dandan Bi 7de6db5f55 MdeModulePkg/BootManagerUiLib: No need to connect all devices
The connect all action has been done in UiApp,
no need to do it when update boot manager form.

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: Liming Gao <liming.gao@intel.com>
2016-06-21 12:33:48 +08:00
Star Zeng d6f38e374e MdeModulePkg DxeS3BootScriptLib: Check (mSmst != NULL) before freeing SMRAM
There is static scan tool reports BootScriptSave.c:628:'mSmst' is
explicitly dereferenced.

The patch is to check (mSmst != NULL) before freeing SMRAM at
BootScriptSave.c:628.

Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-06-13 16:04:22 +08:00
Star Zeng 6bf6fc54ab MdeModulePkg: Correct the usage of gPerformanceProtocolGuid in inf
Add gPerformanceProtocolGuid in BdsDxe.inf explicitly.
Currently, BdsDxe could build pass as it inherits
gPerformanceProtocolGuid from UefiBootManagerLib.inf.

Also update the usage of gPerformanceProtocolGuid in UefiBootManagerLib.inf.

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: Liming Gao <liming.gao@intel.com>
2016-06-12 12:56:23 +08:00
Star Zeng 626f6f6e74 MdeModulePkg DxeS3BootScriptLib: Revert git commit 058196bbb3
With a destructor implemented, the shortcut from 058196bbb3
should be unnecessary.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-06-07 10:01:10 +08:00
Star Zeng cfd79783d6 MdeModulePkg DxeS3BootScriptLib: Add DESTRUCTOR S3BootScriptLibDeinitialize
PiDxeS3BootScriptLib has a constructor S3BootScriptLibInitialize() that
registers ready-to-lock callback S3BootScriptSmmEventCallBack() and several
more. The library is linked to SMM modules. If the module entry-point
function returns error (because of lack of resources, unsupported,
whatever), the module will be unloaded and the notify callback pointers
will point to undefined memory. On ready-to-lock exception occurs when
calling S3BootScriptSmmEventCallBack(), and probably all the other
callbacks registered by the constructor would also cause exception.

This patch is to implement library Destructor to free the resources
allocated by S3BootScriptLibInitialize() and unregister callbacks.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.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>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-06-07 10:01:10 +08:00
Star Zeng 738df706c1 MdeModulePkg SmmLockBoxSmmLib: Add DESTRUCTOR SmmLockBoxSmmDestructor
SmmLockBoxSmmLib is linked to SMM modules. If the module entry-point
function returns error, the module will be unloaded and the global
variables will point to undefined memory.

This patch is to add DESTRUCTOR SmmLockBoxSmmDestructor to uninstall
SmmLockBoxCommunication configuration table if it has been installed
in Constructor.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.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>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-06-07 10:01:09 +08:00
Star Zeng da9d39c28e MdeModulePkg SmmLockBoxSmmLib: Fix typo in SmmLockBoxSmmConstructuor
SmmLockBoxSmmConstructuor should be SmmLockBoxSmmConstructor.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-06-07 10:01:08 +08:00
Gary Li b34e446122 MdeModulePkg:Prevent the BmRepairAllControllers routine in an infinite loop
Prevent the BmRepairAllControllers routine in an infinite loop

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Gary Li <garyli@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-06-03 15:57:47 +08:00
Dandan Bi 8caa3caaed MdeModulePkg: Make function comments and function match in UI codes
Cc: Qiu Shumin <shumin.qiu@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: Qiu Shumin <shumin.qiu@intel.com>
2016-05-25 16:35:36 +08:00
Dong, Eric b6c8ee6865 MdeModulePkg BootManagerUiLib: Remove invalid keyword "bds".
In current code, BootManagerUiLib is not BDS scope.
So we remove bds keyword in the function name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-19 12:33:33 +08:00
Dong, Eric 80b14f9a99 BootMaintenanceManagerUiLib: Remove invalid keyword "bds"
In current code, BootMaintenanceManagerUiLib is not BDS scope.
So we remove bds keyword in the function name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-19 12:33:33 +08:00
Dong, Eric 8c53b5e67c BootMaintenanceMangerUiLib: Save mode info for later use.
In current code, we use different output modes for boot phase
and setup phase. When split BootMaintenanceMangerUiLib from
UiApp code, we not add logic to save the boot phase mode info
which will be used later. This change add this logic.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-19 12:33:33 +08:00
Dong, Eric cb9fcac0ea MdeModulePkg BootManagerUiLib: Save mode info for later use.
In current code, we use different output modes for boot phase
and setup phase. When split BootManagerUiLib from UiApp code,
we not add logic to save the boot phase mode info which will
be used later. This change add this logic.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-19 12:33:33 +08:00
Eric Dong 720eea6aa8 BootMaintenanceManagerUiLib: Rollback changes for BootNext.
Commit a85be3ae48 imports errors for
BootNext question, this patch rollback the related changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-18 10:52:02 +08:00
Jiaxin Wu 1fed57ab5d MdeModulePkg: Refine the code for DxeHttpLib
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: Liming Gao <liming.gao@intel.com>
2016-05-17 20:23:18 +08:00
Laszlo Ersek 7b13510f2a MdeModulePkg/BootMaintenanceManagerUiLib: hide library-internal symbol
Static storage duration objects that are internal to a library instance
should:
- either have internal linkage (i.e., be declared STATIC),
- or, if they are referenced in multiple files of the library instance,
  prefixed with a word that is specific to the library instance, and
  minimizes namespace collisions.

In this case, the "gHiiDriverList" variable (with static storage duration
and external linkage) is defined in both BootMaintenanceManagerUiLib and
UiApp. When these are linked together, GCC catches the multiple external
definitions and aborts the build. (GCC notices this due to commit
214a3b79417f.) Fix the error by applying the first rule above.

Fixes: a85be3ae48
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-05-17 10:09:53 +08:00
Laszlo Ersek 17da28f3e2 MdeModulePkg/BootMaintenanceManagerUiLib: remove unused but set variable
As-is, the code triggers [-Werror=unused-but-set-variable] with GCC.

Fixes: a85be3ae48
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-05-17 10:09:52 +08:00
Dong, Eric a85be3ae48 BootMaintenanceManagerUiLib: change code for customization.
Change file arrangement to let user easy customize the BMM UI.
After this change:
1. UiCustomizeBMMPage function in BootMaintenanceManagerCustomizedUi.c
use to let user customize BMM first page menus. UiBMMCallbackHandler
function use to handle the callback for the added menus.
2. BootMaintenanceManagerCustomizedUiSupport.c file used to add support
 functions used by BootMaintenanceManagerCustomizedUi.c file.
3. After this change, only above two files need to be updated if BMM
first page menus needed to be changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-13 11:18:07 +08:00
Nagaraj Hegde 09991304c9 MdeModulePkg:DxeHttpLib: Add checks in HttpGenRequestMessage API
HttpGenRequestMessage assumes that HTTP message would always
contain a request-line, headers and an optional message body.
However, subsequent to a HTTP PUT/POST request, HTTP requests
would contain just the message body. This patch supports
creation of such request messages with additional checks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-05-13 09:29:07 +08:00
Michael Zimmermann 140cc8000f MdeModulePkg: FileExplorerLib: prevent freeing null pointer
when there's no volume label 'Info' can be NULL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-09 16:18:00 +08:00
Dandan Bi 2d6a7af90f MdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistent
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>
2016-05-06 10:44:12 +08:00
Dong, Eric cb3077230f MdeModulePkg FileExplorerLib: Add UefiHiiServicesLib dependency.
FileExplorerLib depends on UefiHiiServicesLib, so add this missing
library dependency back.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-05-05 10:07:45 +08:00
Zhang, Chao B 8b73a15cf6 MdeModulePkg: VarCheckUefiLib: Remove DeployedMode/AuditMode var check logic
Remove DeployedMode & AuditMode Global variable check for Customized Secure Boot feature defined in UEFI2.5 Mantis 1263.
The feature has been moved to
  https://github.com/tianocore/edk2-staging/tree/Customized-Secure-Boot
Previous check-in hash is
  SHA-1: 0f4f6d202a

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-05-04 09:13:47 +08:00
Ruiyu Ni 4ed2440d44 MdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API
Expose EfiBootManagerGetLoadOptionBuffer() API.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-04 08:47:34 +08:00
Liming Gao de2459d66d MdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib.
This patch enhance performance data SMM communication by using fixed
SMM communication buffer.

Update PerformanceLib to use fixed SMM communication buffer to get
performance data by SMM_PERF_COMMUNICATE API.

This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS
requirement.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
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-29 12:49:21 +08:00
Laszlo Ersek 058196bbb3 MdeModulePkg: PiDxeS3BootScriptLib: honor PcdAcpiS3Enable
In the edk2 tree, there are currently four drivers that consume
PcdAcpiS3Enable:

  IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
  MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
  MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf

From these, AcpiS3SaveDxe is the only one that isn't also a client of the
S3BootScriptLib class; all the others (BootScriptExecutorDxe,
S3SaveStateDxe, SmmS3SaveState) are clients of the S3BootScriptLib class.

In turn, the edk2 tree contains only one non-Null instance of the
S3BootScriptLib class:

  MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf

Therefore we can safely state that BootScriptExecutorDxe, S3SaveStateDxe,
and SmmS3SaveState are all linked against PiDxeS3BootScriptLib.

Now, if PcdAcpiS3Enable is FALSE when either of BootScriptExecutorDxe,
SmmS3SaveState, or SmmS3SaveState is dispatched, then the following
happens:

- The constructor of PiDxeS3BootScriptLib, function
  S3BootScriptLibInitialize(), registers a protocol installation callback
  for gEfiDxeSmmReadyToLockProtocolGuid. Namely, the function
  S3BootScriptEventCallBack().

- The driver immediately exits with EFI_UNSUPPORTED from its entry point
  function, upon seeing PcdAcpiS3Enable == FALSE. (See commits
  800c02fbe2, 125e093876, and d2d38610603f6.)

- This leaves a dangling callback pointer in the DXE core.

- When Platform BDS installs gEfiDxeSmmReadyToLockProtocolGuid (which is a
  valid thing to do for locking down SMM, even in the absence of S3
  support!), things blow up.

Fix this issue by returning immediately from S3BootScriptLibInitialize()
if PcdAcpiS3Enable is FALSE -- it is useless to initialize the library
instance if the containing driver module exits first thing in its entry
point.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-28 19:34:13 +02:00
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