summaryrefslogtreecommitdiffstats
path: root/ShellPkg
Commit message (Collapse)AuthorAgeFilesLines
...
* ShellPkg: Do NULL pointer check before the pointer is used.Qiu Shumin2016-02-181-1/+5
| | | | | | | | | The pointer 'FileInterface->Buffer' returned from 'AllocateZeroPool' in function 'CreateFileInterfaceMem' may be NULL and will be dereferenced at the following code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.Cinnamon Shia2016-02-181-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>
* ShellPkg: complete previous incomplete patchJim Dailey2016-02-101-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>
* Merge branch 'master' of https://github.com/tianocore/edk2Jaben Carsey2016-02-101-13/+29
|\
| * ShellPkg: Fix ASCII and UNICODE file pipes.jaben carsey2016-02-084-35/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ShellPkg: ShellFileHandleReadLine must return UCS2 lines.Jim Dailey2016-02-101-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>
* | ShellPkg: Fix ASCII and UNICODE file pipes.jaben carsey2016-02-094-35/+71
|/ | | | | | | | | | | | | | | | | | 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>
* ShellPkg: Refine the code to avoid use a constant number as offset.Qiu Shumin2016-01-261-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
* ShellPkg: UefiShellBcfgCommandLib: bump VERSION_STRINGLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): print optional data with DumpHex()Laszlo Ersek2016-01-211-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
* ShellPkg: elevate DumpHex() from Debug1-internal to generic-internalLaszlo Ersek2016-01-216-88/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ShellPkg: BcfgDisplayDump(): fix ShellPrintEx() call siteLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): fix reporting of OptionalDataLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): calculate OptionalDataOffset explicitlyLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): eliminate FilePathList duplicationLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): call Description[Size] by nameLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): address FilePathListLength by nameLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): enforce minimum size for Boot#### and co.Laszlo Ersek2016-01-212-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
* ShellPkg: BcfgDisplayDump(): accumulate errorsLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): hoist NULL-init of DevPath[String]Laszlo Ersek2016-01-211-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
* ShellPkg: UefiShellBcfgCommandLib: drop unused string tokensLaszlo Ersek2016-01-211-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
* ShellPkg: BcfgDisplayDump(): update whitespace & layoutLaszlo Ersek2016-01-211-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
* ShellPkg UefiDpLib: Use Image->FilePath to get name for SMM driversStar Zeng2016-01-191-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
* ShellPkg: Add NOOPT target in ShellPkg.dscHao Wu2016-01-191-2/+2
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19679 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Update 'dh' command to reflect correct driver handle informationTapan Shah2016-01-151-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
* ShellPkg: Clean-up 'map' command error message handlingTapan Shah2016-01-071-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
* Revert "ShellPkg : Add UEFI_APPLICATION module type to ↵Laszlo Ersek2016-01-061-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
* ShellPkg: Make 'alias' can display a single alias name.Qiu Shumin2016-01-061-3/+16
| | | | | | | | | | When we run command "alias cat" Shell print out "alias: Too few arguments". This patch makes value of single alias name can be displayed. 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@19608 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix Shell assert when mv a file to a NULL target.Qiu Shumin2016-01-061-2/+2
| | | | | | | | | | When run command 'mv file ' the Shell assert. The patch refined the length of the buffer to fix this bug. 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@19607 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg : Add UEFI_APPLICATION module type to UefiShellInstall1CommandsLib.infSamer El-Haj-Mahmoud2016-01-051-1/+2
| | | | | | | | | | | | Using UEFI_APPLICATION for all Shell app and libraries allows the use of different compiler flags for the Shell application itself and for other applications that are built separately that use Shell libraries. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19585 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in function 'EfiShellSetCurDir' and 'EfiShellSetMap'.Yao Jiewen2015-12-251-0/+9
| | | | | | | | | | Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19529 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in function'ShellCommandConsistMappingInitialize'.Yao Jiewen2015-12-251-0/+1
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19528 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in function ↵Yao Jiewen2015-12-251-0/+3
| | | | | | | | | | | 'ShellCommandCreateInitialMappingsAndPaths'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19527 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in function'ShellCommandRunHelp'.Yao Jiewen2015-12-251-0/+2
| | | | | | | | | | When run help command Shell may have memory leak. This patch fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19526 6f19259b-4bc3-4df7-8a09-765794883524
* Subject: [PATCH 5/9] ShellPkg: Fix memory leak in ↵Qiu Shumin2015-12-251-0/+2
| | | | | | | | | | function'ManBufferFindSections'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19525 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in 'ShellOpenFileByName'.Yao Jiewen2015-12-251-1/+6
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19524 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in 'InternalShellExecuteDevicePath'.Yao Jiewen2015-12-241-0/+1
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19523 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix the TAB-auto-completion memory leak.Qiu Shumin2015-12-241-0/+3
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19522 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak when running Shell script.Qiu Shumin2015-12-242-0/+61
| | | | | | | | | | | | | | | | | | When we run following script in Shell: " for %a run (1 200) echo %a memmap endfor " We may find memory leak in system. This patch free buffer in 'BufferToFreeList' to avoid this issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19521 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Refine the code logic of 'command history'.Qiu Shumin2015-12-243-13/+44
| | | | | | | | | | | | Add the PCD to PcdShellMaxHistoryCommandCount indicate the max count of history commands. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19520 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in ShellProtocol.Qiu Shumin2015-12-231-0/+6
| | | | | | | | | | | | 1. Close unused file handle. 2. Free the local allocated buffer function returned. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19481 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix memory leak in SimpleTextOutput on file.Qiu Shumin2015-12-231-1/+3
| | | | | | | | | | Free 'SimpleTextOut->Mode' buffer before 'SimpleTextOut' is free. 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@19480 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Add AIP IPv6 UNDI support to Shell dhSamer El-Haj-Mahmoud2015-12-223-4/+25
| | | | | | | | | | Update Shell DH command to decode and print the value of gEfiAdapterInfoUndiIpv6SupportGuid AIP instance. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19437 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Refine the code format.Qiu Shumin2015-12-211-2/+21
| | | | | | | | | | | 1. Add function header comment. 2. Non-Boolean comparisons should explicitly use a compare operator. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19424 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix unhandled value in switch statementPaulo Alcantara2015-12-161-0/+2
| | | | | | | | | | | | | | | | | | This patch fixes the following compile error under GCC 5.3.1: /home/pcacjr/work/edk2.git/ShellPkg/Application/Shell/ShellManParser.c: In function 'IsTitleHeader': /home/pcacjr/work/edk2.git/ShellPkg/Application/Shell/ShellManParser.c:502:5: error: enumeration value 'Final' not handled in switch [-Werror=switch] switch (State) { ^ Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19304 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix the 'bcfg' command ASSERT when use some invalid parameters.Qiu Shumin2015-12-161-2/+2
| | | | | | | | | | | | 'bcfg boot mv xx yy' command will ASSET when xx is larger than the count of boot options. This patch correct the order of ShellPrintHiiEx parameters to fix the bugs. 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@19295 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Use %p for smbiosview SMBIOS table addresses.Samer El-Haj-Mahmoud2015-12-161-2/+3
| | | | | | | | 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19293 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Fix a bug in smbiosview PowerSupply Characteristics.Samer El-Haj-Mahmoud2015-12-161-3/+3
| | | | | | | | | | Fix bit shifting when isolating the Characteristics of Power Supply information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19291 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg: Ease the shell's MAN file Title Header syntax requirements.Jim Dailey2015-12-161-48/+150
| | | | | | | | | | | | | | Prior to this change, the shell would not use a MAN file if the Title Header line was not strictly formatted. For example, if the case of the command name in the file was not exactly the same as the case of the command name as typed by the user, the MAN file would not be used. Also, extra whitespace on the line would also cause the shell to ignore the MAN file. This change allows "extra" white space and ignores case when looking for the command name. It also ignores any path information for cases where the user enters a relative or absolute path to the EFI file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19290 6f19259b-4bc3-4df7-8a09-765794883524
* ShellPkg/Mm: Fix build warningsMichael Kinney2015-12-141-11/+13
| | | | | | | | | | | | Fix build warnings for potentially uninitialized local variables in the functions ShellMmLocateIoProtocol() and ShellCommandRunMm() in the Shell implementation of the 'mm' command. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19233 6f19259b-4bc3-4df7-8a09-765794883524