]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Include/Library/ShellCommandLib.h
EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
[mirror_edk2.git] / ShellPkg / Include / Library / ShellCommandLib.h
index 5bc03ce256cc20f45526d95fa068f1621add7cb2..3ee820001e9e92d19da441b5424f5b5742efaee0 100644 (file)
@@ -4,7 +4,9 @@
   This library is for use ONLY by shell commands linked into the shell application.\r
   This library will not funciton if it is used for UEFI Shell 2.0 Applications.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+  (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -24,7 +26,6 @@
 #include <Protocol/EfiShell.h>\r
 #include <Protocol/EfiShellParameters.h>\r
 #include <Protocol/UnicodeCollation.h>\r
-#include <Protocol/DevicePathToText.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
@@ -33,7 +34,6 @@
 // The extern global protocol poionters.\r
 //\r
 extern        EFI_UNICODE_COLLATION_PROTOCOL    *gUnicodeCollation;\r
-extern        EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  *gDevPathToText;\r
 extern        CONST CHAR16*                     SupportLevel[];\r
 \r
 //\r
@@ -159,12 +159,12 @@ ShellCommandRegisterCommandName (
   information is returned. If Sections is NULL, then all help text information\r
   available is returned.\r
 \r
-  @param[in]  CommandString         The pointer to the command name.  This is the name\r
-                                    found on the command line in the shell.\r
-  @param[in,out] RetVal             The pointer to the return value from the command handler.\r
+  @param[in]   CommandString         The pointer to the command name.  This is the name\r
+                                     found on the command line in the shell.\r
+  @param[in, out] RetVal             The pointer to the return value from the command handler.\r
 \r
-  @param[in,out]  CanAffectLE       Indicates whether this command's return value\r
-                                    needs to be placed into LASTERROR environment variable.\r
+  @param[in, out]  CanAffectLE       Indicates whether this command's return value\r
+                                     needs to be placed into LASTERROR environment variable.\r
 \r
   @retval RETURN_SUCCESS            The handler was run.\r
   @retval RETURN_NOT_FOUND          The CommandString did not match a registered\r
@@ -340,11 +340,24 @@ ShellCommandSetEchoState (
   Indicate that the current shell or script should exit.\r
 \r
   @param[in] ScriptOnly   TRUE if exiting a script; FALSE otherwise.\r
+  @param[in] ErrorCode    The 64 bit error code to return.\r
 **/\r
 VOID\r
 EFIAPI\r
 ShellCommandRegisterExit (\r
-  IN BOOLEAN ScriptOnly\r
+  IN BOOLEAN      ScriptOnly,\r
+  IN CONST UINT64 ErrorCode\r
+  );\r
+\r
+/**\r
+  Retrieve the Exit code.\r
+\r
+  @return the value passed into RegisterExit.\r
+**/\r
+UINT64\r
+EFIAPI\r
+ShellCommandGetExitCode (\r
+  VOID\r
   );\r
 \r
 /**\r
@@ -572,6 +585,17 @@ ShellCommandCreateInitialMappingsAndPaths(
   VOID\r
   );\r
 \r
+/**\r
+  Add mappings for any devices without one.  Do not change any existing maps.\r
+\r
+  @retval EFI_SUCCESS   The operation was successful.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellCommandUpdateMapping (\r
+  VOID\r
+  );\r
+\r
 /**\r
   Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.\r
 \r
@@ -662,4 +686,37 @@ FreeBufferList (
   IN BUFFER_LIST *List\r
   );\r
 \r
+/**\r
+  Function printing hex output to the console.\r
+\r
+  @param[in] Indent       Number of spaces to indent.\r
+  @param[in] Offset       Offset to start with.\r
+  @param[in] DataSize     Length of data.\r
+  @param[in] UserData     Pointer to some data.\r
+**/\r
+VOID\r
+DumpHex (\r
+  IN UINTN        Indent,\r
+  IN UINTN        Offset,\r
+  IN UINTN        DataSize,\r
+  IN VOID         *UserData\r
+  );\r
+\r
+/**\r
+  Dump HEX data into buffer.\r
+\r
+  @param[in] Buffer     HEX data to be dumped in Buffer.\r
+  @param[in] Indent     How many spaces to indent the output.\r
+  @param[in] Offset     The offset of the printing.\r
+  @param[in] DataSize   The size in bytes of UserData.\r
+  @param[in] UserData   The data to print out.\r
+**/\r
+CHAR16*\r
+CatSDumpHex (\r
+  IN CHAR16  *Buffer,\r
+  IN UINTN   Indent,\r
+  IN UINTN   Offset,\r
+  IN UINTN   DataSize,\r
+  IN VOID    *UserData\r
+  );\r
 #endif //_SHELL_COMMAND_LIB_\r