Commit Graph

706 Commits

Author SHA1 Message Date
Tapan Shah 38707d76fc ShellPkg: Add Persistent Memory support in 'memmap' command
As per ECR 1416, latest UEFI Shell 2.2 Specification has added Persistent
Memory support in 'memmap' command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-09-22 14:17:07 -07:00
Tapan Shah 339a2b935e ShellPkg: Add '-nc' flag support in 'disconnect' command
As per ECR 1416, latest UEFI Shell 2.2 specification:
Define a behavior where 'disconnect -r' will disconnect drivers
from all devices but it will reconnect all consoles.
If -nc flag is used (e.g. 'disconnect -r -nc') then disconnect drivers
from all devices and don't reconnect consoles.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-09-22 14:17:01 -07:00
Laszlo Ersek 7eb3bb6c55 ShellPkg/UefiHandleParsingLib: fix retval for empty child controller array
The ParseHandleDatabaseForChildControllers() function intends to work like
this:

(1) It allocates a "HandleBufferForReturn" local array that's guaranteed
    to be big enough for all found handles,

(2) it collects the handles, both counting them in the (mandatory)
    "MatchingHandleCount" output parameter, and saving them in the local
    "HandleBufferForReturn" array,

(3) if the caller is not interested in the actual handles, then
    "HandleBufferForReturn" is released,

(4) if the caller is interested in the handles, and we've found some, then
    "HandleBufferForReturn" is passed out through the
    "MatchingHandleBuffer" output parameter,

(5) if the caller is interested in the actual handles, but we've found
    none, then the "MatchingHandleBuffer" output parameter is set to NULL.

The ASSERT() at the end of the function makes this clear, but the
implementation does not conform to (5). Fix it.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Tapan Shah <tapandshah@hpe.com>
Reported-by: Tapan Shah <tapandshah@hpe.com>
Ref: https://tianocore.acgmultimedia.com/show_bug.cgi?id=112
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: Tapan Shah <tapandshah@hpe.com>
2016-09-08 20:43:37 +02:00
Laszlo Ersek b6c5420461 ShellPkg/UefiHandleParsingLib: fix IN/OUT notation in child ctrlr parsing
"MatchingHandleCount" is an output parameter of
ParseHandleDatabaseForChildControllers().

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Tapan Shah <tapandshah@hpe.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: Tapan Shah <tapandshah@hpe.com>
2016-09-08 20:42:28 +02:00
Abdul Lateef Attar 1b3be4a12e ShellPkg: pci -i -_e to print next capability
According to PCI spec the next AER capability is relative to
the beginning of PCI configuration space. Hence substract the
base offset to get the next capability.

