]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.h
ArmPlatformPkg/ArmShellCmdRunAxf: Added 'runaxf' cmd to shell
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmShellCmdRunAxf / ArmShellCmdRunAxf.h
diff --git a/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.h b/ArmPlatformPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.h
new file mode 100644 (file)
index 0000000..8599961
--- /dev/null
@@ -0,0 +1,85 @@
+/** @file\r
+*\r
+*  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>\r
+*\r
+*  This program and the accompanying materials are licensed and made available\r
+*  under the terms and conditions of the BSD License which accompanies this\r
+*  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 __ARM_SHELL_CMD_RUNAXF__\r
+#define __ARM_SHELL_CMD_RUNAXF__\r
+\r
+#include <ShellBase.h>\r
+\r
+#include <Protocol/EfiShell.h>\r
+#include <Protocol/EfiShellDynamicCommand.h>\r
+\r
+#include <Library/HiiLib.h>\r
+#include <Library/ShellLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
+extern EFI_GUID      gRunAxfHiiGuid;\r
+extern EFI_HANDLE    gRunAxfHiiHandle;\r
+extern EFI_HANDLE    gRunAxfImageHandle;\r
+\r
+// List of data segments to load to memory from AXF/ELF file.\r
+typedef struct {\r
+  LIST_ENTRY  Link;       // This attribute must be the first entry of this\r
+                          // structure (to avoid pointer computation)\r
+  UINTN       MemOffset;  // Where the data should go, Dest\r
+  UINTN       FileOffset; // Where the data is from, Src\r
+  BOOLEAN     Zeroes;     // A section of Zeroes. Like .bss in ELF\r
+  UINTN       Length;     // Number of bytes.\r
+} RUNAXF_LOAD_LIST;\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\r
+                              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\r
+                              context of processing this command.\r
+\r
+  @return EFI_SUCCESS         The operation was successful.\r
+  @return other               The operation failed.\r
+**/\r
+SHELL_STATUS\r
+EFIAPI\r
+ShellDynCmdRunAxfHandler (\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
+/**\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\r
+                              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\r
+                              caller.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+ShellDynCmdRunAxfGetHelp (\r
+  IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL    *This,\r
+  IN CONST CHAR8                           *Language\r
+  );\r
+\r
+#endif //__ARM_SHELL_CMD_RUNAXF__\r