TianoCore EDK2 master
Loading...
Searching...
No Matches
EfiShellEnvironment2.h
Go to the documentation of this file.
1
9#ifndef _SHELL_ENVIRONMENT_2_PROTOCOL_H_
10#define _SHELL_ENVIRONMENT_2_PROTOCOL_H_
11
12#define DEFAULT_INIT_ROW 1
13#define DEFAULT_AUTO_LF FALSE
14
24typedef
25VOID
27 IN EFI_HANDLE Handle,
28 IN VOID *Interface
29 );
30
45typedef
48 IN EFI_HANDLE ImageHandle,
49 IN EFI_SYSTEM_TABLE *SystemTable
50 );
51
62typedef
65 IN OUT CHAR16 **Str
66 );
67
71typedef struct {
72 UINT32 Signature;
75
77 UINT64 OpenMode;
78 CHAR16 *ParentName;
80
81 CHAR16 *FullName;
82 CHAR16 *FileName;
83
87
89#define SHELL_FILE_ARG_SIGNATURE SIGNATURE_32 ('g', 'r', 'a', 'f')
90
94#define SHELL_ENVIRONMENT_PROTOCOL_GUID \
95 { \
96 0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
97 }
98
102#define EFI_SE_EXT_SIGNATURE_GUID \
103 { \
104 0xd2c18636, 0x40e5, 0x4eb5, {0xa3, 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87} \
105 }
106
107#define EFI_SHELL_MAJOR_VER 0x00000001
108#define EFI_SHELL_MINOR_VER 0x00000000
109
129typedef
131(EFIAPI *SHELLENV_EXECUTE)(
132 IN EFI_HANDLE *ParentImageHandle,
133 IN CHAR16 *CommandLine,
134 IN BOOLEAN DebugOutput
135 );
136
147typedef
148CHAR16 *
149(EFIAPI *SHELLENV_GET_ENV)(
150 IN CHAR16 *Name
151 );
152
163typedef
164CHAR16 *
165(EFIAPI *SHELLENV_GET_MAP)(
166 IN CHAR16 *Name
167 );
168
184typedef
186(EFIAPI *SHELLENV_ADD_CMD)(
188 IN CHAR16 *Cmd,
189 IN SHELLCMD_GET_LINE_HELP GetLineHelp
190 );
191
206typedef
207VOID
208(EFIAPI *SHELLENV_ADD_PROT)(
209 IN EFI_GUID *Protocol,
212 IN CHAR16 *IdString
213 );
214
228typedef
229CHAR16 *
230(EFIAPI *SHELLENV_GET_PROT)(
231 IN EFI_GUID *Protocol,
232 IN BOOLEAN GenId
233 );
234
250typedef
251CHAR16 *
252(EFIAPI *SHELLENV_CUR_DIR)(
253 IN CHAR16 *DeviceName OPTIONAL
254 );
255typedef
277(EFIAPI *SHELLENV_FILE_META_ARG)(
278 IN CHAR16 *Arg,
279 IN OUT LIST_ENTRY *ListHead
280 );
281
289typedef
292 IN OUT LIST_ENTRY *ListHead
293 );
294
309typedef
311(EFIAPI *SHELLENV_NEW_SHELL)(
312 IN EFI_HANDLE ImageHandle
313 );
314
325typedef
326BOOLEAN
328 VOID
329 );
330
335typedef
336VOID
338 VOID
339 );
340
352typedef
353VOID
355 IN INT32 StartRow,
356 IN BOOLEAN AutoWrap
357 );
358
365typedef
366VOID
368 VOID
369 );
370
377typedef
378BOOLEAN
380 VOID
381 );
382
393typedef
394VOID
396 IN UINT32 KeyFilter
397 );
398
409typedef
410UINT32
412 VOID
413 );
414
425typedef
426BOOLEAN
428 VOID
429 );
430
435typedef
436VOID
438 VOID
439 );
440
444typedef
445VOID
447 VOID
448 );
449
457typedef
458BOOLEAN
459(EFIAPI *SHELLENV_IS_ROOT_SHELL)(
460 VOID
461 );
462
476typedef
477VOID
479 IN EFI_HANDLE ConInHandle,
481 IN EFI_HANDLE ConOutHandle,
483 );
484
485//
486// declarations of handle enumerator
487//
488
494typedef
495VOID
496(EFIAPI *INIT_HANDLE_ENUMERATOR)(
497 VOID
498 );
499
515typedef
517(EFIAPI *NEXT_HANDLE)(
518 IN OUT EFI_HANDLE **Handle
519 );
520
535typedef
537(EFIAPI *SKIP_HANDLE)(
538 IN UINTN SkipNum
539 );
540
553typedef
556 IN UINTN EnumIndex
557 );
558
568typedef
569VOID
571 VOID
572 );
573
583typedef
585(EFIAPI *GET_NUM)(
586 VOID
587 );
588
592typedef struct {
600
604#define PROTOCOL_INFO_SIGNATURE SIGNATURE_32 ('s', 'p', 'i', 'n')
605
609typedef struct {
612 //
613 // The parsing info for the protocol.
614 //
616 CHAR16 *IdString;
619 //
620 // Patabase info on which handles are supporting this protocol.
621 //
625
626//
627// Declarations of protocol info enumerator.
628//
629
637typedef
638VOID
640 VOID
641 );
642
658typedef
660(EFIAPI *NEXT_PROTOCOL_INFO)(
661 IN OUT PROTOCOL_INFO **ProtocolInfo
662 );
663
674typedef
676(EFIAPI *SKIP_PROTOCOL_INFO)(
677 IN UINTN SkipNum
678 );
679
689typedef
690VOID
692 VOID
693 );
694
704typedef
705VOID
707 VOID
708 );
709
713typedef struct {
720
752typedef
754(EFIAPI *GET_DEVICE_NAME)(
755 IN EFI_HANDLE DeviceHandle,
756 IN BOOLEAN UseComponentName,
757 IN BOOLEAN UseDevicePath,
758 IN CHAR8 *Language,
759 IN OUT CHAR16 **BestDeviceName,
760 OUT EFI_STATUS *ConfigurationStatus,
761 OUT EFI_STATUS *DiagnosticsStatus,
762 IN BOOLEAN Display,
763 IN UINTN Indent
764 );
765
766#define EFI_SHELL_COMPATIBLE_MODE_VER L"1.1.1"
767#define EFI_SHELL_ENHANCED_MODE_VER L"1.1.2"
768
778typedef
780(EFIAPI *GET_SHELL_MODE)(
781 OUT CHAR16 **Mode
782 );
783
799typedef
801(EFIAPI *SHELLENV_NAME_TO_PATH)(
802 IN CHAR16 *Path
803 );
804
827typedef
829(EFIAPI *SHELLENV_GET_FS_NAME)(
831 IN BOOLEAN ConsistMapping,
832 OUT CHAR16 **Name
833 );
834
855typedef
858 IN CHAR16 *Arg,
859 IN OUT LIST_ENTRY *ListHead
860 );
861
877typedef
879(EFIAPI *SHELLENV_DEL_DUP_FILE)(
880 IN LIST_ENTRY *ListHead
881 );
882
905typedef
908 IN CHAR16 *Name,
910 );
911
913typedef struct {
914 SHELLENV_EXECUTE Execute;
915 SHELLENV_GET_ENV GetEnv;
916 SHELLENV_GET_MAP GetMap;
917 SHELLENV_ADD_CMD AddCmd;
918 SHELLENV_ADD_PROT AddProt;
919 SHELLENV_GET_PROT GetProt;
920 SHELLENV_CUR_DIR CurDir;
921 SHELLENV_FILE_META_ARG FileMetaArg;
922 SHELLENV_FREE_FILE_LIST FreeFileList;
923
924 //
925 // The following services are only used by the shell itself.
926 //
927 SHELLENV_NEW_SHELL NewShell;
928 SHELLENV_BATCH_IS_ACTIVE BatchIsActive;
929
930 SHELLENV_FREE_RESOURCES FreeResources;
931
932 //
933 // GUID to differentiate ShellEnvironment2 from ShellEnvironment.
934 //
935 EFI_GUID SESGuid;
936 //
937 // Major Version grows if shell environment interface has been changes.
938 //
939 UINT32 MajorVersion;
940 UINT32 MinorVersion;
941 SHELLENV_ENABLE_PAGE_BREAK EnablePageBreak;
942 SHELLENV_DISABLE_PAGE_BREAK DisablePageBreak;
943 SHELLENV_GET_PAGE_BREAK GetPageBreak;
944
945 SHELLENV_SET_KEY_FILTER SetKeyFilter;
946 SHELLENV_GET_KEY_FILTER GetKeyFilter;
947
948 SHELLENV_GET_EXECUTION_BREAK GetExecutionBreak;
949 SHELLENV_INCREMENT_SHELL_NESTING_LEVEL IncrementShellNestingLevel;
950 SHELLENV_DECREMENT_SHELL_NESTING_LEVEL DecrementShellNestingLevel;
951 SHELLENV_IS_ROOT_SHELL IsRootShell;
952
953 SHELLENV_CLOSE_CONSOLE_PROXY CloseConsoleProxy;
954 HANDLE_ENUMERATOR HandleEnumerator;
955 PROTOCOL_INFO_ENUMERATOR ProtocolInfoEnumerator;
956 GET_DEVICE_NAME GetDeviceName;
957 GET_SHELL_MODE GetShellMode;
958 SHELLENV_NAME_TO_PATH NameToPath;
959 SHELLENV_GET_FS_NAME GetFsName;
960 SHELLENV_FILE_META_ARG_NO_WILDCARD FileMetaArgNoWildCard;
961 SHELLENV_DEL_DUP_FILE DelDupFileArg;
962 SHELLENV_GET_FS_DEVICE_PATH GetFsDevicePath;
964
965extern EFI_GUID gEfiShellEnvironment2Guid;
966extern EFI_GUID gEfiShellEnvironment2ExtGuid;
967
968#endif // _SHELL_ENVIRONMENT_2_PROTOCOL_H_
UINT64 UINTN
VOID(EFIAPI * RESET_PROTOCOL_INFO_ENUMERATOR)(VOID)
EFI_STATUS(EFIAPI * SKIP_PROTOCOL_INFO)(IN UINTN SkipNum)
CHAR16 *(EFIAPI * SHELLENV_GET_ENV)(IN CHAR16 *Name)
EFI_STATUS(EFIAPI * NEXT_HANDLE)(IN OUT EFI_HANDLE **Handle)
EFI_STATUS(EFIAPI * GET_SHELL_MODE)(OUT CHAR16 **Mode)
BOOLEAN(EFIAPI * SHELLENV_GET_EXECUTION_BREAK)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_FILE_META_ARG_NO_WILDCARD)(IN CHAR16 *Arg, IN OUT LIST_ENTRY *ListHead)
VOID(EFIAPI * SHELLENV_DISABLE_PAGE_BREAK)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_DEL_DUP_FILE)(IN LIST_ENTRY *ListHead)
EFI_STATUS(EFIAPI * SHELLCMD_GET_LINE_HELP)(IN OUT CHAR16 **Str)
VOID(EFIAPI * SHELLENV_FREE_RESOURCES)(VOID)
EFI_STATUS(EFIAPI * SKIP_HANDLE)(IN UINTN SkipNum)
UINT32(EFIAPI * SHELLENV_GET_KEY_FILTER)(VOID)
VOID(EFIAPI * INIT_HANDLE_ENUMERATOR)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_ADD_CMD)(IN SHELLENV_INTERNAL_COMMAND Handler, IN CHAR16 *Cmd, IN SHELLCMD_GET_LINE_HELP GetLineHelp)
EFI_SHELL_INTERFACE *(EFIAPI * SHELLENV_NEW_SHELL)(IN EFI_HANDLE ImageHandle)
VOID(EFIAPI * CLOSE_PROTOCOL_INFO_ENUMERATOR)(VOID)
CHAR16 *(EFIAPI * SHELLENV_GET_MAP)(IN CHAR16 *Name)
EFI_STATUS(EFIAPI * NEXT_PROTOCOL_INFO)(IN OUT PROTOCOL_INFO **ProtocolInfo)
EFI_STATUS(EFIAPI * SHELLENV_GET_FS_NAME)(IN EFI_DEVICE_PATH_PROTOCOL *DevPath, IN BOOLEAN ConsistMapping, OUT CHAR16 **Name)
VOID(EFIAPI * SHELLENV_ADD_PROT)(IN EFI_GUID *Protocol, IN SHELLENV_DUMP_PROTOCOL_INFO DumpToken OPTIONAL, IN SHELLENV_DUMP_PROTOCOL_INFO DumpInfo OPTIONAL, IN CHAR16 *IdString)
CHAR16 *(EFIAPI * SHELLENV_GET_PROT)(IN EFI_GUID *Protocol, IN BOOLEAN GenId)
VOID(EFIAPI * INIT_PROTOCOL_INFO_ENUMERATOR)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_EXECUTE)(IN EFI_HANDLE *ParentImageHandle, IN CHAR16 *CommandLine, IN BOOLEAN DebugOutput)
EFI_STATUS(EFIAPI * SHELLENV_FREE_FILE_LIST)(IN OUT LIST_ENTRY *ListHead)
CHAR16 *(EFIAPI * SHELLENV_CUR_DIR)(IN CHAR16 *DeviceName OPTIONAL)
VOID(EFIAPI * SHELLENV_INCREMENT_SHELL_NESTING_LEVEL)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_GET_FS_DEVICE_PATH)(IN CHAR16 *Name, OUT EFI_DEVICE_PATH_PROTOCOL **DevPath)
VOID(EFIAPI * SHELLENV_SET_KEY_FILTER)(IN UINT32 KeyFilter)
VOID(EFIAPI * CLOSE_HANDLE_ENUMERATOR)(VOID)
BOOLEAN(EFIAPI * SHELLENV_GET_PAGE_BREAK)(VOID)
BOOLEAN(EFIAPI * SHELLENV_IS_ROOT_SHELL)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_INTERNAL_COMMAND)(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS(EFIAPI * GET_DEVICE_NAME)(IN EFI_HANDLE DeviceHandle, IN BOOLEAN UseComponentName, IN BOOLEAN UseDevicePath, IN CHAR8 *Language, IN OUT CHAR16 **BestDeviceName, OUT EFI_STATUS *ConfigurationStatus, OUT EFI_STATUS *DiagnosticsStatus, IN BOOLEAN Display, IN UINTN Indent)
VOID(EFIAPI * SHELLENV_ENABLE_PAGE_BREAK)(IN INT32 StartRow, IN BOOLEAN AutoWrap)
EFI_DEVICE_PATH_PROTOCOL *(EFIAPI * SHELLENV_NAME_TO_PATH)(IN CHAR16 *Path)
UINTN(EFIAPI * GET_NUM)(VOID)
EFI_STATUS(EFIAPI * SHELLENV_FILE_META_ARG)(IN CHAR16 *Arg, IN OUT LIST_ENTRY *ListHead)
VOID(EFIAPI * SHELLENV_DECREMENT_SHELL_NESTING_LEVEL)(VOID)
UINTN(EFIAPI * RESET_HANDLE_ENUMERATOR)(IN UINTN EnumIndex)
BOOLEAN(EFIAPI * SHELLENV_BATCH_IS_ACTIVE)(VOID)
VOID(EFIAPI * SHELLENV_CLOSE_CONSOLE_PROXY)(IN EFI_HANDLE ConInHandle, IN OUT EFI_SIMPLE_TEXT_INPUT_PROTOCOL **ConIn, IN EFI_HANDLE ConOutHandle, IN OUT EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL **ConOut)
VOID(EFIAPI * SHELLENV_DUMP_PROTOCOL_INFO)(IN EFI_HANDLE Handle, IN VOID *Interface)
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_SHELL_ENVIRONMENT2 protocol structure.
Definition: Base.h:213
INIT_HANDLE_ENUMERATOR Init
The pointer to INIT_HANDLE_ENUMERATOR function.
NEXT_HANDLE Next
The pointer to NEXT_HANDLE function.
CLOSE_HANDLE_ENUMERATOR Close
The pointer to CLOSE_HANDLE_ENUMERATOR function.
RESET_HANDLE_ENUMERATOR Reset
The pointer to RESET_HANDLE_ENUMERATOR function.
GET_NUM GetNum
The pointer to GET_NUM function.
SKIP_HANDLE Skip
The pointer to SKIP_HANDLE function.
CLOSE_PROTOCOL_INFO_ENUMERATOR Close
The pointer to CLOSE_PROTOCOL_INFO_ENUMERATOR function.
RESET_PROTOCOL_INFO_ENUMERATOR Reset
The pointer to RESET_PROTOCOL_INFO_ENUMERATOR function.
SKIP_PROTOCOL_INFO Skip
The pointer to SKIP_PROTOCOL_INFO function.
INIT_PROTOCOL_INFO_ENUMERATOR Init
The pointer to INIT_PROTOCOL_INFO_ENUMERATOR function.
NEXT_PROTOCOL_INFO Next
The pointer to NEXT_PROTOCOL_INFO function.
SHELLENV_DUMP_PROTOCOL_INFO DumpInfo
The pointer to DumpInfo function for the protocol.
EFI_GUID ProtocolId
The GUID for the protocol.
LIST_ENTRY Link
Standard linked list helper member.
UINTN NoHandles
The number of handles producing this protocol.
SHELLENV_DUMP_PROTOCOL_INFO DumpToken
The pointer to DumpToken function for the protocol.
UINTN Signature
PROTOCOL_INFO_SIGNATURE.
CHAR16 * IdString
The name of the protocol.
EFI_HANDLE * Handles
The array of handles.
EFI_STATUS Status
File's status.
LIST_ENTRY Link
Linked list helper.
EFI_DEVICE_PATH_PROTOCOL * ParentDevicePath
DevicePath for Parent.
CHAR16 * FullName
Path and file name for this file.
EFI_FILE_HANDLE Handle
Handle to this file.
UINT32 Signature
SHELL_FILE_ARG_SIGNATURE.
CHAR16 * ParentName
String representation of parent.
EFI_FILE_INFO * Info
Pointer to file info for this file.
CHAR16 * FileName
File name for this file.
EFI_FILE_HANDLE Parent
What is the Parent file of this file.
UINT64 OpenMode
How was the file opened.