"-_e" option is changed from TypeFlag to TypeValue, so that
user can specify individual AER capability to print.
e.g. pci 00 00 01 -i -_e <capability-id>

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>
2016-09-08 09:27:40 -07:00
Dandan Bi c6fc823413 ShellPkg: Add the check of parameter number in "DrvCfg" command
In shell spec, the usage of "Drvcfg" command is: drvcfg [-l XXX] [-c]
[-f <Type>|-v|-s] [DriverHandle [DeviceHandle [ChildHandle]]]
[-i filename] [-o filename]. The parameter number(doesn't include the flags)
cannot exceed 4, now we add this point to check whether using the command
correctly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-09-01 16:38:06 +08:00
Dandan Bi d653d8062e ShellPkg: Add check for "dump" parameter in "bcfg" command
When user uses the command "bcfg driver|boot [dump [-v]]",
the number of command line value parameters (doesn't include the
flag) must be three. We can add this point to check whether using
this command correctly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-09-01 16:38:06 +08:00
Ruiyu Ni 1219c85df4 Revert "ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib"
This reverts commit c0bcd3433f.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-08-25 13:00:47 +08:00
Ruiyu Ni a747bc1eec Revert "ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib"
This reverts commit 0fcf8d4df8.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-08-25 13:00:45 +08:00
Ruiyu Ni 8e16ac3d74 Revert "ShellPkg: Fix echo to support displaying special characters"
This reverts commit 95fc5a8775.
The above commit causes several regression of "echo" command:
1. Double quotes are not being stripped from the final text. UEFI Shell 2.2 section 3.4.5 chops out the quotes.
2. Output redirection is not working as expected. Text is being redirected, but the ‘> …’ text should not be.
3. Inconsistent special character handling.  For example, comments with # seem to be parsed out correctly, but handing of ^ is incorrect.
In summary, ‘echo “You are ^#1” > t.txt’ results in the below content in t.txt:
 “You are ^#1” > t.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-08-25 13:00:42 +08:00
Ruiyu Ni 795c78cf19 ShellPkg/Ls: Handle the case when SearchString is NULL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-08-17 13:44:51 +08:00
Shi, Steven af90df3cb0 ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function
Add EFIAPI in CatPrint library function. Every function which uses
variable list need explicit use EFIAPI to force use MS ABI. This change
is needed to pass CLANG38 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-08-10 12:56:53 +08:00
Shi, Steven ba601bddf8 ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin
Use explicit CopyMem to replace compiler builtin to do the structure
values assignment. This change is needed to pass CLANG38 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-08-10 12:56:37 +08:00
Ruiyu Ni 5aeafb3a25 ShellPkg/ls: Display the correct directory 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>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
2016-08-10 10:17:17 +08:00
Ruiyu Ni 47ec935660 ShellPkg/ls: Fix to support "ls fs0:File.txt"
“ls fs0:\File.txt" can list the file correctly but
when the backslash is removed from colon, the file cannot
be listed.
The patch fixes this issue.

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: Tapan Shah <tapandshah@hpe.com>
2016-08-10 10:17:13 +08:00
Star Zeng f4c6c0fdb6 ShellPkg SmbiosView: Show "SocketDesignation" instead of "Socket" for Type 4
It is to make the info shown more aligned with SMBIOS spec.

Cc: Amy Chan <amy.chan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@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>
Reviewed-by: Amy Chan <amy.chan@intel.com>
2016-08-08 17:00:20 +08:00
Liming Gao 9b7143c904 ShellPkg: Correct files with CRLF line ending
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>
2016-07-29 09:18:12 +08:00
Ruiyu Ni fc41b97f12 ShellPkg/LoadPciRom: Fix the ConnectAll() implementation
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>
2016-07-25 10:20:14 +08:00
Ruiyu Ni 1b0319535b ShellPkg/If: Fix issue to pass static code checker
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>
2016-07-25 10:20:13 +08:00
Ruiyu Ni 94fcb76b61 ShellPkg/UefiHandleParsingLib: Fix issue to pass static code checker
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>
2016-07-25 10:20:13 +08:00
Ruiyu Ni cb9f3a59c3 ShellPkg/DrvDiag: Fix a critical typo bug
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>
2016-07-25 10:20:12 +08:00
Ruiyu Ni 95fc5a8775 ShellPkg: Fix echo to support displaying special characters
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>
2016-07-20 10:28:00 +08:00
Ruiyu Ni 0fcf8d4df8 ShellPkg: Add Shell[Get|Set]RawCmdLine to ShellCommandLib
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-20 10:27:56 +08:00
Ruiyu Ni c0bcd3433f ShellPkg: Move FindFirstCharacter/GetNextParameter to ShellCommandLib
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>
2016-07-20 10:27:51 +08:00
Ruiyu Ni cf041fd799 ShellPkg/UefiShellCommandLib.c: Formalize EOL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-20 10:26:58 +08:00
Ruiyu Ni 9ba25c7db7 ShellPkg: Fix VS2010/2012 build failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2016-07-19 11:12:22 +08:00
Ruiyu Ni e7a5a238c3 ShellPkg/Ping6: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:22 +08:00
Ruiyu Ni a915fea68e ShellPkg/Ifconfig6: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:19 +08:00
Ruiyu Ni eeb9744e56 ShellPkg/UefiShellLib.c: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:16 +08:00
Ruiyu Ni 18bff310aa ShellPkg/IfConfig: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:13 +08:00
Ruiyu Ni 2efafabf41 ShellPkg/UefiShellLib: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:10 +08:00
Ruiyu Ni 28d447f9bd ShellPkg/Mv: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:07 +08:00
Ruiyu Ni 0b34dc1324 ShellPkg/Cp: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:04 +08:00
Ruiyu Ni a34b7c3662 ShellPkg/Cd: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 11:04:00 +08:00
Ruiyu Ni 581c03896c ShellPkg/If: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:53 +08:00
Ruiyu Ni 59b7dbac4e ShellPkg/For: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:48 +08:00
Ruiyu Ni 26ca45a86f ShellPkg/DrvDiag: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:45 +08:00
Ruiyu Ni 58972f5cf7 ShellPkg/DrvCfg: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:42 +08:00
Ruiyu Ni 55b1d63de7 ShellPkg/DevTree: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:38 +08:00
Ruiyu Ni 3e9442a564 ShellPkg/Edit: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:35 +08:00
Ruiyu Ni 20cfed165c ShellPkg/LoadPciRom: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:32 +08:00
Ruiyu Ni aba0ca78c6 ShellPkg/EfiDecompress: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:29 +08:00
Ruiyu Ni ca1b2411f5 ShellPkg/EfiCompress: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:26 +08:00
Ruiyu Ni c87bb070a6 ShellPkg/DMem: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:23 +08:00
Ruiyu Ni 107d05a433 ShellPkg/UefiShellCommandLib.c: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:20 +08:00
Ruiyu Ni 2c7c3b87bf ShellPkg/ConsistMapping.c: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:17 +08:00
Ruiyu Ni 5945813f69 ShellPkg/UefiShellBcfgCommandLib: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:14 +08:00
Ruiyu Ni aa3276c171 ShellPkg/UefiHandleParsingLib.c: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:11 +08:00
Ruiyu Ni d758f80971 ShellPkg/Dp: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-07-18 10:55:08 +08:00
Zhang Lubo e2f5c491d8 ShellPkg: Fix issue about Ifconfig6 -r command.
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>
2016-07-15 14:45:55 +08:00
Ruiyu Ni 664fd5877d Revert "ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'."
This reverts commit ee60bd2b6a and
e36ed7a84b.
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>
2016-07-08 14:54:30 +08:00
Mudusuru, Giri P 1d32246161 ShellPkg: Series of patches to fix typos - apropriate to appropriate
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>
2016-07-07 15:24:24 -07:00
Subramanian, Sriram (EG Servers Platform SW) 80f7a8f5f9 ShellPkg:Ping: Ping command hangs with intermittent packet losses
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>
2016-07-07 08:00:50 -07:00
Thomas Palmer e06a4c0812 Fix GUID dereference
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>
2016-07-06 08:19:54 -07:00
Zhang Lubo dded3ae880 ShellPkg: Update the error prompt for ping6 command.
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>
2016-07-05 16:48:31 +08:00
Laszlo Ersek 42cb906852 ShellPkg: UefiHandleParsingLib: remove tautological comparison
The code being removed in this patch dates back to git commit a405b86d27
(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>
2016-06-30 23:14:29 +02:00
Laszlo Ersek 4a7518d31a ShellPkg: don't call functions with side effects in ASSERT_EFI_ERROR()
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>
2016-06-30 17:27:15 +02:00
Ruiyu Ni 5e32460d80 ShellPkg/UefiHandleParsing: Show handle's loaded image device path
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>
2016-06-21 15:59:26 +08:00
Star Zeng 46213c8eb4 ShellPkg: 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: Jaben Carsey <jaben.carsey@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:26 +08:00
Ruiyu Ni e918029fbc ShellPkg/UefiHandleParsingLib.c: Unify EOL and remove trailing space
The patch doesn't change any code logic.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-06-17 15:43:11 +08:00
Ruiyu Ni 2528e47cb2 ShellPkg: Use ".." to indicate device path is partially displayed
The output of "dh <handle>" originally is like below:
12C: USBIO DevicePath(x0)/Pci(0x14,0x0)/USB(0x6,0x0))

The device path part is very confusing. Use ".." in front of the
partially displayed device path is better and it also aligns to
the example output in Shell spec.
12C: USBIO DevicePath(..)/Pci(0x14,0x0)/USB(0x6,0x0))

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-06-17 15:43:11 +08:00
Fu Siyuan 6987d7aa83 ShellPkg: Fix ARM build failure.
This patch fixes the ARM build failure introduced by
2be45bfe27.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-05-20 14:43:09 +08:00
Qiu Shumin f86a5c3465 ShellPkg/Bcfg: Add support for 'addp' command.
Until now the 'addp' command has been handled in the same way as 'add'.
Just copy the DevicePath starting from the Hard Drive node when 'addp'
is used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
2016-05-20 14:16:49 +08:00
Fu Siyuan 2be45bfe27 ShellPkg: Add argument to set block size for tftp command.
TFTP block size has a big impact on the transmit performance, this patch is to
add new argument [-s <block size>] for shell "tftp" command to configure the
block size for file download.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-05-20 11:30:47 +08:00
Star Zeng d0a23f9f86 ShellPkg UefiDpLib: Delete one comment introduced by 196ccda08f
Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@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: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-05-03 12:42:45 +08:00
Cinnamon Shia 69af847603 ShellPkg/UefiDpLib: Fix the error message "Timer library instance error!"
When executing shell dp command, there is an error message "Timer library
instance error!"

