2 Main file for NULL named library for level 1 shell command functions.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <ShellBase.h>
18 #include <Protocol/EfiShell.h>
19 #include <Protocol/EfiShellParameters.h>
20 #include <Protocol/DevicePath.h>
21 #include <Protocol/LoadedImage.h>
22 #include <Protocol/UnicodeCollation.h>
23 #include <Protocol/DevicePathToText.h>
25 #include <Library/BaseLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/ShellCommandLib.h>
31 #include <Library/ShellLib.h>
32 #include <Library/SortLib.h>
33 #include <Library/UefiLib.h>
34 #include <Library/UefiRuntimeServicesTableLib.h>
35 #include <Library/UefiBootServicesTableLib.h>
36 #include <Library/HiiLib.h>
37 #include <Library/FileHandleLib.h>
39 extern EFI_HANDLE gShellLevel1HiiHandle
;
40 extern CONST EFI_GUID gShellLevel1HiiGuid
;
43 Function for 'exit' command.
45 @param[in] ImageHandle Handle to the Image (NULL if Internal).
46 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
51 IN EFI_HANDLE ImageHandle
,
52 IN EFI_SYSTEM_TABLE
*SystemTable
56 Function for 'endif' command.
58 @param[in] ImageHandle Handle to the Image (NULL if Internal).
59 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
63 ShellCommandRunEndIf (
64 IN EFI_HANDLE ImageHandle
,
65 IN EFI_SYSTEM_TABLE
*SystemTable
69 Function for 'for' command.
71 @param[in] ImageHandle Handle to the Image (NULL if Internal).
72 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
77 IN EFI_HANDLE ImageHandle
,
78 IN EFI_SYSTEM_TABLE
*SystemTable
82 Function for 'endfor' command.
84 @param[in] ImageHandle Handle to the Image (NULL if Internal).
85 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
89 ShellCommandRunEndFor (
90 IN EFI_HANDLE ImageHandle
,
91 IN EFI_SYSTEM_TABLE
*SystemTable
95 Function for 'if' command.
97 @param[in] ImageHandle Handle to the Image (NULL if Internal).
98 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
103 IN EFI_HANDLE ImageHandle
,
104 IN EFI_SYSTEM_TABLE
*SystemTable
108 Function for 'goto' command.
110 @param[in] ImageHandle Handle to the Image (NULL if Internal).
111 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
115 ShellCommandRunGoto (
116 IN EFI_HANDLE ImageHandle
,
117 IN EFI_SYSTEM_TABLE
*SystemTable
121 Function for 'shift' command.
123 @param[in] ImageHandle Handle to the Image (NULL if Internal).
124 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
128 ShellCommandRunShift (
129 IN EFI_HANDLE ImageHandle
,
130 IN EFI_SYSTEM_TABLE
*SystemTable
135 Function for 'else' command.
137 @param[in] ImageHandle Handle to the Image (NULL if Internal).
138 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
142 ShellCommandRunElse (
143 IN EFI_HANDLE ImageHandle
,
144 IN EFI_SYSTEM_TABLE
*SystemTable
148 /// Function prototype for BOTH GetNextNode and GetPreviousNode...
149 /// This is used to control the MoveToTag function direction...
153 (EFIAPI
*LIST_MANIP_FUNC
)(
154 IN CONST LIST_ENTRY
*List
,
155 IN CONST LIST_ENTRY
*Node
159 Function to move to a spacified tag in a script file structure.
161 @param[in] Function The pointer to the function to move with.
162 @param[in] DecrementerTag The pointer to a string to decrement upon finding.
163 @param[in] IncrementerTag The pointer to a string to increment upon finding.
164 @param[in] Label A Label to look for.
165 @param[in] ScriptFile The script file structure to look in.
166 @param[in] MovePast TRUE to go to the element just after the found one. FALSE otherwise.
167 @param[in] FindOnly FALSE to change the execution point in the script file structure. TRUE otherwise.
168 @param[in] WrapAroundScript TRUE to go to begining when end is hit, or vise versa. FALSE otherwise.
173 IN CONST LIST_MANIP_FUNC Function
,
174 IN CONST CHAR16
*DecrementerTag
,
175 IN CONST CHAR16
*IncrementerTag
,
176 IN CONST CHAR16
*Label OPTIONAL
,
177 IN SCRIPT_FILE
*ScriptFile
,
178 IN CONST BOOLEAN MovePast
,
179 IN CONST BOOLEAN FindOnly
,
180 IN CONST BOOLEAN WrapAroundScript