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