TianoCore EDK2 master
Loading...
Searching...
No Matches
Shell.h
Go to the documentation of this file.
1
10#ifndef _SHELL_INTERNAL_HEADER_
11#define _SHELL_INTERNAL_HEADER_
12
13#include <Uefi.h>
14
16#include <Guid/ShellAliasGuid.h>
17
20#include <Protocol/Shell.h>
24#include <Protocol/BlockIo.h>
26
27#include <Library/BaseLib.h>
29#include <Library/UefiLib.h>
30#include <Library/DebugLib.h>
37#include <Library/PcdLib.h>
38#include <Library/ShellLib.h>
39#include <Library/SortLib.h>
40#include <Library/HiiLib.h>
41#include <Library/PrintLib.h>
45
47#include "ShellProtocol.h"
48#include "ShellEnvVar.h"
49#include "ConsoleLogger.h"
50#include "ShellManParser.h"
51#include "ConsoleWrappers.h"
52#include "FileHandleWrappers.h"
53
54extern CONST CHAR16 mNoNestingEnvVarName[];
55extern CONST CHAR16 mNoNestingTrue[];
56extern CONST CHAR16 mNoNestingFalse[];
57
58typedef struct {
60 SHELL_FILE_HANDLE SplitStdOut;
61 SHELL_FILE_HANDLE SplitStdIn;
63
64typedef struct {
65 UINT32 Startup : 1;
66 UINT32 NoStartup : 1;
67 UINT32 NoConsoleOut : 1;
68 UINT32 NoConsoleIn : 1;
69 UINT32 NoInterrupt : 1;
70 UINT32 NoMap : 1;
71 UINT32 NoVersion : 1;
72 UINT32 Delay : 1;
73 UINT32 Exit : 1;
74 UINT32 NoNest : 1;
75 UINT32 Reserved : 7;
77
78typedef union {
79 SHELL_BITS Bits;
80 UINT16 AllBits;
82
83typedef struct {
84 SHELL_BIT_UNION BitUnion;
86 CHAR16 *FileName;
87 CHAR16 *FileOptions;
89
90typedef struct {
91 BUFFER_LIST CommandHistory;
92 UINTN VisibleRowNumber;
93 UINTN OriginalVisibleRowNumber;
94 BOOLEAN InsertMode;
96
97typedef struct {
98 EFI_SHELL_PARAMETERS_PROTOCOL *NewShellParametersProtocol;
99 EFI_SHELL_PROTOCOL *NewEfiShellProtocol;
100 BOOLEAN PageBreakEnabled;
101 BOOLEAN RootShellInstance;
102 SHELL_INIT_SETTINGS ShellInitSettings;
104 SHELL_VIEWING_SETTINGS ViewingSettings;
122 BOOLEAN HaltOutput;
123} SHELL_INFO;
124
125#pragma pack(1)
129typedef struct {
130 VENDOR_DEVICE_PATH VendorDevicePath;
133#pragma pack()
134
135extern SHELL_INFO ShellInfoObject;
136
148 IN OUT CHAR16 **CmdLine
149 );
150
158 IN CONST SHELL_STATUS ErrorCode
159 );
160
168 VOID
169 );
170
189 );
190
220 VOID
221 );
222
235 IN EFI_DEVICE_PATH_PROTOCOL *ImagePath,
237 );
238
249 VOID
250 );
251
258VOID *
260 VOID *Buffer
261 );
262
268VOID
270 IN CONST CHAR16 *Buffer
271 );
272
285 IN CONST CHAR16 *CmdLine
286 );
287
302 IN CONST CHAR16 *CmdLine,
303 OUT EFI_STATUS *CommandStatus
304 );
305
316 IN SHELL_FILE_HANDLE Handle,
317 IN CONST CHAR16 *Name
318 );
319
332 IN CONST CHAR16 *ScriptPath,
333 IN SHELL_FILE_HANDLE Handle OPTIONAL,
334 IN CONST CHAR16 *CmdLine,
335 IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
336 );
337
348CONST CHAR16 *
350 IN CONST CHAR16 *String,
351 IN CONST CHAR16 *CharacterList,
352 IN CONST CHAR16 EscapeCharacter
353 );
354
362 IN CHAR16 **String
363 );
364
371VOID
373 OUT LIST_ENTRY *OldBufferList
374 );
375
381VOID
383 IN OUT LIST_ENTRY *OldBufferList
384 );
385
386#endif //_SHELL_INTERNAL_HEADER_
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
SHELL_STATUS
Definition: Shell.h:21
EFI_STATUS TrimSpaces(IN CHAR16 **String)
Definition: Shell.c:89
EFI_STATUS SetBuiltInAlias(VOID)
Definition: Shell.c:782
EFI_STATUS DoShellPrompt(VOID)
Definition: Shell.c:1409
EFI_STATUS RunScriptFile(IN CONST CHAR16 *ScriptPath, IN SHELL_FILE_HANDLE Handle OPTIONAL, IN CONST CHAR16 *CmdLine, IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol)
Definition: Shell.c:3275
EFI_STATUS RunShellCommand(IN CONST CHAR16 *CmdLine, OUT EFI_STATUS *CommandStatus)
Definition: Shell.c:2780
VOID RestoreBufferList(IN OUT LIST_ENTRY *OldBufferList)
Definition: Shell.c:1520
EFI_STATUS GetDevicePathsForImageAndFile(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPath, IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath)
Definition: Shell.c:876
VOID AddLineToCommandHistory(IN CONST CHAR16 *Buffer)
Definition: Shell.c:1534
EFI_STATUS SetLastError(IN CONST SHELL_STATUS ErrorCode)
Definition: Shell.c:2377
EFI_STATUS RunCommand(IN CONST CHAR16 *CmdLine)
Definition: Shell.c:2918
VOID * AddBufferToFreeList(VOID *Buffer)
Definition: Shell.c:1480
EFI_STATUS ProcessCommandLine(VOID)
Definition: Shell.c:955
EFI_STATUS RunScriptFileHandle(IN SHELL_FILE_HANDLE Handle, IN CONST CHAR16 *Name)
Definition: Shell.c:2934
EFI_STATUS DoStartupScript(IN EFI_DEVICE_PATH_PROTOCOL *ImagePath, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
Definition: Shell.c:1296
VOID SaveBufferList(OUT LIST_ENTRY *OldBufferList)
Definition: Shell.c:1506
CONST CHAR16 * FindFirstCharacter(IN CONST CHAR16 *String, IN CONST CHAR16 *CharacterList, IN CONST CHAR16 EscapeCharacter)
Definition: Shell.c:3337
EFI_STATUS ProcessCommandLineToFinal(IN OUT CHAR16 **CmdLine)
Definition: Shell.c:2407
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HII_HANDLE
UINT32 NoInterrupt
Was "-nointerrupt" found on command line.
Definition: Shell.h:69
UINT32 NoMap
Was "-nomap" found on command line.
Definition: Shell.h:70
UINT32 NoConsoleOut
Was "-noconsoleout" found on command line.
Definition: Shell.h:67
UINT32 NoConsoleIn
Was "-noconsolein" found on command line.
Definition: Shell.h:68
UINT32 Exit
Was "-_exit" found on command line.
Definition: Shell.h:73
UINT32 NoNest
Was "-nonest" found on command line.
Definition: Shell.h:74
UINT32 Delay
Was "-delay[:n] found on command line.
Definition: Shell.h:72
UINT32 Reserved
Extra bits.
Definition: Shell.h:75
UINT32 Startup
Was "-startup" found on command line.
Definition: Shell.h:65
UINT32 NoStartup
Was "-nostartup" found on command line.
Definition: Shell.h:66
UINT32 NoVersion
Was "-noversion" found on command line.
Definition: Shell.h:71
UINTN LogScreenCount
How many screens of log information to save.
Definition: Shell.h:106
VOID * CtrlCNotifyHandle3
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:116
SPLIT_LIST SplitList
List of Splits in FILO stack.
Definition: Shell.h:113
EFI_SHELL_PARAMETERS_PROTOCOL * OldShellParameters
old shell parameters to reinstall upon exiting.
Definition: Shell.h:111
EFI_DEVICE_PATH_PROTOCOL * FileDevPath
DevicePath for ourselves.
Definition: Shell.h:109
BUFFER_LIST BufferToFreeList
List of buffers that were returned to the user to free.
Definition: Shell.h:103
VOID * CtrlCNotifyHandle4
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:117
BOOLEAN HaltOutput
TRUE to start a CTRL-S halt.
Definition: Shell.h:122
EFI_DEVICE_PATH_PROTOCOL * ImageDevPath
DevicePath for ourselves.
Definition: Shell.h:108
VOID * CtrlCNotifyHandle1
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:114
EFI_HII_HANDLE HiiHandle
Handle from HiiLib.
Definition: Shell.h:105
VOID * CtrlSNotifyHandle4
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:121
VOID * CtrlCNotifyHandle2
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:115
VOID * CtrlSNotifyHandle2
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:119
EFI_EVENT UserBreakTimer
Timer event for polling for CTRL-C.
Definition: Shell.h:107
SHELL_PROTOCOL_HANDLE_LIST OldShellList
List of other instances to reinstall when closing.
Definition: Shell.h:112
VOID * CtrlSNotifyHandle3
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:120
VOID * CtrlSNotifyHandle1
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
Definition: Shell.h:118
CONSOLE_LOGGER_PRIVATE_DATA * ConsoleInfo
Pointer for ConsoleInformation.
Definition: Shell.h:110
CHAR16 * FileOptions
Options to pass to FileName.
Definition: Shell.h:87
UINTN Delay
Seconds of delay default:5.
Definition: Shell.h:85
CHAR16 * FileName
Filename to run upon successful initialization.
Definition: Shell.h:86
BOOLEAN InsertMode
Is the current typing mode insert (FALSE = overwrite).
Definition: Shell.h:94
SHELL_FILE_HANDLE SplitStdIn
ConsoleIn for use in the split.
Definition: Shell.h:61
SHELL_FILE_HANDLE SplitStdOut
ConsoleOut for use in the split.
Definition: Shell.h:60
LIST_ENTRY Link
Standard linked list handler.
Definition: Shell.h:59