2 Produce "dp" shell dynamic command.
4 Copyright (c) 2017, Intel Corporation. All rights reserved. <BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Protocol/ShellDynamicCommand.h>
19 This is the shell command handler function pointer callback type. This
20 function handles the command when it is invoked in the shell.
22 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
23 @param[in] SystemTable The pointer to the system table.
24 @param[in] ShellParameters The parameters associated with the command.
25 @param[in] Shell The instance of the shell protocol used in the context
26 of processing this command.
28 @return EFI_SUCCESS the operation was sucessful
29 @return other the operation failed.
34 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
35 IN EFI_SYSTEM_TABLE
*SystemTable
,
36 IN EFI_SHELL_PARAMETERS_PROTOCOL
*ShellParameters
,
37 IN EFI_SHELL_PROTOCOL
*Shell
40 gEfiShellParametersProtocol
= ShellParameters
;
41 gEfiShellProtocol
= Shell
;
42 return RunDp (gImageHandle
, SystemTable
);
46 This is the command help handler function pointer callback type. This
47 function is responsible for displaying help information for the associated
50 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
51 @param[in] Language The pointer to the language string to use.
53 @return string Pool allocated help string, must be freed by caller
58 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
59 IN CONST CHAR8
*Language
62 return HiiGetString (mDpHiiHandle
, STRING_TOKEN (STR_GET_HELP_DP
), Language
);
65 EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand
= {
72 Entry point of Tftp Dynamic Command.
74 Produce the DynamicCommand protocol to handle "tftp" command.
76 @param ImageHandle The image handle of the process.
77 @param SystemTable The EFI System Table pointer.
79 @retval EFI_SUCCESS Tftp command is executed sucessfully.
80 @retval EFI_ABORTED HII package was failed to initialize.
81 @retval others Other errors when executing tftp command.
86 IN EFI_HANDLE ImageHandle
,
87 IN EFI_SYSTEM_TABLE
*SystemTable
91 mDpHiiHandle
= InitializeHiiPackage (ImageHandle
);
92 if (mDpHiiHandle
== NULL
) {
96 Status
= gBS
->InstallProtocolInterface (
98 &gEfiShellDynamicCommandProtocolGuid
,
102 ASSERT_EFI_ERROR (Status
);
107 Tftp driver unload handler.
109 @param ImageHandle The image handle of the process.
111 @retval EFI_SUCCESS The image is unloaded.
112 @retval Others Failed to unload the image.
117 IN EFI_HANDLE ImageHandle
121 Status
= gBS
->UninstallProtocolInterface (
123 &gEfiShellDynamicCommandProtocolGuid
,
126 if (EFI_ERROR (Status
)) {
129 HiiRemovePackages (mDpHiiHandle
);