EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

ShellPkg/Include/Protocol/EfiShell.h

Go to the documentation of this file.
00001 
00015 #ifndef __EFI_SHELL_PROTOCOL__
00016 #define __EFI_SHELL_PROTOCOL__
00017 
00018 #include <ShellBase.h>
00019 #include <Guid/FileInfo.h>
00020 
00021 #define EFI_SHELL_PROTOCOL_GUID \
00022   { \
00023   0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
00024   }
00025 
00026 // replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
00027 // they are identical outside of the name.
00028 typedef struct {
00029   LIST_ENTRY        Link;       
00030   EFI_STATUS        Status;     
00031   CONST CHAR16      *FullName;  
00032   CONST CHAR16      *FileName;  
00033   SHELL_FILE_HANDLE Handle;     
00034   EFI_FILE_INFO     *Info;      
00035 } EFI_SHELL_FILE_INFO;
00036 
00044 typedef
00045 BOOLEAN
00046 (EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
00047   VOID
00048   );
00049 
00061 typedef
00062 EFI_STATUS
00063 (EFIAPI *EFI_SHELL_CLOSE_FILE)(
00064   IN SHELL_FILE_HANDLE FileHandle
00065   );
00066 
00103 typedef
00104 EFI_STATUS
00105 (EFIAPI *EFI_SHELL_CREATE_FILE)(
00106   IN CONST CHAR16               *FileName,
00107   IN UINT64                     FileAttribs,
00108   OUT SHELL_FILE_HANDLE         *FileHandle
00109   );
00110 
00123 typedef
00124 EFI_STATUS
00125 (EFIAPI *EFI_SHELL_DELETE_FILE)(
00126   IN SHELL_FILE_HANDLE FileHandle
00127   );
00128 
00139 typedef
00140 EFI_STATUS
00141 (EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
00142   IN CONST CHAR16 *FileName
00143   );
00144 
00148 typedef
00149 VOID
00150 (EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
00151   VOID
00152   );
00153 
00157 typedef
00158 VOID
00159 (EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
00160   VOID
00161   );
00162 
00194 typedef
00195 EFI_STATUS
00196 (EFIAPI *EFI_SHELL_EXECUTE) (
00197   IN EFI_HANDLE                 *ParentImageHandle,
00198   IN CHAR16                     *CommandLine OPTIONAL,
00199   IN CHAR16                     **Environment OPTIONAL,
00200   OUT EFI_STATUS                *StatusCode OPTIONAL
00201   );
00202 
00224 typedef
00225 EFI_STATUS
00226 (EFIAPI *EFI_SHELL_FIND_FILES)(
00227   IN CONST CHAR16               *FilePattern,
00228   OUT EFI_SHELL_FILE_INFO       **FileList
00229   );
00230 
00243 typedef
00244 EFI_STATUS
00245 (EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
00246 IN SHELL_FILE_HANDLE            FileDirHandle,
00247 OUT EFI_SHELL_FILE_INFO         **FileList
00248 );
00249 
00265 typedef
00266 EFI_STATUS
00267 (EFIAPI *EFI_SHELL_FLUSH_FILE)(
00268   IN SHELL_FILE_HANDLE FileHandle
00269   );
00270 
00282 typedef
00283 EFI_STATUS
00284 (EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
00285   IN EFI_SHELL_FILE_INFO **FileList
00286   );
00287 
00302 typedef
00303 CONST CHAR16 *
00304 (EFIAPI *EFI_SHELL_GET_CUR_DIR) (
00305   IN CONST CHAR16 *FileSystemMapping OPTIONAL
00306   );
00307 
00308 typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
00309 #define EFI_DEVICE_NAME_USE_COMPONENT_NAME  0x00000001
00310 #define EFI_DEVICE_NAME_USE_DEVICE_PATH     0x00000002
00311 
00342 typedef
00343 EFI_STATUS
00344 (EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
00345   IN EFI_HANDLE                   DeviceHandle,
00346   IN EFI_SHELL_DEVICE_NAME_FLAGS  Flags,
00347   IN CHAR8                        *Language,
00348   OUT CHAR16                      **BestDeviceName
00349   );
00350 
00364 typedef
00365 CONST EFI_DEVICE_PATH_PROTOCOL *
00366 (EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
00367   IN CONST CHAR16 *Mapping
00368   );
00369 
00381 typedef
00382 EFI_DEVICE_PATH_PROTOCOL *
00383 (EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
00384   IN CONST CHAR16 *Path
00385   );
00386 
00410 typedef
00411 CONST CHAR16 *
00412 (EFIAPI *EFI_SHELL_GET_ENV) (
00413   IN CONST CHAR16 *Name OPTIONAL
00414   );
00415 
00427 typedef
00428 EFI_FILE_INFO *
00429 (EFIAPI *EFI_SHELL_GET_FILE_INFO)(
00430   IN SHELL_FILE_HANDLE FileHandle
00431   );
00432 
00445 typedef
00446 CHAR16 *
00447 (EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
00448   IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
00449   );
00450 
00464 typedef
00465 EFI_STATUS
00466 (EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
00467   IN SHELL_FILE_HANDLE FileHandle,
00468   OUT UINT64 *Position
00469   );
00470 
00482 typedef
00483 EFI_STATUS
00484 (EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
00485   IN SHELL_FILE_HANDLE FileHandle,
00486   OUT UINT64 *Size
00487   );
00488 
00514 typedef
00515 EFI_STATUS
00516 (EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
00517   IN CONST CHAR16 *Command,
00518   IN CONST CHAR16 *Sections OPTIONAL,
00519   OUT CHAR16 **HelpText
00520   );
00521 
00542 typedef
00543 CONST CHAR16 *
00544 (EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
00545   IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
00546   );
00547 
00556 typedef
00557 BOOLEAN
00558 (EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
00559   VOID
00560   );
00561 
00570 typedef
00571 BOOLEAN
00572 (EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
00573 VOID
00574 );
00575 
00628 typedef
00629 EFI_STATUS
00630 (EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
00631   IN CONST CHAR16 *FileName,
00632   OUT SHELL_FILE_HANDLE *FileHandle,
00633   IN UINT64 OpenMode
00634   );
00635 
00651 typedef
00652 EFI_STATUS
00653 (EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
00654   IN CHAR16 *Path,
00655   IN UINT64 OpenMode,
00656   IN OUT EFI_SHELL_FILE_INFO **FileList
00657   );
00658 
00675 typedef
00676 EFI_STATUS
00677 (EFIAPI *EFI_SHELL_OPEN_ROOT)(
00678   IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
00679   OUT SHELL_FILE_HANDLE *FileHandle
00680   );
00681 
00697 typedef
00698 EFI_STATUS
00699 (EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
00700   IN EFI_HANDLE DeviceHandle,
00701   OUT SHELL_FILE_HANDLE *FileHandle
00702   );
00703 
00723 typedef
00724 EFI_STATUS
00725 (EFIAPI *EFI_SHELL_READ_FILE) (
00726   IN SHELL_FILE_HANDLE FileHandle,
00727   IN OUT UINTN *ReadSize,
00728   IN OUT VOID *Buffer
00729   );
00730 
00738 typedef
00739 EFI_STATUS
00740 (EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
00741   IN EFI_SHELL_FILE_INFO **FileList
00742   );
00743 
00762 typedef
00763 EFI_STATUS
00764 (EFIAPI *EFI_SHELL_SET_ALIAS)(
00765   IN CONST CHAR16 *Command,
00766   IN CONST CHAR16 *Alias,
00767   IN BOOLEAN Replace,
00768   IN BOOLEAN Volatile
00769   );
00770 
00788 typedef
00789 CONST CHAR16 *
00790 (EFIAPI *EFI_SHELL_GET_ALIAS)(
00791   IN  CONST CHAR16 *Alias,
00792   OUT BOOLEAN      *Volatile OPTIONAL
00793   );
00794 
00819 typedef
00820 EFI_STATUS
00821 (EFIAPI *EFI_SHELL_SET_CUR_DIR) (
00822   IN CONST CHAR16 *FileSystem OPTIONAL,
00823   IN CONST CHAR16 *Dir
00824   );
00825 
00847 typedef
00848 EFI_STATUS
00849 (EFIAPI *EFI_SHELL_SET_ENV) (
00850   IN CONST CHAR16 *Name,
00851   IN CONST CHAR16 *Value,
00852   IN BOOLEAN Volatile
00853   );
00854 
00873 typedef
00874 EFI_STATUS
00875 (EFIAPI *EFI_SHELL_SET_FILE_INFO)(
00876   IN SHELL_FILE_HANDLE FileHandle,
00877   IN CONST EFI_FILE_INFO *FileInfo
00878   );
00879 
00895 typedef
00896 EFI_STATUS
00897 (EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
00898   IN SHELL_FILE_HANDLE FileHandle,
00899   IN UINT64 Position
00900   );
00901 
00914 typedef
00915 EFI_STATUS
00916 (EFIAPI *EFI_SHELL_SET_MAP)(
00917   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
00918   IN CONST CHAR16 *Mapping
00919   );
00920 
00945 typedef
00946 EFI_STATUS
00947 (EFIAPI *EFI_SHELL_WRITE_FILE)(
00948   IN SHELL_FILE_HANDLE          FileHandle,
00949   IN OUT UINTN                  *BufferSize,
00950   IN VOID                       *Buffer
00951   );
00952 
00953 typedef struct _EFI_SHELL_PROTOCOL {
00954   EFI_SHELL_EXECUTE                         Execute;
00955   EFI_SHELL_GET_ENV                         GetEnv;
00956   EFI_SHELL_SET_ENV                         SetEnv;
00957   EFI_SHELL_GET_ALIAS                       GetAlias;
00958   EFI_SHELL_SET_ALIAS                       SetAlias;
00959   EFI_SHELL_GET_HELP_TEXT                   GetHelpText;
00960   EFI_SHELL_GET_DEVICE_PATH_FROM_MAP        GetDevicePathFromMap;
00961   EFI_SHELL_GET_MAP_FROM_DEVICE_PATH        GetMapFromDevicePath;
00962   EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH  GetDevicePathFromFilePath;
00963   EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH  GetFilePathFromDevicePath;
00964   EFI_SHELL_SET_MAP                         SetMap;
00965   EFI_SHELL_GET_CUR_DIR                     GetCurDir;
00966   EFI_SHELL_SET_CUR_DIR                     SetCurDir;
00967   EFI_SHELL_OPEN_FILE_LIST                  OpenFileList;
00968   EFI_SHELL_FREE_FILE_LIST                  FreeFileList;
00969   EFI_SHELL_REMOVE_DUP_IN_FILE_LIST         RemoveDupInFileList;
00970   EFI_SHELL_BATCH_IS_ACTIVE                 BatchIsActive;
00971   EFI_SHELL_IS_ROOT_SHELL                   IsRootShell;
00972   EFI_SHELL_ENABLE_PAGE_BREAK               EnablePageBreak;
00973   EFI_SHELL_DISABLE_PAGE_BREAK              DisablePageBreak;
00974   EFI_SHELL_GET_PAGE_BREAK                  GetPageBreak;
00975   EFI_SHELL_GET_DEVICE_NAME                 GetDeviceName;
00976   EFI_SHELL_GET_FILE_INFO                   GetFileInfo;
00977   EFI_SHELL_SET_FILE_INFO                   SetFileInfo;
00978   EFI_SHELL_OPEN_FILE_BY_NAME               OpenFileByName;
00979   EFI_SHELL_CLOSE_FILE                      CloseFile;
00980   EFI_SHELL_CREATE_FILE                     CreateFile;
00981   EFI_SHELL_READ_FILE                       ReadFile;
00982   EFI_SHELL_WRITE_FILE                      WriteFile;
00983   EFI_SHELL_DELETE_FILE                     DeleteFile;
00984   EFI_SHELL_DELETE_FILE_BY_NAME             DeleteFileByName;
00985   EFI_SHELL_GET_FILE_POSITION               GetFilePosition;
00986   EFI_SHELL_SET_FILE_POSITION               SetFilePosition;
00987   EFI_SHELL_FLUSH_FILE                      FlushFile;
00988   EFI_SHELL_FIND_FILES                      FindFiles;
00989   EFI_SHELL_FIND_FILES_IN_DIR               FindFilesInDir;
00990   EFI_SHELL_GET_FILE_SIZE                   GetFileSize;
00991   EFI_SHELL_OPEN_ROOT                       OpenRoot;
00992   EFI_SHELL_OPEN_ROOT_BY_HANDLE             OpenRootByHandle;
00993   EFI_EVENT                                 ExecutionBreak;
00994   UINT32                                    MajorVersion;
00995   UINT32                                    MinorVersion;
00996 } EFI_SHELL_PROTOCOL;
00997 
00998 extern EFI_GUID gEfiShellProtocolGuid;
00999 
01000 enum ShellVersion {
01001   SHELL_MAJOR_VERSION = 2,
01002   SHELL_MINOR_VERSION = 0
01003 };
01004 
01005 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines