]>
Commit | Line | Data |
---|---|---|
a405b86d | 1 | /** @file\r |
2 | Main file for NULL named library for level 1 shell command functions.\r | |
3 | \r | |
ba0014b9 | 4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
56ba3746 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
a405b86d | 6 | \r |
7 | **/\r | |
8 | \r | |
a1d4bfcc | 9 | #ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r |
77dcec12 | 10 | #define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_\r |
11 | \r | |
a405b86d | 12 | #include <Uefi.h>\r |
a405b86d | 13 | \r |
bca163ff LG |
14 | #include <Guid/ShellLibHiiGuid.h>\r |
15 | \r | |
28165f24 RN |
16 | #include <Protocol/Shell.h>\r |
17 | #include <Protocol/ShellParameters.h>\r | |
a405b86d | 18 | #include <Protocol/DevicePath.h>\r |
19 | #include <Protocol/LoadedImage.h>\r | |
20 | #include <Protocol/UnicodeCollation.h>\r | |
a405b86d | 21 | \r |
22 | #include <Library/BaseLib.h>\r | |
23 | #include <Library/BaseMemoryLib.h>\r | |
24 | #include <Library/DebugLib.h>\r | |
25 | #include <Library/MemoryAllocationLib.h>\r | |
26 | #include <Library/PcdLib.h>\r | |
27 | #include <Library/ShellCommandLib.h>\r | |
28 | #include <Library/ShellLib.h>\r | |
29 | #include <Library/SortLib.h>\r | |
30 | #include <Library/UefiLib.h>\r | |
31 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
33 | #include <Library/HiiLib.h>\r | |
34 | #include <Library/FileHandleLib.h>\r | |
35 | \r | |
36 | extern EFI_HANDLE gShellLevel1HiiHandle;\r | |
a405b86d | 37 | \r |
77dcec12 | 38 | /**\r |
39 | Function for 'stall' command.\r | |
40 | \r | |
41 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
42 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
43 | **/\r | |
44 | SHELL_STATUS\r | |
45 | EFIAPI\r | |
46 | ShellCommandRunStall (\r | |
47 | IN EFI_HANDLE ImageHandle,\r | |
48 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
49 | );\r | |
50 | \r | |
a405b86d | 51 | /**\r |
52 | Function for 'exit' command.\r | |
53 | \r | |
54 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
55 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
56 | **/\r | |
57 | SHELL_STATUS\r | |
58 | EFIAPI\r | |
59 | ShellCommandRunExit (\r | |
60 | IN EFI_HANDLE ImageHandle,\r | |
61 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | Function for 'endif' command.\r | |
66 | \r | |
67 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
68 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
69 | **/\r | |
70 | SHELL_STATUS\r | |
71 | EFIAPI\r | |
72 | ShellCommandRunEndIf (\r | |
73 | IN EFI_HANDLE ImageHandle,\r | |
74 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
75 | );\r | |
76 | \r | |
77 | /**\r | |
78 | Function for 'for' command.\r | |
79 | \r | |
80 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
81 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
82 | **/\r | |
83 | SHELL_STATUS\r | |
84 | EFIAPI\r | |
85 | ShellCommandRunFor (\r | |
86 | IN EFI_HANDLE ImageHandle,\r | |
87 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
91 | Function for 'endfor' command.\r | |
92 | \r | |
93 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
94 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
95 | **/\r | |
96 | SHELL_STATUS\r | |
97 | EFIAPI\r | |
98 | ShellCommandRunEndFor (\r | |
99 | IN EFI_HANDLE ImageHandle,\r | |
100 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
101 | );\r | |
102 | \r | |
103 | /**\r | |
104 | Function for 'if' command.\r | |
105 | \r | |
106 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
107 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
108 | **/\r | |
109 | SHELL_STATUS\r | |
110 | EFIAPI\r | |
111 | ShellCommandRunIf (\r | |
112 | IN EFI_HANDLE ImageHandle,\r | |
113 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
114 | );\r | |
115 | \r | |
116 | /**\r | |
117 | Function for 'goto' command.\r | |
118 | \r | |
119 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
120 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
121 | **/\r | |
122 | SHELL_STATUS\r | |
123 | EFIAPI\r | |
124 | ShellCommandRunGoto (\r | |
125 | IN EFI_HANDLE ImageHandle,\r | |
126 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
127 | );\r | |
128 | \r | |
129 | /**\r | |
130 | Function for 'shift' command.\r | |
131 | \r | |
132 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
133 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
134 | **/\r | |
135 | SHELL_STATUS\r | |
136 | EFIAPI\r | |
137 | ShellCommandRunShift (\r | |
138 | IN EFI_HANDLE ImageHandle,\r | |
139 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
140 | );\r | |
141 | \r | |
142 | \r | |
143 | /**\r | |
144 | Function for 'else' command.\r | |
145 | \r | |
146 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
147 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
148 | **/\r | |
149 | SHELL_STATUS\r | |
150 | EFIAPI\r | |
151 | ShellCommandRunElse (\r | |
152 | IN EFI_HANDLE ImageHandle,\r | |
153 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
154 | );\r | |
155 | \r | |
156 | ///\r | |
157 | /// Function prototype for BOTH GetNextNode and GetPreviousNode...\r | |
158 | /// This is used to control the MoveToTag function direction...\r | |
159 | ///\r | |
160 | typedef\r | |
161 | LIST_ENTRY *\r | |
162 | (EFIAPI *LIST_MANIP_FUNC)(\r | |
163 | IN CONST LIST_ENTRY *List,\r | |
164 | IN CONST LIST_ENTRY *Node\r | |
165 | );\r | |
166 | \r | |
167 | /**\r | |
77dcec12 | 168 | Move the script pointer from 1 tag (line) to another.\r |
169 | \r | |
170 | It functions so that count starts at 1 and it increases or decreases when it\r | |
171 | hits the specified tags. when it hits zero the location has been found.\r | |
172 | \r | |
ba0014b9 | 173 | DecrementerTag and IncrementerTag are used to get around for/endfor and\r |
77dcec12 | 174 | similar paired types where the entire middle should be ignored.\r |
175 | \r | |
176 | If label is used it will be used instead of the count.\r | |
177 | \r | |
ba0014b9 | 178 | @param[in] Function The function to use to enumerate through the\r |
4ff7e37b ED |
179 | list. Normally GetNextNode or GetPreviousNode.\r |
180 | @param[in] DecrementerTag The tag to decrement the count at.\r | |
181 | @param[in] IncrementerTag The tag to increment the count at.\r | |
182 | @param[in] Label A label to look for.\r | |
183 | @param[in, out] ScriptFile The pointer to the current script file structure.\r | |
ba0014b9 | 184 | @param[in] MovePast TRUE makes function return 1 past the found\r |
4ff7e37b ED |
185 | location.\r |
186 | @param[in] FindOnly TRUE to not change the ScriptFile.\r | |
ba0014b9 | 187 | @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in\r |
4ff7e37b | 188 | searching.\r |
a405b86d | 189 | **/\r |
190 | BOOLEAN\r | |
a405b86d | 191 | MoveToTag (\r |
192 | IN CONST LIST_MANIP_FUNC Function,\r | |
193 | IN CONST CHAR16 *DecrementerTag,\r | |
194 | IN CONST CHAR16 *IncrementerTag,\r | |
195 | IN CONST CHAR16 *Label OPTIONAL,\r | |
77dcec12 | 196 | IN OUT SCRIPT_FILE *ScriptFile,\r |
a405b86d | 197 | IN CONST BOOLEAN MovePast,\r |
198 | IN CONST BOOLEAN FindOnly,\r | |
199 | IN CONST BOOLEAN WrapAroundScript\r | |
200 | );\r | |
201 | \r | |
77dcec12 | 202 | #endif\r |
203 | \r |