2 Main file for NULL named library for level 1 shell command functions.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
10 #define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
14 #include <Guid/ShellLibHiiGuid.h>
16 #include <Protocol/Shell.h>
17 #include <Protocol/ShellParameters.h>
18 #include <Protocol/DevicePath.h>
19 #include <Protocol/LoadedImage.h>
20 #include <Protocol/UnicodeCollation.h>
22 #include <Library/BaseLib.h>
23 #include <Library/BaseMemoryLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/ShellCommandLib.h>
28 #include <Library/ShellLib.h>
29 #include <Library/SortLib.h>
30 #include <Library/UefiLib.h>
31 #include <Library/UefiRuntimeServicesTableLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/HiiLib.h>
34 #include <Library/FileHandleLib.h>
36 extern EFI_HANDLE gShellLevel1HiiHandle
;
39 Function for 'stall' command.
41 @param[in] ImageHandle Handle to the Image (NULL if Internal).
42 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
46 ShellCommandRunStall (
47 IN EFI_HANDLE ImageHandle
,
48 IN EFI_SYSTEM_TABLE
*SystemTable
52 Function for 'exit' command.
54 @param[in] ImageHandle Handle to the Image (NULL if Internal).
55 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
60 IN EFI_HANDLE ImageHandle
,
61 IN EFI_SYSTEM_TABLE
*SystemTable
65 Function for 'endif' command.
67 @param[in] ImageHandle Handle to the Image (NULL if Internal).
68 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
72 ShellCommandRunEndIf (
73 IN EFI_HANDLE ImageHandle
,
74 IN EFI_SYSTEM_TABLE
*SystemTable
78 Function for 'for' command.
80 @param[in] ImageHandle Handle to the Image (NULL if Internal).
81 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
86 IN EFI_HANDLE ImageHandle
,
87 IN EFI_SYSTEM_TABLE
*SystemTable
91 Function for 'endfor' command.
93 @param[in] ImageHandle Handle to the Image (NULL if Internal).
94 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
98 ShellCommandRunEndFor (
99 IN EFI_HANDLE ImageHandle
,
100 IN EFI_SYSTEM_TABLE
*SystemTable
104 Function for 'if' command.
106 @param[in] ImageHandle Handle to the Image (NULL if Internal).
107 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
112 IN EFI_HANDLE ImageHandle
,
113 IN EFI_SYSTEM_TABLE
*SystemTable
117 Function for 'goto' command.
119 @param[in] ImageHandle Handle to the Image (NULL if Internal).
120 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
124 ShellCommandRunGoto (
125 IN EFI_HANDLE ImageHandle
,
126 IN EFI_SYSTEM_TABLE
*SystemTable
130 Function for 'shift' command.
132 @param[in] ImageHandle Handle to the Image (NULL if Internal).
133 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
137 ShellCommandRunShift (
138 IN EFI_HANDLE ImageHandle
,
139 IN EFI_SYSTEM_TABLE
*SystemTable
144 Function for 'else' command.
146 @param[in] ImageHandle Handle to the Image (NULL if Internal).
147 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
151 ShellCommandRunElse (
152 IN EFI_HANDLE ImageHandle
,
153 IN EFI_SYSTEM_TABLE
*SystemTable
157 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
158 /// This is used to control the MoveToTag function direction...
162 (EFIAPI
*LIST_MANIP_FUNC
)(
163 IN CONST LIST_ENTRY
*List
,
164 IN CONST LIST_ENTRY
*Node
168 Move the script pointer from 1 tag (line) to another.
170 It functions so that count starts at 1 and it increases or decreases when it
171 hits the specified tags. when it hits zero the location has been found.
173 DecrementerTag and IncrementerTag are used to get around for/endfor and
174 similar paired types where the entire middle should be ignored.
176 If label is used it will be used instead of the count.
178 @param[in] Function The function to use to enumerate through the
179 list. Normally GetNextNode or GetPreviousNode.
180 @param[in] DecrementerTag The tag to decrement the count at.
181 @param[in] IncrementerTag The tag to increment the count at.
182 @param[in] Label A label to look for.
183 @param[in, out] ScriptFile The pointer to the current script file structure.
184 @param[in] MovePast TRUE makes function return 1 past the found
186 @param[in] FindOnly TRUE to not change the ScriptFile.
187 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
192 IN CONST LIST_MANIP_FUNC Function
,
193 IN CONST CHAR16
*DecrementerTag
,
194 IN CONST CHAR16
*IncrementerTag
,
195 IN CONST CHAR16
*Label OPTIONAL
,
196 IN OUT SCRIPT_FILE
*ScriptFile
,
197 IN CONST BOOLEAN MovePast
,
198 IN CONST BOOLEAN FindOnly
,
199 IN CONST BOOLEAN WrapAroundScript