]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/AcpiViewApp/AcpiViewApp.c
ShellPkg/AcpiView: Add application wrapper
[mirror_edk2.git] / ShellPkg / Application / AcpiViewApp / AcpiViewApp.c
diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c
new file mode 100644 (file)
index 0000000..2f650c9
--- /dev/null
@@ -0,0 +1,40 @@
+/** @file\r
+  Main file for AcpiViewApp application\r
+\r
+  Copyright (c) 2020, ARM Limited. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/ShellLib.h>\r
+#include <Library/AcpiViewCommandLib.h>\r
+\r
+#include <Protocol/ShellParameters.h>\r
+\r
+//\r
+// String token ID of help message text.\r
+// Shell supports to find help message in the resource section of an application image if\r
+// .MAN file is not found. This global variable is added to make build tool recognizes\r
+// that the help string is consumed by user and then build tool will add the string into\r
+// the resource section. Thus the application can use '-?' option to show help message in\r
+// Shell.\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_ACPIVIEW);\r
+\r
+/**\r
+  Application Entry Point wrapper around the shell command\r
+\r
+  @param[in] ImageHandle  Handle to the Image (NULL if internal).\r
+  @param[in] SystemTable  Pointer to the System Table (NULL if internal).\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AcpiViewAppMain (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  return ShellCommandRunAcpiView (gImageHandle, SystemTable);\r
+}\r