aboutsummaryrefslogtreecommitdiffstats
path: root/roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c')
-rw-r--r--roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c b/roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c
new file mode 100644
index 000000000..0972454c2
--- /dev/null
+++ b/roms/edk2/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.c
@@ -0,0 +1,48 @@
+/** @file
+ Entrypoint of "tftp" shell standalone application.
+
+ Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include "Tftp.h"
+
+//
+// String token ID of help message text.
+// Shell supports to find help message in the resource section of an application image if
+// .MAN file is not found. This global variable is added to make build tool recognizes
+// that the help string is consumed by user and then build tool will add the string into
+// the resource section. Thus the application can use '-?' option to show help message in
+// Shell.
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_TFTP);
+
+/**
+ Entry point of Tftp standalone application.
+
+ @param ImageHandle The image handle of the process.
+ @param SystemTable The EFI System Table pointer.
+
+ @retval EFI_SUCCESS Tftp command is executed successfully.
+ @retval EFI_ABORTED HII package was failed to initialize.
+ @retval others Other errors when executing tftp command.
+**/
+EFI_STATUS
+EFIAPI
+TftpAppInitialize (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ mTftpHiiHandle = InitializeHiiPackage (ImageHandle);
+ if (mTftpHiiHandle == NULL) {
+ return EFI_ABORTED;
+ }
+
+ Status = (EFI_STATUS)RunTftp (ImageHandle, SystemTable);
+ HiiRemovePackages (mTftpHiiHandle);
+ return Status;
+}