Commit | Line | Data |
---|---|---|
09610023 RN |
1 | /** @file\r |
2 | Entrypoint of "tftp" shell standalone application.\r | |
3 | \r | |
4 | Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>\r | |
5 | Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>\r | |
6 | \r | |
56ba3746 | 7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
09610023 RN |
8 | \r |
9 | **/\r | |
10 | #include "Tftp.h"\r | |
11 | \r | |
12 | //\r | |
13 | // String token ID of help message text.\r | |
14 | // Shell supports to find help message in the resource section of an application image if\r | |
15 | // .MAN file is not found. This global variable is added to make build tool recognizes\r | |
16 | // that the help string is consumed by user and then build tool will add the string into\r | |
17 | // the resource section. Thus the application can use '-?' option to show help message in\r | |
18 | // Shell.\r | |
19 | //\r | |
47d20b54 | 20 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_TFTP);\r |
09610023 RN |
21 | \r |
22 | /**\r | |
23 | Entry point of Tftp standalone application.\r | |
24 | \r | |
25 | @param ImageHandle The image handle of the process.\r | |
26 | @param SystemTable The EFI System Table pointer.\r | |
27 | \r | |
f16bd394 | 28 | @retval EFI_SUCCESS Tftp command is executed successfully.\r |
09610023 RN |
29 | @retval EFI_ABORTED HII package was failed to initialize.\r |
30 | @retval others Other errors when executing tftp command.\r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | TftpAppInitialize (\r | |
47d20b54 MK |
35 | IN EFI_HANDLE ImageHandle,\r |
36 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
09610023 RN |
37 | )\r |
38 | {\r | |
47d20b54 MK |
39 | EFI_STATUS Status;\r |
40 | \r | |
09610023 RN |
41 | mTftpHiiHandle = InitializeHiiPackage (ImageHandle);\r |
42 | if (mTftpHiiHandle == NULL) {\r | |
43 | return EFI_ABORTED;\r | |
44 | }\r | |
45 | \r | |
46 | Status = (EFI_STATUS)RunTftp (ImageHandle, SystemTable);\r | |
47 | HiiRemovePackages (mTftpHiiHandle);\r | |
48 | return Status;\r | |
49 | }\r |