The error message "Timer library instance error!" should be for the case about
duration > EndTimeStamp if CountUp or duration > StartTimeStamp if CountDown.

But if the EndTimeStamp of an entry is not added, it should not the case to catch.

This change fixes the error message "Timer library instance error!" from the
"BdsAttempt" entry which is logged when trying to boot a boot option.

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: Jaben Carsey <jaben.carsey@intel.com>
2016-05-03 12:37:51 +08:00
Qiu Shumin 6d3911d406 ShellPkg: Add NULL pointer check.
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>
2016-04-29 13:23:19 +08:00
Jiaxin Wu 76cd3ffab6 ShellPkg: Enhance ping6 to select the interface automatically
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>
2016-04-29 11:32:35 +08:00
Jiaxin Wu 9ce14ca124 ShellPkg: Enhance ping to select the interface automatically
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>
2016-04-29 11:32:17 +08:00
Samer El-Haj-Mahmoud 21cc5ebf36 ShellPkg: Update smbiosview for latest Type 17 devices
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>
2016-04-28 13:03:26 -07:00
Tapan Shah a5b731e085 ShellPkg: Fix typos and EDK2 coding style issues
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>
2016-04-27 09:29:35 -07:00
Abdul Lateef Attar 262e2d94b6 ShellPkg: Fix pci command for '_e' option
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>
2016-04-27 09:27:39 -07:00
Tapan Shah cf6c1550cb ShellPkg: Enahance 'dh' command to add more protocols decoding support
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>
2016-04-25 09:08:06 -07:00
Qiu Shumin b5e44fbc15 ShellPkg: Support connect a device handle recursively with '-r'.
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>
2016-04-21 09:28:49 +08:00
Jiaxin Wu 0b42d7d8a3 ShellPkg: Update ping command options to sync with Spec
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>
2016-04-19 08:41:21 +08:00
Liming Gao 06ac66ecb6 ShellPkg: Update Guid/Protocol usages in INF files.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-13 14:52:59 +08:00
Qiu Shumin 64ee6ed72a ShellPkg: Fix Shell ASSERT when mv file with cwd is NULL.
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>
2016-04-11 09:33:18 +08:00
Qiu Shumin ac14846aad ShellPkg: Refine the comparisons code in ShellPkg.
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>
2016-03-29 21:46:35 +08:00
Cinnamon Shia 3751a092b6 ShellPkg/UefiDpLib: Fix a memory leak issue in Dp.
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>
2016-03-29 09:16:25 +08:00
Qiu Shumin 5d54bbec2c ShellPkg/UefiHandleParsingLib: Fix GUID reference
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>
2016-03-25 10:06:55 +08:00
Ard Biesheuvel e36ed7a84b ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variable
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>
2016-03-24 07:46:18 +01:00
Tapan Shah 8985d6127a ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management 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>
2016-03-24 11:23:12 +08:00
Qiu Shumin ee60bd2b6a ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.
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>
2016-03-24 10:17:52 +08:00
Qiu Shumin 231ad7d866 ShellPkg: Use DOS format end of line.
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>
2016-03-09 15:30:59 +08:00
Cinnamon Shia 196ccda08f ShellPkg/UefiDpLib: Support execution break
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>
2016-03-08 18:23:53 +08:00
Zhang, Lubo 43ca17532b ShellPkg: Merge Ping6 and Ifconfig6 tools to Shell command.
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>
2016-03-08 15:01:29 +08:00
Samer El-Haj-Mahmoud 2c328aca1d ShellPkg: Fix smbiosview decode of PCIe Extended Capabilities
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>
2016-03-04 11:07:50 -08:00
Jiaxin Wu 913ba15120 ShellPkg: Update 'ifconfig -r' implementation
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>
2016-03-03 15:27:24 +08:00
Jiaxin Wu db54ae0845 ShellPkg: Revert git 'd6cf1af9' fix
'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>
2016-03-02 15:43:58 +08:00
Qiu Shumin fb9dd83225 ShellPkg: Fix unexpected behavior of mouse cursor in Editor.
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>
2016-02-27 14:49:07 +08:00
Qiu Shumin e3b76f3b5e ShellPkg: Do NULL pointer check before the pointer is used.
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>
2016-02-23 10:44:36 +08:00
Qiu Shumin f79d7b62ba ShellPkg: Fix the last command doesn't work in a script.
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>
2016-02-19 15:00:57 +08:00
Cinnamon Shia 64c51ed181 ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.
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>
2016-02-18 09:40:30 +08:00
Jim Dailey 1095b4323d ShellPkg: complete previous incomplete patch
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <Jim_Dailey@Dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-10 13:17:56 -08:00
Jaben Carsey 3a01358bdb Merge branch 'master' of https://github.com/tianocore/edk2 2016-02-10 08:56:33 -08:00
Jim Dailey 2dda8a1232 ShellPkg: ShellFileHandleReadLine must return UCS2 lines.
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>
2016-02-10 08:54:15 -08:00
jaben carsey 9ed21946c7 ShellPkg: Fix ASCII and UNICODE file pipes.
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>
2016-02-09 13:22:14 -08:00
jaben carsey d2a0d2e6ac ShellPkg: Fix ASCII and UNICODE file pipes.
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>
2016-02-08 15:59:04 -08:00
Qiu Shumin aed8c66dac ShellPkg: Refine the code to avoid use a constant number as offset.
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
2016-01-26 08:17:19 +00:00
Laszlo Ersek af3e209f93 ShellPkg: UefiShellBcfgCommandLib: bump VERSION_STRING
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
2016-01-21 18:40:48 +00:00