]>
Commit | Line | Data |
---|---|---|
a405b86d | 1 | /** @file\r |
2 | Main file for NULL named library for level 1 shell command functions.\r | |
3 | \r | |
4 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include <Uefi.h>\r | |
16 | #include <ShellBase.h>\r | |
17 | \r | |
18 | #include <Protocol/EfiShell.h>\r | |
19 | #include <Protocol/EfiShellParameters.h>\r | |
20 | #include <Protocol/DevicePath.h>\r | |
21 | #include <Protocol/LoadedImage.h>\r | |
22 | #include <Protocol/UnicodeCollation.h>\r | |
23 | #include <Protocol/DevicePathToText.h>\r | |
24 | \r | |
25 | #include <Library/BaseLib.h>\r | |
26 | #include <Library/BaseMemoryLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/PcdLib.h>\r | |
30 | #include <Library/ShellCommandLib.h>\r | |
31 | #include <Library/ShellLib.h>\r | |
32 | #include <Library/SortLib.h>\r | |
33 | #include <Library/UefiLib.h>\r | |
34 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
35 | #include <Library/UefiBootServicesTableLib.h>\r | |
36 | #include <Library/HiiLib.h>\r | |
37 | #include <Library/FileHandleLib.h>\r | |
38 | \r | |
39 | extern EFI_HANDLE gShellLevel1HiiHandle;\r | |
40 | extern CONST EFI_GUID gShellLevel1HiiGuid;\r | |
41 | \r | |
42 | /**\r | |
43 | Function for 'exit' command.\r | |
44 | \r | |
45 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
46 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
47 | **/\r | |
48 | SHELL_STATUS\r | |
49 | EFIAPI\r | |
50 | ShellCommandRunExit (\r | |
51 | IN EFI_HANDLE ImageHandle,\r | |
52 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
53 | );\r | |
54 | \r | |
55 | /**\r | |
56 | Function for 'endif' command.\r | |
57 | \r | |
58 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
59 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
60 | **/\r | |
61 | SHELL_STATUS\r | |
62 | EFIAPI\r | |
63 | ShellCommandRunEndIf (\r | |
64 | IN EFI_HANDLE ImageHandle,\r | |
65 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
66 | );\r | |
67 | \r | |
68 | /**\r | |
69 | Function for 'for' command.\r | |
70 | \r | |
71 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
72 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
73 | **/\r | |
74 | SHELL_STATUS\r | |
75 | EFIAPI\r | |
76 | ShellCommandRunFor (\r | |
77 | IN EFI_HANDLE ImageHandle,\r | |
78 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
79 | );\r | |
80 | \r | |
81 | /**\r | |
82 | Function for 'endfor' command.\r | |
83 | \r | |
84 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
85 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
86 | **/\r | |
87 | SHELL_STATUS\r | |
88 | EFIAPI\r | |
89 | ShellCommandRunEndFor (\r | |
90 | IN EFI_HANDLE ImageHandle,\r | |
91 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
92 | );\r | |
93 | \r | |
94 | /**\r | |
95 | Function for 'if' command.\r | |
96 | \r | |
97 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
98 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
99 | **/\r | |
100 | SHELL_STATUS\r | |
101 | EFIAPI\r | |
102 | ShellCommandRunIf (\r | |
103 | IN EFI_HANDLE ImageHandle,\r | |
104 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
105 | );\r | |
106 | \r | |
107 | /**\r | |
108 | Function for 'goto' command.\r | |
109 | \r | |
110 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
111 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
112 | **/\r | |
113 | SHELL_STATUS\r | |
114 | EFIAPI\r | |
115 | ShellCommandRunGoto (\r | |
116 | IN EFI_HANDLE ImageHandle,\r | |
117 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
118 | );\r | |
119 | \r | |
120 | /**\r | |
121 | Function for 'shift' command.\r | |
122 | \r | |
123 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
124 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
125 | **/\r | |
126 | SHELL_STATUS\r | |
127 | EFIAPI\r | |
128 | ShellCommandRunShift (\r | |
129 | IN EFI_HANDLE ImageHandle,\r | |
130 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
131 | );\r | |
132 | \r | |
133 | \r | |
134 | /**\r | |
135 | Function for 'else' command.\r | |
136 | \r | |
137 | @param[in] ImageHandle Handle to the Image (NULL if Internal).\r | |
138 | @param[in] SystemTable Pointer to the System Table (NULL if Internal).\r | |
139 | **/\r | |
140 | SHELL_STATUS\r | |
141 | EFIAPI\r | |
142 | ShellCommandRunElse (\r | |
143 | IN EFI_HANDLE ImageHandle,\r | |
144 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
145 | );\r | |
146 | \r | |
147 | ///\r | |
148 | /// Function prototype for BOTH GetNextNode and GetPreviousNode...\r | |
149 | /// This is used to control the MoveToTag function direction...\r | |
150 | ///\r | |
151 | typedef\r | |
152 | LIST_ENTRY *\r | |
153 | (EFIAPI *LIST_MANIP_FUNC)(\r | |
154 | IN CONST LIST_ENTRY *List,\r | |
155 | IN CONST LIST_ENTRY *Node\r | |
156 | );\r | |
157 | \r | |
158 | /**\r | |
159 | Function to move to a spacified tag in a script file structure.\r | |
160 | \r | |
161 | @param[in] Function The pointer to the function to move with.\r | |
162 | @param[in] DecrementerTag The pointer to a string to decrement upon finding.\r | |
163 | @param[in] IncrementerTag The pointer to a string to increment upon finding.\r | |
164 | @param[in] Label A Label to look for.\r | |
165 | @param[in] ScriptFile The script file structure to look in.\r | |
166 | @param[in] MovePast TRUE to go to the element just after the found one. FALSE otherwise.\r | |
167 | @param[in] FindOnly FALSE to change the execution point in the script file structure. TRUE otherwise.\r | |
168 | @param[in] WrapAroundScript TRUE to go to begining when end is hit, or vise versa. FALSE otherwise.\r | |
169 | **/\r | |
170 | BOOLEAN\r | |
171 | EFIAPI\r | |
172 | MoveToTag (\r | |
173 | IN CONST LIST_MANIP_FUNC Function,\r | |
174 | IN CONST CHAR16 *DecrementerTag,\r | |
175 | IN CONST CHAR16 *IncrementerTag,\r | |
176 | IN CONST CHAR16 *Label OPTIONAL,\r | |
177 | IN SCRIPT_FILE *ScriptFile,\r | |
178 | IN CONST BOOLEAN MovePast,\r | |
179 | IN CONST BOOLEAN FindOnly,\r | |
180 | IN CONST BOOLEAN WrapAroundScript\r | |
181 | );\r | |
182 | \r |