1 | /** @file
|
---|
2 | EFI Shell Dynamic Command registration protocol
|
---|
3 |
|
---|
4 | (C) Copyright 2012-2014 Hewlett-Packard Development Company, L.P.<BR>
|
---|
5 | Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
|
---|
11 | #define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_H__
|
---|
12 |
|
---|
13 | #include <Protocol/Shell.h>
|
---|
14 | #include <Protocol/ShellParameters.h>
|
---|
15 |
|
---|
16 | // {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
|
---|
17 | #define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
|
---|
18 | { \
|
---|
19 | 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 } \
|
---|
20 | }
|
---|
21 |
|
---|
22 | //
|
---|
23 | // Define for forward reference.
|
---|
24 | //
|
---|
25 | typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | This is the shell command handler function pointer callback type. This
|
---|
29 | function handles the command when it is invoked in the shell.
|
---|
30 |
|
---|
31 | @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
|
---|
32 | @param[in] SystemTable The pointer to the system table.
|
---|
33 | @param[in] ShellParameters The parameters associated with the command.
|
---|
34 | @param[in] Shell The instance of the shell protocol used in the context
|
---|
35 | of processing this command.
|
---|
36 |
|
---|
37 | @return EFI_SUCCESS the operation was sucessful
|
---|
38 | @return other the operation failed.
|
---|
39 | **/
|
---|
40 | typedef
|
---|
41 | SHELL_STATUS
|
---|
42 | (EFIAPI *SHELL_COMMAND_HANDLER)(
|
---|
43 | IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
---|
44 | IN EFI_SYSTEM_TABLE *SystemTable,
|
---|
45 | IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
|
---|
46 | IN EFI_SHELL_PROTOCOL *Shell
|
---|
47 | );
|
---|
48 |
|
---|
49 | /**
|
---|
50 | This is the command help handler function pointer callback type. This
|
---|
51 | function is responsible for displaying help information for the associated
|
---|
52 | command.
|
---|
53 |
|
---|
54 | @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
|
---|
55 | @param[in] Language The pointer to the language string to use.
|
---|
56 |
|
---|
57 | @return string Pool allocated help string, must be freed by caller
|
---|
58 | **/
|
---|
59 | typedef
|
---|
60 | CHAR16 *
|
---|
61 | (EFIAPI *SHELL_COMMAND_GETHELP)(
|
---|
62 | IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
|
---|
63 | IN CONST CHAR8 *Language
|
---|
64 | );
|
---|
65 |
|
---|
66 | /// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
|
---|
67 | struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
|
---|
68 | CONST CHAR16 *CommandName;
|
---|
69 | SHELL_COMMAND_HANDLER Handler;
|
---|
70 | SHELL_COMMAND_GETHELP GetHelp;
|
---|
71 | };
|
---|
72 |
|
---|
73 | extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
|
---|
74 |
|
---|
75 | #endif
|
---|