]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Add new dynamic command protocol
authorJaben Carsey <jaben.carsey@intel.com>
Thu, 31 Jul 2014 18:07:43 +0000 (18:07 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 31 Jul 2014 18:07:43 +0000 (18:07 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15731 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Include/Protocol/EfiShellDynamicCommand.h [new file with mode: 0644]
ShellPkg/ShellPkg.dec

diff --git a/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h b/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
new file mode 100644 (file)
index 0000000..713f5df
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+  EFI Shell Dynamic Command registration protocol\r
+\r
+  Copyright (c) 2012 Hewlett-Packard Company. All rights reserved.<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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__\r
+#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__\r
+\r
+#include <ShellBase.h>\r
+#include <Protocol/EfiShellParameters.h>\r
+#include <Protocol/EfiShell.h>\r
+\r
+\r
+// {0CD3258C-D677-4fcc-B343-934D30983888}\r
+#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \\r
+  { \\r
+  0xcd3258c, 0xd677, 0x4fcc, { 0xb3, 0x43, 0x93, 0x4d, 0x30, 0x98, 0x38, 0x88 } \\r
+  }\r
+\r
+\r
+//\r
+// Define for forward reference.\r
+//\r
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;\r
+\r
+\r
+/**\r
+  This is the shell command handler function pointer callback type.  This\r
+  function handles the command when it is invoked in the shell.\r
+\r
+  @param[in] This                   The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.\r
+  @param[in] SystemTable            The pointer to the system table.\r
+  @param[in] ShellParameters        The parameters associated with the command.\r
+  @param[in] Shell                  The instance of the shell protocol used in the context\r
+                                    of processing this command.\r
+\r
+  @return EFI_SUCCESS               the operation was sucessful\r
+  @return other                     the operation failed.\r
+**/\r
+typedef\r
+SHELL_STATUS\r
+(EFIAPI * SHELL_COMMAND_HANDLER)(\r
+  IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL    *This,\r
+  IN EFI_SYSTEM_TABLE                      *SystemTable,\r
+  IN EFI_SHELL_PARAMETERS_PROTOCOL         *ShellParameters,\r
+  IN EFI_SHELL_PROTOCOL                    *Shell\r
+  );\r
+\r
+/**\r
+  This is the command help handler function pointer callback type.  This\r
+  function is responsible for displaying help information for the associated\r
+  command.\r
+\r
+  @param[in] This                   The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.\r
+  @param[in] Language               The pointer to the language string to use.\r
+\r
+  @return string                    Pool allocated help string, must be freed by caller\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI * SHELL_COMMAND_GETHELP)(\r
+  IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL    *This,\r
+  IN CONST CHAR8                           *Language\r
+  );\r
+\r
+/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.\r
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {\r
+  \r
+  CONST CHAR16           *CommandName;\r
+  SHELL_COMMAND_HANDLER  Handler;\r
+  SHELL_COMMAND_GETHELP  GetHelp;\r
+\r
+} EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;\r
+\r
+#endif\r
index 3d0f5c296de1445dd12e24c25720aae1d1ede905..c20440a7f4681cd296132594cf03cb8c9cddbc2c 100644 (file)
@@ -3,7 +3,7 @@
 # This Package provides all definitions for EFI and UEFI Shell\r
 #\r
 # Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available under\r
 # the terms and conditions of the BSD License which accompanies this distribution.\r
   gShellNetwork1HiiGuid           = {0xf3d301bb, 0xf4a5, 0x45a8, {0xb0, 0xb7, 0xfa, 0x99, 0x9c, 0x62, 0x37, 0xae}}\r
 \r
 [Protocols]\r
-  gEfiShellProtocolGuid           = {0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e}}\r
-  gEfiShellParametersProtocolGuid = {0x752f3136, 0x4e16, 0x4fdc, {0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca}}\r
-  gEfiShellEnvironment2Guid       = {0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}\r
-  gEfiShellInterfaceGuid          = {0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}\r
+  gEfiShellProtocolGuid               = {0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e}}\r
+  gEfiShellParametersProtocolGuid     = {0x752f3136, 0x4e16, 0x4fdc, {0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca}}\r
+  gEfiShellEnvironment2Guid           = {0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}\r
+  gEfiShellInterfaceGuid              = {0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}\r
+  gEfiShellDynamicCommandProtocolGuid = {0xcd3258c, 0xd677, 0x4fcc, { 0xb3, 0x43, 0x93, 0x4d, 0x30, 0x98, 0x38, 0x88}}\r
 \r
 [PcdsFeatureFlag]\r
   ## This flag is used to control whether the shell includes NT32 platform Guids\r