]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
ShellPkg: acpiview: Add GT Frame Number validation to GTDT parser
[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
36extern 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
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
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
149SHELL_STATUS\r
150EFIAPI\r
151ShellCommandRunElse (\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
160typedef\r
161LIST_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
190BOOLEAN\r
a405b86d 191MoveToTag (\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