summaryrefslogtreecommitdiff
path: root/ShellPkg
AgeCommit message (Collapse)Author
2016-12-26ShellPkg: Move to new locationGuo Mang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
2016-07-29ShellPkg: Unregister hotkey callback when exiting ShellRuiyu Ni
Commit 9168df3dea65f707d1e9c32eba5e18ef6b84e5cd "ShellPkg/ShellProtocol.c: Handle memory allocation failure" only keeps the protocol clean up in CleanUpShellProtocol() and creates a new function CleanUpShellEnvironment() which calls CleanUpShellProtocol(), then unregisters the hotkey callback. But the commit forgot to change the Shell.c to call CleanUpShellEnvironment() which causes the hotkey callback is not unregistered while the callback function doesn't exist when Shell exits. This causes system hang when pressing CTRL+C after exiting shell. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 031403460c9782a2563a81a6065ded99046960c2)
2016-07-29ShellPkg: Correct files with CRLF line endingLiming Gao
Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 9b7143c9041c9e9e7d431e3dc3788feda475d9bc)
2016-07-25ShellPkg/LoadPciRom: Fix the ConnectAll() implementationRuiyu Ni
Old implementation depends on UefiHandleParsingLib and uses incorrect Index to get handle type. The simplest ConnectAll() implementation can be just to locate all handles and call BS.ConnectController() for each of them recursively. BS.ConnectController() does nothing to the image handle. Such implementation is borrowed from BDS core implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit fc41b97f128a0c7f28a9cc250e629a0ad2262ac8)
2016-07-25ShellPkg/If: Fix issue to pass static code checkerRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit 1b0319535bc751e27846cbf0c4a1eb4d7d690e97)
2016-07-25ShellPkg/UefiHandleParsingLib: Fix issue to pass static code checkerRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit 94fcb76b61f180b1ebe2fa3b3b26138c733c4d45)
2016-07-25ShellPkg: Fix a potential NULL pointer deference issueRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit 51686a7a294191a5ea87dc89b3167b01297ee6b0)
2016-07-25ShellPkg/DrvDiag: Fix a critical typo bugRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit cb9f3a59c390c94d5fb252c7f9b44571db90adf2)
2016-07-25ShellPkg: Fix echo to support displaying special charactersRuiyu Ni
Run 'echo -t' without the patch will get the result: echo: Unknown flag - '-t' The expected result is to display '-t' literally. This patch adds special handle for 'echo'. 'echo' will not use the general parameter parsing library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 95fc5a877502a6e6324300eed0136243d359fa96)
2016-07-25ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLibRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 0fcf8d4df85d861b6e721bd1d8abb449f05e15ed)
2016-07-25ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLibRuiyu Ni
And add Shell prefix to the two library APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit c0bcd3433f33876c519bf5567e0ab69261b57fe9)
2016-07-25ShellPkg/ShellCommandLib.h: Formalize EOLRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit b464d7ed0f417fe37a9d998e377a144704273949)
2016-07-25ShellPkg/UefiShellCommandLib.c: Formalize EOLRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit cf041fd799bedd87e67eadfb10e41cfd85d9cfe8)
2016-07-25ShellPkg: Fix VS2010/2012 build failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> (cherry picked from commit 9ba25c7db7e918c3c911dd20641ba54ce721e872)
2016-07-25ShellPkg/Ping6: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit e7a5a238c32f62441ed5a156525b9db96f0892da)
2016-07-25ShellPkg/Ifconfig6: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit a915fea68e6bea900755f85e81cdc1070b9f3dc6)
2016-07-25ShellPkg/UefiShellLib.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit eeb9744e5659d6ea035b9ba66b72c5c5b0a2c32e)
2016-07-25ShellPkg/IfConfig: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 18bff310aae5d26d440e03742a208d7ecfa72387)
2016-07-25ShellPkg/UefiShellLib: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 2efafabf41f05b88c421d97838f193eeb3f9c8e2)
2016-07-25ShellPkg/Mv: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 28d447f9bdbc79317be60064521f81e04d72c063)
2016-07-25ShellPkg/Cp: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 0b34dc1324e07d330efea50222bf399a860bdbd9)
2016-07-25ShellPkg/Cd: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit a34b7c36621140b2da94e92373a61a549477f684)
2016-07-25ShellPkg/If: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 581c03896cf88e875f620f6ea9d90ecb2b941c18)
2016-07-25ShellPkg/For: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 59b7dbac4ea075313af989cc20b71d44fdc7829a)
2016-07-25ShellPkg/DrvDiag: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 26ca45a86fa519e61c511ed27718b3f6dfe2710c)
2016-07-25ShellPkg/DrvCfg: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 58972f5cf7e1163e474f961afe34e200fd5dac11)
2016-07-25ShellPkg/DevTree: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 55b1d63de7677f89178f200404d8d05a23150a4a)
2016-07-25ShellPkg/Edit: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 3e9442a564a767f7bd60113117d7b993a4e29a9b)
2016-07-25ShellPkg/LoadPciRom: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 20cfed165c47a7ff578e469e4cf00f1a656eccbd)
2016-07-25ShellPkg/EfiDecompress: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit aba0ca78c6a96433af9dba74e4e56487b0c27d2e)
2016-07-25ShellPkg/EfiCompress: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit ca1b2411f5bcdc0b023f331afd9a9e741752067e)
2016-07-25ShellPkg/DMem: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit c87bb070a6007605b13adc2f8f2b93086aed7956)
2016-07-25ShellPkg/UefiShellCommandLib.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 107d05a433c3ea5d877baaa4867ede7708323d38)
2016-07-25ShellPkg/ConsistMapping.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 2c7c3b87bf43ce0977106546220b96e4d4b1ca36)
2016-07-25ShellPkg/UefiShellBcfgCommandLib: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 5945813f69f1d5864bb54982bf59ebd1057c4949)
2016-07-25ShellPkg/UefiHandleParsingLib.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit aa3276c171e3bd2f29745c4b48589f0faded4322)
2016-07-25ShellPkg/Dp: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit d758f80971a7447328d67dd5d4dd2a94dabe1656)
2016-07-25ShellPkg/ShellProtocol.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 9168df3dea65f707d1e9c32eba5e18ef6b84e5cd)
2016-07-25ShellPkg/ShellAddEnvVarToList: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit ffbc60a02757fe430448d7ad022d04cec133ba5d)
2016-07-25ShellPkg/IsVolatileEnv: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 31e5b912b99e0fb39e81f70bc24a4be589191abb)
2016-07-25ShellPkg/Shell.c: Handle memory allocation failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit b2c036a7f016bc8808c5eb8eb3dd5399a96664b9)
2016-07-25ShellPkg: Fix issue about Ifconfig6 -r command.Zhang Lubo
Follow the Shell Spec, when the interface name is Specified, we need to refresh the Ipv6 configuration. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> (cherry picked from commit e2f5c491d8749c88cbf56168a3493d70ff19a382)
2016-07-13Revert "ShellPkg: Make the USB mouse behavior in 'edit' consistent with ↵Ruiyu Ni
'hexedit'." This reverts commit ee60bd2b6aa473fdff6af3bfc62203ed8ca5c52a and e36ed7a84b2768443de22371f0aad5cf502328b1. The two commits enhanced 'edit' to support text selection through mouse. But the code introduced some bugs resulting the text selection behavior is not very usable and potentially hang in certain platforms. So I'd like to revert them firstly. If there is strong requirement for the text selection through mouse in 'edit' I will refine and re-add the code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jarben.carsey@intel.com> (cherry picked from commit 664fd5877d8b144b0d2cc667feab37286986ffb6)
2016-07-13ShellPkg: Series of patches to fix typos - apropriate to appropriateMudusuru, Giri P
Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-By: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 1d32246161af275d7a2d17ade4a8fa53ea37a556)
2016-07-13ShellPkg:Ping: Ping command hangs with intermittent packet lossesSubramanian, Sriram (EG Servers Platform SW)
When we have intermittent loss of packets, ping command doesnt return to Shell prompt. It keeps looping in the while (Status ==EFI_NOT_READY) since Private->RxCount will never reach Private->SendNum. Addresses the issue with the use of a new varibale in the PRIVATE structure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 80f7a8f5f9d21f8315d39be0f5651ce7160594fc)
2016-07-13Fix GUID dereferenceThomas Palmer
Print's "%g" argument requires a EFI_GUID pointer, not the EFI_GUID value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-By: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit e06a4c0812cfac25a9eb1e8c851156fe19a29ab3)
2016-07-13ShellPkg: Update the error prompt for ping6 command.Zhang Lubo
when we use the ping6 command without configuring the network interface, it should give correct prompt to users. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> (cherry picked from commit dded3ae880310c1fa57a6259058dc28d12cff61c)
2016-07-13ShellPkg: UefiHandleParsingLib: remove tautological comparisonLaszlo Ersek
The code being removed in this patch dates back to git commit a405b86d274d (Sep 14, 2010; "udk2010.up2.shell initial release."). The condition always evaluates to true, and it breaks DEBUG builds of ArmVirtPkg with gcc-6.1: ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c: In function 'ParseHandleDatabaseByRelationshipWithType': ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c:2465:76: error: self-comparison always evaluates to true [-Werror=tautological-compare] ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]); Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Michael Zimmermann <sigmaepsilon92@gmail.com> Reported-by: Gerd Hoffmann <kraxel@redhat.com> Reported-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Suggested-by: Jaben Carsey <jaben.carsey@intel.com> Ref: http://thread.gmane.org/gmane.comp.bios.edk2.devel/13794/focus=13939 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 42cb906852753a081b8458c7f8742e74eeadefd3)
2016-07-13ShellPkg: don't call functions with side effects in ASSERT_EFI_ERROR()Laszlo Ersek
When ASSERT_EFI_ERROR() is compiled out, dependent on build flags, only the status checking should be removed; the function calls should stay. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 4a7518d31a0254e4065d308f091bd7bc16dc8dba)
2016-07-13ShellPkg/UefiHandleParsing: Show handle's loaded image device pathRuiyu Ni
The patch fixed a bug in UefiHandleParsingLib to show handle's loaded image device path. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 5e32460d8050fbc088230183151865c671a4e2df)