2 Produce "dp" shell dynamic command.
4 Copyright (c) 2017, Intel Corporation. All rights reserved. <BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Protocol/ShellDynamicCommand.h>
13 This is the shell command handler function pointer callback type. This
14 function handles the command when it is invoked in the shell.
16 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
17 @param[in] SystemTable The pointer to the system table.
18 @param[in] ShellParameters The parameters associated with the command.
19 @param[in] Shell The instance of the shell protocol used in the context
20 of processing this command.
22 @return EFI_SUCCESS the operation was successful
23 @return other the operation failed.
28 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
29 IN EFI_SYSTEM_TABLE
*SystemTable
,
30 IN EFI_SHELL_PARAMETERS_PROTOCOL
*ShellParameters
,
31 IN EFI_SHELL_PROTOCOL
*Shell
34 gEfiShellParametersProtocol
= ShellParameters
;
35 gEfiShellProtocol
= Shell
;
36 return RunDp (gImageHandle
, SystemTable
);
40 This is the command help handler function pointer callback type. This
41 function is responsible for displaying help information for the associated
44 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
45 @param[in] Language The pointer to the language string to use.
47 @return string Pool allocated help string, must be freed by caller
52 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
53 IN CONST CHAR8
*Language
56 return HiiGetString (mDpHiiHandle
, STRING_TOKEN (STR_GET_HELP_DP
), Language
);
59 EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand
= {
66 Entry point of Tftp Dynamic Command.
68 Produce the DynamicCommand protocol to handle "tftp" command.
70 @param ImageHandle The image handle of the process.
71 @param SystemTable The EFI System Table pointer.
73 @retval EFI_SUCCESS Tftp command is executed successfully.
74 @retval EFI_ABORTED HII package was failed to initialize.
75 @retval others Other errors when executing tftp command.
80 IN EFI_HANDLE ImageHandle
,
81 IN EFI_SYSTEM_TABLE
*SystemTable
86 mDpHiiHandle
= InitializeHiiPackage (ImageHandle
);
87 if (mDpHiiHandle
== NULL
) {
91 Status
= gBS
->InstallProtocolInterface (
93 &gEfiShellDynamicCommandProtocolGuid
,
97 ASSERT_EFI_ERROR (Status
);
102 Tftp driver unload handler.
104 @param ImageHandle The image handle of the process.
106 @retval EFI_SUCCESS The image is unloaded.
107 @retval Others Failed to unload the image.
112 IN EFI_HANDLE ImageHandle
117 Status
= gBS
->UninstallProtocolInterface (
119 &gEfiShellDynamicCommandProtocolGuid
,
122 if (EFI_ERROR (Status
)) {
126 HiiRemovePackages (mDpHiiHandle
);