summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
Commit message (Collapse)AuthorAgeFilesLines
...
* ShellPkg: Add NULL pointer check.Qiu Shumin2016-07-131-3/+17
| | | | | | | | | | | Add pointer check to avoid NULL pointer dereferenced. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Tapan Shah <tapandshah@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Tapan Shah <tapandshah@hpe.com> (cherry picked from commit 6d3911d40610c01e843a35cefd1fec57f98a4fc2)
* ShellPkg: Enhance ping6 to select the interface automaticallyJiaxin Wu2016-07-131-71/+95
| | | | | | | | | | | | | | | | | | | | | v2: * Refine the code to make it more readable. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 76cd3ffab6105c3c535125c1907ccdb4a9e19bbd)
* ShellPkg: Enhance ping to select the interface automaticallyJiaxin Wu2016-07-132-101/+129
| | | | | | | | | | | | | | | | | | | | | | | | v2: * A. Refine the code to make it more readable. * B. Add hint message for link local address case. This patch is used to support no source IP specified case while multiple NICs existed in the platform. The command will select the first both connected and configured interface automatically. Note: Source address is always required when pinging a link-local address. Cc: David Van Arnem <dvanarnem@cmlab.biz> Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 9ce14ca124dd4ef1ae1f4e7c55840a13f1a6c0b7)
* ShellPkg: Update smbiosview for latest Type 17 devicesSamer El-Haj-Mahmoud2016-07-131-0/+21
| | | | | | | | | | Update smbiosview to understand latest SMBIOS Type 17 devices from SMBIOS 3.0.0 spec Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 21cc5ebf361248631fcfebde6494d4b615c62f4b)
* ShellPkg: Fix typos and EDK2 coding style issuesTapan Shah2016-07-131-10/+10
| | | | | | | | | | Fixing typos and EDK2 coding style issues found from previous submit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit a5b731e0850aa98bf1e635860016e913a6cbb808)
* ShellPkg: Fix pci command for '_e' optionAbdul Lateef Attar2016-07-131-0/+1
| | | | | | | | | | | | | | | ShellPkg: Fix pci command for '_e' option Processing of '_e' argument was missing. Added fix, to process the '_e' option for printing additional AER information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Abdul Lateef Attar <abdul-lateef.attar@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> (cherry picked from commit 262e2d94b6c889fe0737a756bd4860d732aa2dc3)
* ShellPkg: Enahance 'dh' command to add more protocols decoding supportTapan Shah2016-07-135-9/+248
| | | | | | | | | | | Adding EdidDiscovered, EdidActive protocol decode support a in 'dh' command. Extending GraphicsOutput protocol decoding to list all supported GOP resolutions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit cf6c1550cbf80423a9c058a52f7708db09dd4883)
* ShellPkg: Support connect a device handle recursively with '-r'.Qiu Shumin2016-07-131-3/+4
| | | | | | | | | | This patch make Shell 'connect' a device handle recursively with '-r' option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit b5e44fbc15085270adfc777c0f2c1890c1e9790f)
* ShellPkg: Update ping command options to sync with SpecJiaxin Wu2016-07-132-15/+19
| | | | | | | | | | | | | | | | This patch is used to update ping command options to sync with shell2.2 Spec. Considering the backward compatible issue, the patch keeps ā€˜-_sā€™ command option unchanged, only add the new option '-s' and make the old option '-_s' function same as new one. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 0b42d7d8a34a99a02becf4dece78481d3cd2b2fc)
* ShellPkg: Update Guid/Protocol usages in INF files.Liming Gao2016-07-136-26/+26
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> (cherry picked from commit 06ac66ecb6c1b5d2bf712e84c0a36add6a262015)
* ShellPkg: Fix Shell ASSERT when mv file with cwd is NULL.Qiu Shumin2016-07-131-13/+16
| | | | | | | | | | | | | | | | Shell will ASSERT when doing the following operation: "" Shell> mv fs2:\file1 fs2:\file2 "" This patch add NULL pointer check to fix this issue. Fixes: https://github.com/tianocore/edk2/issues/76 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (cherry picked from commit 64ee6ed72ad5c1e4b7c9a96f419c3592e93314ad)
* ShellPkg: Refine the comparisons code in ShellPkg.Qiu Shumin2016-07-131-7/+7
| | | | | | | | | | For Boolean values not use explicit comparisons to TRUE or FALSE. For non-Boolean comparisons we should use a compare operator. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit ac14846aad016a1f88ebe4a09e00779dd03fcf88)
* ShellPkg/UefiDpLib: Fix a memory leak issue in Dp.Cinnamon Shia2016-07-131-0/+3
| | | | | | | | | | The allocated memory of ParamPackage is not freed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 3751a092b67f2d3481fa2295cb45a0afda6a9118)
* ShellPkg/UefiHandleParsingLib: Fix GUID referenceQiu Shumin2016-07-131-1/+1
| | | | | | | | | | Pass in GUID* for the GUID reference in a CatSPrint statement. Issue was noticed when running "dh -d -v" command on a system with a PCI NIC installed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> (cherry picked from commit 5d54bbec2ce3861d646fbbd19072b1c3c1537f17)
* ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variableArd Biesheuvel2016-07-131-4/+0
| | | | | | | | | | | Remove variable FStartRow that is declared, assigned but never referenced. This fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit e36ed7a84b2768443de22371f0aad5cf502328b1)
* ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management ā†µTapan Shah2016-07-133-3/+573
| | | | | | | | | | | | | Protocol Image Descriptor Information. Modify 'dh' shell command to dump FirmwareManagement Protocol information. Add FirmwareManagement image descriptor V1 and V2 structure definition in UefiHandleParsingLib.h to support decoding V1/V2 revisions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 8985d6127afc380ce10212a3eb7bb04bc5630380)
* ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.Qiu Shumin2016-07-135-39/+480
| | | | | | | | | | 1. Make the USB mouse cursor move smoothly in 'edit'. 2. Make the USB mouse can drag and select text in 'edit'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit ee60bd2b6aa473fdff6af3bfc62203ed8ca5c52a)
* ShellPkg: Use DOS format end of line.Qiu Shumin2016-07-132-14/+14
| | | | | | | | | Use DOS format end of line(CR, LF). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 231ad7d8660d674d95fc4e03361338ac573c1f9f)
* ShellPkg/UefiDpLib: Support execution breakCinnamon Shia2016-07-134-25/+110
| | | | | | | | | | | Support UEFI shell execution break. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 196ccda08fc481dae4fc97db8f2938df87801edb)
* ShellPkg: Merge Ping6 and Ifconfig6 tools to Shell command.Zhang, Lubo2016-07-136-0/+3463
| | | | | | | | | | | | | | | According to the new Shell spec, we add Network2 profile and merge Ping6 and Ifconfig6 tools to Shell command. Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-By: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> (cherry picked from commit 43ca17532bd7292eee5ad979e26b19ddd0d3e55a)
* ShellPkg: Fix smbiosview decode of PCIe Extended CapabilitiesSamer El-Haj-Mahmoud2016-07-132-4/+12
| | | | | | | | | | | Fix SMBIOSVIEW decode of the HeaderLog fields of the PCIe AER structure . The PCIe 2.1 Base Specification, section 7.10, lists this as 16 bytes, or 4 DWORDs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 2c328aca1d5dfd99e7541d85db63318be3d4da62)
* ShellPkg: Update 'ifconfig -r' implementationJiaxin Wu2016-07-131-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | This patch is used to update ifconfig -r implementation to sync with UEFI Shell 2.2. option -r means to reconfigure all or specified interface, and set DHCP policy. If specified interface is already set to DHCP, then refresh the IPv4 configuration. If the interface name is specified with '-r', DHCP DORA process will be triggered by the policy transition (static -> dhcp). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 913ba15120b4dfa58fb90e859161ccf976015321)
* ShellPkg: Revert git 'd6cf1af9' fixJiaxin Wu2016-07-131-103/+14
| | | | | | | | | | | | | | | | 'd6cf1af9' is associated with '3d0a49ad' commit. So, this patch is used to respond the revert for '3d0a49ad' to adapt the Ipv4 config policy update. Cc: Subramanian Sriram <sriram-s@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: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> (cherry picked from commit db54ae0845e321e4cce35f0ccbb16b7fcb2b57db)
* ShellPkg: Fix unexpected behavior of mouse cursor in Editor.Qiu Shumin2016-07-131-3/+4
| | | | | | | | | | | | USB mouse cursor cannot move unless the left button is down. The patch refresh the FileBuffer of Editor every time when the 'MainEditorRefresh' is called to fix this bug. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> (cherry picked from commit fb9dd8322532cd71d897b3b5690a3d2268bb1603)
* ShellPkg: Do NULL pointer check before the pointer is used.Qiu Shumin2016-07-131-1/+1
| | | | | | | | | Do NULL pointer check before the pointer is used to avoid dereferenced. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit e3b76f3b5e80df1219fb4adf0199b9606e84b8e7)
* ShellPkg: Fix the last command doesn't work in a script.Qiu Shumin2016-07-131-1/+4
| | | | | | | | | | | When the last line in a script file is not an empty line the Shell will not execute the command in the last line. The patch refine the logic in function 'ShellFileHandleReturnLine' and fix the issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> (cherry picked from commit f79d7b62ba11db018db7bd489dd44051bfc067ae)
* ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.Cinnamon Shia2016-07-131-31/+9
| | | | | | | | | | | Replace gBS->LocateHandle with gBS->LocateHandleBuffer Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> (cherry picked from commit 64c51ed181545f2c9914ad49c8dcbabe2f9a32e2)
* ShellPkg: complete previous incomplete patchJim Dailey2016-07-131-29/+13
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <Jim_Dailey@Dell.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 1095b4323dab2e64e71bf7896ea88a0eb5d64706)
* ShellPkg: Fix ASCII and UNICODE file pipes.jaben carsey2016-07-131-13/+29
| | | | | | | | | | | | | | | | | | | Fix various errors when piping a UNICODE or ASCII file to a simple shell application that reads standard input and writes it to standard output. 1) When the memory file is created by CreateFileInferfaceMem() to capture the pipe output, no UNICODE BOM is written to the memory file. Later, when the memory file is read by the application using ShellFileHandleReadLine(), the function indicates that the file is ASCII because there is no BOM. 2) If the file is piped as ASCII, the ASCII memory image is not correctly created by FileInterfaceMemWrite() as each ASCII character is followed by '\0' in the image (when the ASCII data is written to the memory image, the file position should only be incremented by half the buffer size). 3) ShellFileHandleReadLine() does not read ASCII files correctly (writes to Buffer need to be cast as CHAR8*). 4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard to read and difficult to debug with certain tools due to the typecasting of This. Added a local variable (MemFile) of the correct type to these functions and used it instead of This. Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE when appropriate. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit d2a0d2e6acea4d6a3dbe31b68a9a7fe7511cb478)
* ShellPkg: ShellFileHandleReadLine must return UCS2 lines.Jim Dailey2016-07-131-31/+26
| | | | | | | | | | | | | An earlier change had this function returning the type of lines that were in the file being read (ASCII or UCS2). The way it is used, UCS2 output is expected, even when the file being read is ASCII. This change restores that behavior and documents it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <Jim_Dailey@Dell.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 2dda8a12329700f9026236d83be4de9e5369f97f)
* ShellPkg: Fix ASCII and UNICODE file pipes.jaben carsey2016-07-132-19/+40
| | | | | | | | | | | | | | | | | | | Fix various errors when piping a UNICODE or ASCII file to a simple shell application that reads standard input and writes it to standard output. 1) When the memory file is created by CreateFileInferfaceMem() to capture the pipe output, no UNICODE BOM is written to the memory file. Later, when the memory file is read by the application using ShellFileHandleReadLine(), the function indicates that the file is ASCII because there is no BOM. 2) If the file is piped as ASCII, the ASCII memory image is not correctly created by FileInterfaceMemWrite() as each ASCII character is followed by '\0' in the image (when the ASCII data is written to the memory image, the file position should only be incremented by half the buffer size). 3) ShellFileHandleReadLine() does not read ASCII files correctly (writes to Buffer need to be cast as CHAR8*). 4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard to read and difficult to debug with certain tools due to the typecasting of This. Added a local variable (MemFile) of the correct type to these functions and used it instead of This. Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE when appropriate. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 9ed21946c76e430097e9c4e59b419af928e0cb8c)
* ShellPkg: Refine the code to avoid use a constant number as offset.Qiu Shumin2016-07-131-1/+1
| | | | | | | | | | | | Refine the code to use 'sizeof(EFI_LOAD_OPTION)' as offset in buffer to get 'description' instead of using a constant number. This change makes the code more readable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-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@19746 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit aed8c66dac8731e8175cdeaff78e24c1ff728b90)
* ShellPkg: UefiShellBcfgCommandLib: bump VERSION_STRINGLaszlo Ersek2016-07-131-1/+1
| | | | | | | | | | | | | | | The changes due to the previous patches should be reflected in a higher minor version number. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Suggested-by: Jaben Carsey <jaben.carsey@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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19719 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit af3e209f93d42263bc8949e03b17d5bd3640db11)
* ShellPkg: BcfgDisplayDump(): print optional data with DumpHex()Laszlo Ersek2016-07-131-14/+7
| | | | | | | | | | | | | | The DumpHex() function produces very friendly output (known from DMPSTORE, for example); let's use it with "BCFG -v" as well. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19718 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 2de293cd96294c314999e6935b46d6d12d2091f9)
* ShellPkg: elevate DumpHex() from Debug1-internal to generic-internalLaszlo Ersek2016-07-135-88/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UEFI Shell specification classifies shell commands into various shell levels / profiles. Currently the DumpHex() internal function is only used by commands that belong to the Debug1 profile exclusively (i.e., they are not required to be present in other than Debug1 profiles): - SMBIOSVIEW - PCI - DMPSTORE - DMEM - DBLK In the next patch, we'd like to call DumpHex() from BCFG as well. However, BCFG is not only required to be present in the Debug1 profile; the Install1 profile contains BCFG as well. For this reason, move DumpHex() from UefiShellDebug1CommandsLib to the more generic UefiShellCommandLib, which "Provides interface to shell internal functions for shell commands". The matching header file is "ShellPkg/Include/Library/ShellCommandLib.h". Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19717 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 3bd89603625eb451b166ee64676c2b31818d1a1f)
* ShellPkg: BcfgDisplayDump(): fix ShellPrintEx() call siteLaszlo Ersek2016-07-131-1/+0
| | | | | | | | | | | | | | | | | | This is likely a copy & paste error from the preceding ShellPrintHiiEx() function call. ShellPrintEx() takes no Language parameter, so remove the NULL argument, which is currently misinterpreted as a format string. This bug prevents the hexdump of optional data even when -v is passed to BCFG, and optional data exist. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19716 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit cf3c9b1884b9918f9ea509c86c1765cea054ebaa)
* ShellPkg: BcfgDisplayDump(): fix reporting of OptionalDataLaszlo Ersek2016-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this cleaned up form of BcfgDisplayDump(), it is easier to see that the OptionalDataOffset <= BufferSize expression, used to report whether optional data are *absent*, is incorrect. For any well-formed EFI_LOAD_OPTION, this inequality always holds. Optional data are present exactly if OptionalDataOffset < BufferSize therefore the absence condition is the negation of the above, OptionalDataOffset >= BufferSize This patch fixes the bug where BCFG always reports "Optional- N", even if optional data exist. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19715 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 898962530445979706a2c17e2f8a8c5a573e4e77)
* ShellPkg: BcfgDisplayDump(): calculate OptionalDataOffset explicitlyLaszlo Ersek2016-07-131-2/+8
| | | | | | | | | | | | | | | Eliminate some more repeated pointer arithmetic. This patch too is only refactoring. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19714 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 5a5a659092ebc3936ecd18c3b78c6fc850d4af1c)
* ShellPkg: BcfgDisplayDump(): eliminate FilePathList duplicationLaszlo Ersek2016-07-131-10/+3
| | | | | | | | | | | | | | | | | Copying and releasing each EFI_LOAD_OPTION.FilePathList under the name DevPath is wasteful -- we only need FilePathList for a single conversion to text. Do it directly from the EFI_LOAD_OPTION object. This patch is not supposed to change observable behavior. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19713 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 40de6483ec902472dabf61332595194937f5c260)
* ShellPkg: BcfgDisplayDump(): call Description[Size] by nameLaszlo Ersek2016-07-131-5/+10
| | | | | | | | | | | | | | | Introduce two more helper variables to avoid repeated pointer arithmetic. This patch is not supposed to change behavior. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19712 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 5dc03ade6adbb7e91ec7ce90045692154dbef2aa)
* ShellPkg: BcfgDisplayDump(): address FilePathListLength by nameLaszlo Ersek2016-07-131-5/+6
| | | | | | | | | | | | | | | | | The Buffer variable points at the beginning of an EFI_LOAD_OPTION structure. We might as well address the "FilePathListLength" member by name, rather than with *(UINT16*)(Buffer+4). This patch is not supposed to change behavior. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19711 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 3b6b1105cf31a3547d6157e912d72ec9ddc69a4b)
* ShellPkg: BcfgDisplayDump(): enforce minimum size for Boot#### and co.Laszlo Ersek2016-07-132-0/+20
| | | | | | | | | | | | | | | | | | | "3.1.1 Boot Manager Programming" in the UEFI 2.5 spec mandates that Boot#### and similar options contain EFI_LOAD_OPTION structures. The EFI_LOAD_OPTION structure encodes the fixed initial part of the payload, and we can (and should) use it to enforce a minimum size for variable contents. This patch is meant as a safety improvement. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19710 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit e5945ef78463a2a90631c91e9f8cff109fd20625)
* ShellPkg: BcfgDisplayDump(): accumulate errorsLaszlo Ersek2016-07-131-2/+7
| | | | | | | | | | | | | | | | | Don't exit the command immediately when a variable access fails; continue processing after printing the error message. Let the final return status reflect any encountered errors. This patch is intended as a functional improvement. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19709 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 8f2c09f8b2a8708db49e42bcac4cdfbccfa817d8)
* ShellPkg: BcfgDisplayDump(): hoist NULL-init of DevPath[String]Laszlo Ersek2016-07-131-6/+4
| | | | | | | | | | | | | | | | It will help with error handling if we move these initializations near the top of the loop body. This patch is not supposed to change behavior. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19708 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 43da602cb4e14efa921a359afb9c4c06c7138eba)
* ShellPkg: UefiShellBcfgCommandLib: drop unused string tokensLaszlo Ersek2016-07-131-3/+0
| | | | | | | | | | | | | | STR_GEN_PROBLEM_VAL, STR_GEN_TOO_MANY, and STR_BCFG_LOCATION_RANGE are not used in the C source code. Remove them to decrease clutter. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19707 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit c7e97f6d4464d0adcc5f26c980e0b5a97064a6e0)
* ShellPkg: BcfgDisplayDump(): update whitespace & layoutLaszlo Ersek2016-07-131-10/+10
| | | | | | | | | | | | | | | This patch incurs no functional changes, it just modifies some whitespace, so we can separate these non-functional changes from the functional changes in the next patches. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19706 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 15f8a738dda9c6f207e8194758a20641b1d3f4f5)
* ShellPkg UefiDpLib: Use Image->FilePath to get name for SMM driversStar Zeng2016-07-131-3/+11
| | | | | | | | | | | | | | | | | | | This enhancement is to use the FilePath field in the loaded image protocol to find the name of an image as a fallback for when the loaded image device path protocol is not installed on the image handle. This is necessary because the SMM core does not install the loaded image device path protocol, so DP was displaying "Unknown Driver Name" for every SMM driver. Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Shumin Qiu <shumin.qiu@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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19683 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 3b672240e6c77ccf3f5cc0f3e8dbf026fc9e2751)
* ShellPkg: Update 'dh' command to reflect correct driver handle informationTapan Shah2016-07-131-2/+2
| | | | | | | | | | | | 'dh' command shows Supported EFI Specification Version value as DriverVersion. Changing it to 'SupportedEfiSpecVersion' to provide more accurate information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19648 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit ccdf8bcfe4df040f952f362999c8a3cc8a3bb738)
* ShellPkg: Clean-up 'map' command error message handlingTapan Shah2016-07-131-41/+40
| | | | | | | | | | | Refactor 'map' command error handling code and add standard error message Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19616 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit e49ecad0fa2f918eded65bc3477cfb64e4fb133a)
* Revert "ShellPkg : Add UEFI_APPLICATION module type to ā†µLaszlo Ersek2016-07-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | UefiShellInstall1CommandsLib.inf" SVN r19585 broke the OVMF build: > ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf(20): > error 3001: MODULE_TYPE UEFI_DRIVER UEFI_APPLICATION is not supported > for EDK II, valid values are: > BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER > DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLICATION USER_DEFINED > SMM_CORE Revert the patch. Reported-by: Laszlo Ersek <lersek@redhat.com> Suggested-by: "El-Haj-Mahmoud, Samer" <samer.el-haj-mahmoud@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19610 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit bdc063e1347d84266bb86574a8d3e352edd1ab32)