]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / UefiShellLevel1CommandsLib.h
CommitLineData
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
47d20b54 36extern EFI_HII_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
44SHELL_STATUS\r
45EFIAPI\r
46ShellCommandRunStall (\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
57SHELL_STATUS\r
58EFIAPI\r
59ShellCommandRunExit (\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
70SHELL_STATUS\r
71EFIAPI\r
72ShellCommandRunEndIf (\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
83SHELL_STATUS\r
84EFIAPI\r
85ShellCommandRunFor (\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
96SHELL_STATUS\r
97EFIAPI\r
98ShellCommandRunEndFor (\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
109SHELL_STATUS\r
110EFIAPI\r
111ShellCommandRunIf (\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
122SHELL_STATUS\r
123EFIAPI\r
124ShellCommandRunGoto (\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
135SHELL_STATUS\r
136EFIAPI\r
137ShellCommandRunShift (\r
138 IN EFI_HANDLE ImageHandle,\r
139 IN EFI_SYSTEM_TABLE *SystemTable\r
140 );\r
141\r
a405b86d 142/**\r
143 Function for 'else' command.\r
144\r
145 @param[in] ImageHandle Handle to the Image (NULL if Internal).\r
146 @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
147**/\r
148SHELL_STATUS\r
149EFIAPI\r
150ShellCommandRunElse (\r
151 IN EFI_HANDLE ImageHandle,\r
152 IN EFI_SYSTEM_TABLE *SystemTable\r
153 );\r
154\r
155///\r
156/// Function prototype for BOTH GetNextNode and GetPreviousNode...\r
157/// This is used to control the MoveToTag function direction...\r
158///\r
159typedef\r
160LIST_ENTRY *\r
161(EFIAPI *LIST_MANIP_FUNC)(\r
162 IN CONST LIST_ENTRY *List,\r
163 IN CONST LIST_ENTRY *Node\r
164 );\r
165\r
166/**\r
77dcec12 167 Move the script pointer from 1 tag (line) to another.\r
168\r
169 It functions so that count starts at 1 and it increases or decreases when it\r
170 hits the specified tags. when it hits zero the location has been found.\r
171\r
ba0014b9 172 DecrementerTag and IncrementerTag are used to get around for/endfor and\r
77dcec12 173 similar paired types where the entire middle should be ignored.\r
174\r
175 If label is used it will be used instead of the count.\r
176\r
ba0014b9 177 @param[in] Function The function to use to enumerate through the\r
4ff7e37b
ED
178 list. Normally GetNextNode or GetPreviousNode.\r
179 @param[in] DecrementerTag The tag to decrement the count at.\r
180 @param[in] IncrementerTag The tag to increment the count at.\r
181 @param[in] Label A label to look for.\r
182 @param[in, out] ScriptFile The pointer to the current script file structure.\r
ba0014b9 183 @param[in] MovePast TRUE makes function return 1 past the found\r
4ff7e37b
ED
184 location.\r
185 @param[in] FindOnly TRUE to not change the ScriptFile.\r
ba0014b9 186 @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in\r
4ff7e37b 187 searching.\r
a405b86d 188**/\r
189BOOLEAN\r
a405b86d 190MoveToTag (\r
47d20b54
MK
191 IN CONST LIST_MANIP_FUNC Function,\r
192 IN CONST CHAR16 *DecrementerTag,\r
193 IN CONST CHAR16 *IncrementerTag,\r
194 IN CONST CHAR16 *Label OPTIONAL,\r
195 IN OUT SCRIPT_FILE *ScriptFile,\r
196 IN CONST BOOLEAN MovePast,\r
197 IN CONST BOOLEAN FindOnly,\r
198 IN CONST BOOLEAN WrapAroundScript\r
a405b86d 199 );\r
200\r
77dcec12 201#endif\r