* [PATCH 0/5] Move Shell protocol definitions to MdePkg
@ 2016-10-14 9:44 Ruiyu Ni
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
` (5 more replies)
0 siblings, 6 replies; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel
The patches moves Shell spec defined protocol definitions to
MdePkg and updates all references.
Content of ShellBase.h is moved to Protocol/Shell.h and
ShellBase.h is removed.
Ruiyu Ni (5):
ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter definitions
ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
.../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134 +++++++++++++++++-
.../Include/Protocol/ShellDynamicCommand.h | 7 +-
.../Include/Protocol/ShellParameters.h | 4 +-
MdePkg/MdePkg.dec | 15 ++
ShellPkg/Application/Shell/Shell.h | 5 +-
ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
ShellPkg/Include/Library/ShellLib.h | 14 +-
ShellPkg/Include/ShellBase.h | 157 ---------------------
ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
.../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
.../UefiShellBcfgCommandLib.c | 5 +-
.../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
.../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
.../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
.../UefiShellDebug1CommandsLib.h | 7 +-
.../UefiShellDriver1CommandsLib.h | 7 +-
.../UefiShellLevel1CommandsLib.h | 7 +-
.../UefiShellLevel2CommandsLib.h | 7 +-
ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
.../UefiShellLevel3CommandsLib.h | 7 +-
ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
.../UefiShellNetwork1CommandsLib.h | 3 +-
.../UefiShellTftpCommandLib.h | 3 +-
ShellPkg/ShellPkg.dec | 3 -
ShellPkg/ShellPkg.dsc | 2 +
29 files changed, 213 insertions(+), 234 deletions(-)
rename ShellPkg/Include/Protocol/EfiShell.h => MdePkg/Include/Protocol/Shell.h (92%)
rename ShellPkg/Include/Protocol/EfiShellDynamicCommand.h => MdePkg/Include/Protocol/ShellDynamicCommand.h (92%)
rename ShellPkg/Include/Protocol/EfiShellParameters.h => MdePkg/Include/Protocol/ShellParameters.h (92%)
delete mode 100644 ShellPkg/Include/ShellBase.h
--
2.9.0.windows.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
@ 2016-10-14 9:44 ` Ruiyu Ni
2016-10-14 16:22 ` Tim Lewis
2016-10-17 16:25 ` Carsey, Jaben
2016-10-14 9:44 ` [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions Ruiyu Ni
` (4 subsequent siblings)
5 siblings, 2 replies; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Jaben Carsey, Jiewen Yao, Michael D Kinney
The more proper place for macro SHELL_FREE_NON_NULL is ShellLib.h
instead of ShellBase.h.
Modify Compress.c to resolve build failure due to this change.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
---
ShellPkg/Include/Library/ShellLib.h | 10 +++++++++-
ShellPkg/Include/ShellBase.h | 10 +---------
ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 8 ++++----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
index fe4b9cf..fafa041 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -1,7 +1,7 @@
/** @file
Provides interface to shell functionality for shell commands and applications.
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,6 +24,14 @@
#include <Protocol/EfiShell.h>
#include <Protocol/EfiShellParameters.h>
+#define SHELL_FREE_NON_NULL(Pointer) \
+ do { \
+ if ((Pointer) != NULL) { \
+ FreePool((Pointer)); \
+ (Pointer) = NULL; \
+ } \
+ } while(FALSE)
+
// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)
#define MAX_FILE_NAME_LEN 512
diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h
index 09f87b4..4b7a3d1 100644
--- a/ShellPkg/Include/ShellBase.h
+++ b/ShellPkg/Include/ShellBase.h
@@ -1,7 +1,7 @@
/** @file
Root include file for Shell Package modules that utilize the SHELL_RETURN type
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,14 +17,6 @@
typedef VOID *SHELL_FILE_HANDLE;
-#define SHELL_FREE_NON_NULL(Pointer) \
- do { \
- if ((Pointer) != NULL) { \
- FreePool((Pointer)); \
- (Pointer) = NULL; \
- } \
- } while(FALSE)
-
typedef enum {
///
/// The operation completed successfully.
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
index dda2fed..da8e647 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
@@ -7,7 +7,7 @@
This sequence is further divided into Blocks and Huffman codings
are applied to each Block.
- Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,12 +17,12 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-
+#include <Uefi.h>
+#include <ShellBase.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
-#include <ShellBase.h>
-#include <Uefi.h>
+#include <Library/ShellLib.h>
//
// Macro Definitions
--
2.9.0.windows.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
@ 2016-10-14 9:44 ` Ruiyu Ni
2016-10-17 18:02 ` Carsey, Jaben
2016-10-14 9:44 ` [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg Ruiyu Ni
` (3 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Jaben Carsey, Jiewen Yao, Michael D Kinney
Copy Shell/ShellDynamicCommand/ShellParameters definitions from
ShellPkg to MdePkg.
Content of ShellBase.h is moved to Protocol/Shell.h.
The following patches will update ShellPkg to reference all protocol
definition to MdePkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
---
MdePkg/Include/Protocol/Shell.h | 1268 +++++++++++++++++++++++++
MdePkg/Include/Protocol/ShellDynamicCommand.h | 85 ++
MdePkg/Include/Protocol/ShellParameters.h | 60 ++
MdePkg/MdePkg.dec | 15 +
4 files changed, 1428 insertions(+)
create mode 100644 MdePkg/Include/Protocol/Shell.h
create mode 100644 MdePkg/Include/Protocol/ShellDynamicCommand.h
create mode 100644 MdePkg/Include/Protocol/ShellParameters.h
diff --git a/MdePkg/Include/Protocol/Shell.h b/MdePkg/Include/Protocol/Shell.h
new file mode 100644
index 0000000..cc1fbdc
--- /dev/null
+++ b/MdePkg/Include/Protocol/Shell.h
@@ -0,0 +1,1268 @@
+/** @file
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
+
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_PROTOCOL__
+#define __EFI_SHELL_PROTOCOL__
+
+#include <Guid/FileInfo.h>
+
+#define EFI_SHELL_PROTOCOL_GUID \
+ { \
+ 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
+ }
+typedef VOID *SHELL_FILE_HANDLE;
+
+typedef enum {
+ ///
+ /// The operation completed successfully.
+ ///
+ SHELL_SUCCESS = 0,
+
+ ///
+ /// The image failed to load.
+ ///
+ SHELL_LOAD_ERROR = 1,
+
+ ///
+ /// The parameter was incorrect.
+ ///
+ SHELL_INVALID_PARAMETER = 2,
+
+ ///
+ /// The operation is not supported.
+ ///
+ SHELL_UNSUPPORTED = 3,
+
+ ///
+ /// The buffer was not the proper size for the request.
+ ///
+ SHELL_BAD_BUFFER_SIZE = 4,
+
+ ///
+ /// The buffer was not large enough to hold the requested data.
+ /// The required buffer size is returned in the appropriate
+ /// parameter when this error occurs.
+ ///
+ SHELL_BUFFER_TOO_SMALL = 5,
+
+ ///
+ /// There is no data pending upon return.
+ ///
+ SHELL_NOT_READY = 6,
+
+ ///
+ /// The physical device reported an error while attempting the
+ /// operation.
+ ///
+ SHELL_DEVICE_ERROR = 7,
+
+ ///
+ /// The device cannot be written to.
+ ///
+ SHELL_WRITE_PROTECTED = 8,
+
+ ///
+ /// The resource has run out.
+ ///
+ SHELL_OUT_OF_RESOURCES = 9,
+
+ ///
+ /// An inconsistency was detected on the file system causing the
+ /// operation to fail.
+ ///
+ SHELL_VOLUME_CORRUPTED = 10,
+
+ ///
+ /// There is no more space on the file system.
+ ///
+ SHELL_VOLUME_FULL = 11,
+
+ ///
+ /// The device does not contain any medium to perform the
+ /// operation.
+ ///
+ SHELL_NO_MEDIA = 12,
+
+ ///
+ /// The medium in the device has changed since the last
+ /// access.
+ ///
+ SHELL_MEDIA_CHANGED = 13,
+
+ ///
+ /// The item was not found.
+ ///
+ SHELL_NOT_FOUND = 14,
+
+ ///
+ /// Access was denied.
+ ///
+ SHELL_ACCESS_DENIED = 15,
+
+ // note the skipping of 16 and 17
+
+ ///
+ /// A timeout time expired.
+ ///
+ SHELL_TIMEOUT = 18,
+
+ ///
+ /// The protocol has not been started.
+ ///
+ SHELL_NOT_STARTED = 19,
+
+ ///
+ /// The protocol has already been started.
+ ///
+ SHELL_ALREADY_STARTED = 20,
+
+ ///
+ /// The operation was aborted.
+ ///
+ SHELL_ABORTED = 21,
+
+ // note the skipping of 22, 23, and 24
+
+ ///
+ /// A function encountered an internal version that was
+ /// incompatible with a version requested by the caller.
+ ///
+ SHELL_INCOMPATIBLE_VERSION = 25,
+
+ ///
+ /// The function was not performed due to a security violation.
+ ///
+ SHELL_SECURITY_VIOLATION = 26,
+
+ ///
+ /// The function was performed and resulted in an unequal
+ /// comparison..
+ ///
+ SHELL_NOT_EQUAL = 27
+} SHELL_STATUS;
+
+
+// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
+// they are identical outside of the name.
+typedef struct {
+ LIST_ENTRY Link; ///< Linked list members.
+ EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL.
+ CONST CHAR16 *FullName; ///< Fully qualified filename.
+ CONST CHAR16 *FileName; ///< name of this file.
+ SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened file or NULL if closed.
+ EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or NULL.
+} EFI_SHELL_FILE_INFO;
+
+/**
+ Returns whether any script files are currently being processed.
+
+ @retval TRUE There is at least one script file active.
+ @retval FALSE No script files are active now.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
+ VOID
+ );
+
+/**
+ Closes the file handle.
+
+ This function closes a specified file handle. All 'dirty' cached file data is
+ flushed to the device, and the file is closed. In all cases, the handle is
+ closed.
+
+ @param[in] FileHandle The file handle to be closed.
+
+ @retval EFI_SUCCESS The file closed sucessfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_CLOSE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Creates a file or directory by name.
+
+ This function creates an empty new file or directory with the specified attributes and
+ returns the new file's handle. If the file already exists and is read-only, then
+ EFI_INVALID_PARAMETER will be returned.
+
+ If the file already existed, it is truncated and its attributes updated. If the file is
+ created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
+
+ If the file name begins with >v, then the file handle which is returned refers to the
+ shell environment variable with the specified name. If the shell environment variable
+ already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
+
+ @param[in] FileName Pointer to NULL-terminated file path.
+ @param[in] FileAttribs The new file's attrbiutes. The different attributes are
+ described in EFI_FILE_PROTOCOL.Open().
+ @param[out] FileHandle On return, points to the created file handle or directory's handle.
+
+ @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
+ @retval EFI_UNSUPPORTED The file path could not be opened.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device, or could not
+ file the file system on the device.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported.
+ @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
+ the DirName.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected.
+ @retval EFI_ACCESS_DENIED The service denied access to the file.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_CREATE_FILE)(
+ IN CONST CHAR16 *FileName,
+ IN UINT64 FileAttribs,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Deletes the file specified by the file handle.
+
+ This function closes and deletes a file. In all cases, the file handle is closed. If the file
+ cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
+ handle is still closed.
+
+ @param[in] FileHandle The file handle to delete.
+
+ @retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_DELETE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Deletes the file specified by the file name.
+
+ This function deletes a file.
+
+ @param[in] FileName Points to the NULL-terminated file name.
+
+ @retval EFI_SUCCESS The file was deleted.
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
+ IN CONST CHAR16 *FileName
+ );
+
+/**
+ Disables the page break output mode.
+**/
+typedef
+VOID
+(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Enables the page break output mode.
+**/
+typedef
+VOID
+(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Execute the command line.
+
+ This function creates a nested instance of the shell and executes the specified
+ command (CommandLine) with the specified environment (Environment). Upon return,
+ the status code returned by the specified command is placed in StatusCode.
+
+ If Environment is NULL, then the current environment is used and all changes made
+ by the commands executed will be reflected in the current environment. If the
+ Environment is non-NULL, then the changes made will be discarded.
+
+ The CommandLine is executed from the current working directory on the current
+ device.
+
+ @param[in] ParentImageHandle A handle of the image that is executing the specified
+ command line.
+ @param[in] CommandLine Points to the NULL-terminated UCS-2 encoded string
+ containing the command line. If NULL then the command-
+ line will be empty.
+ @param[in] Environment Points to a NULL-terminated array of environment
+ variables with the format 'x=y', where x is the
+ environment variable name and y is the value. If this
+ is NULL, then the current shell environment is used.
+ @param[out] ErrorCode Points to the status code returned by the command.
+
+ @retval EFI_SUCCESS The command executed successfully. The status code
+ returned by the command is pointed to by StatusCode.
+ @retval EFI_INVALID_PARAMETER The parameters are invalid.
+ @retval EFI_OUT_OF_RESOURCES Out of resources.
+ @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_EXECUTE) (
+ IN EFI_HANDLE *ParentImageHandle,
+ IN CHAR16 *CommandLine OPTIONAL,
+ IN CHAR16 **Environment OPTIONAL,
+ OUT EFI_STATUS *StatusCode OPTIONAL
+ );
+
+/**
+ Find files that match a specified pattern.
+
+ This function searches for all files and directories that match the specified
+ FilePattern. The FilePattern can contain wild-card characters. The resulting file
+ information is placed in the file list FileList.
+
+ The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
+ field is set to NULL.
+
+ @param[in] FilePattern Points to a NULL-terminated shell file path, including wildcards.
+ @param[out] FileList On return, points to the start of a file list containing the names
+ of all matching files or else points to NULL if no matching files
+ were found.
+
+ @retval EFI_SUCCESS Files found.
+ @retval EFI_NOT_FOUND No files found.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FIND_FILES)(
+ IN CONST CHAR16 *FilePattern,
+ OUT EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Find all files in a specified directory.
+
+ @param[in] FileDirHandle Handle of the directory to search.
+ @param[out] FileList On return, points to the list of files in the directory
+ or NULL if there are no files in the directory.
+
+ @retval EFI_SUCCESS File information was returned successfully.
+ @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_NO_MEDIA The device media is not present.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
+IN SHELL_FILE_HANDLE FileDirHandle,
+OUT EFI_SHELL_FILE_INFO **FileList
+);
+
+/**
+ Flushes data back to a device.
+
+ This function flushes all modified data associated with a file to a device.
+
+ @param[in] FileHandle The handle of the file to flush.
+
+ @retval EFI_SUCCESS The data was flushed.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FLUSH_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Frees the file list.
+
+ This function cleans up the file list and any related data structures. It has no
+ impact on the files themselves.
+
+ @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
+ defined in OpenFileList().
+
+ @retval EFI_SUCCESS Free the file list successfully.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
+ IN EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Returns the current directory on the specified device.
+
+ If FileSystemMapping is NULL, it returns the current working directory. If the
+ FileSystemMapping is not NULL, it returns the current directory associated with the
+ FileSystemMapping. In both cases, the returned name includes the file system
+ mapping (i.e. fs0:\current-dir).
+
+ Note that the current directory string should exclude the tailing backslash character.
+
+ @param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
+ then the current working directory is returned.
+
+ @retval !=NULL The current directory.
+ @retval NULL Current directory does not exist.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
+ IN CONST CHAR16 *FileSystemMapping OPTIONAL
+ );
+
+typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
+#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
+#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
+
+/**
+ Gets the name of the device specified by the device handle.
+
+ This function gets the user-readable name of the device specified by the device
+ handle. If no user-readable name could be generated, then *BestDeviceName will be
+ NULL and EFI_NOT_FOUND will be returned.
+
+ If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
+ device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
+ DeviceHandle.
+
+ If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
+ device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
+ If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
+ EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
+ EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
+
+ @param[in] DeviceHandle The handle of the device.
+ @param[in] Flags Determines the possible sources of component names.
+ @param[in] Language A pointer to the language specified for the device
+ name, in the same format as described in the UEFI
+ specification, Appendix M.
+ @param[out] BestDeviceName On return, points to the callee-allocated NULL-
+ terminated name of the device. If no device name
+ could be found, points to NULL. The name must be
+ freed by the caller...
+
+ @retval EFI_SUCCESS Get the name successfully.
+ @retval EFI_NOT_FOUND Fail to get the device name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
+ IN CHAR8 *Language,
+ OUT CHAR16 **BestDeviceName
+ );
+
+/**
+ Gets the device path from the mapping.
+
+ This function gets the device path associated with a mapping.
+
+ @param[in] Mapping A pointer to the mapping
+
+ @retval !=NULL Pointer to the device path that corresponds to the
+ device mapping. The returned pointer does not need
+ to be freed.
+ @retval NULL There is no device path associated with the
+ specified mapping.
+**/
+typedef
+CONST EFI_DEVICE_PATH_PROTOCOL *
+(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
+ IN CONST CHAR16 *Mapping
+ );
+
+/**
+ Converts a file system style name to a device path.
+
+ This function converts a file system style name to a device path, by replacing any
+ mapping references to the associated device path.
+
+ @param[in] Path The pointer to the path.
+
+ @return The pointer of the file path. The file path is callee
+ allocated and should be freed by the caller.
+**/
+typedef
+EFI_DEVICE_PATH_PROTOCOL *
+(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
+ IN CONST CHAR16 *Path
+ );
+
+/**
+ Gets either a single or list of environment variables.
+
+ If name is not NULL then this function returns the current value of the specified
+ environment variable.
+
+ If Name is NULL than a list of all environment variable names is returned. Each a
+ NULL terminated string with a double NULL terminating the list.
+
+ @param[in] Name A pointer to the environment variable name. If
+ Name is NULL, then the function will return all
+ of the defined shell environment variables. In
+ the case where multiple environment variables are
+ being returned, each variable will be terminated by
+ a NULL, and the list will be terminated by a double
+ NULL.
+
+ @return A pointer to the returned string.
+ The returned pointer does not need to be freed by the caller.
+
+ @retval NULL The environment variable doesn't exist or there are
+ no environment variables.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ENV) (
+ IN CONST CHAR16 *Name OPTIONAL
+ );
+
+/**
+ Gets the environment variable and Attributes, or list of environment variables. Can be
+ used instead of GetEnv().
+
+ This function returns the current value of the specified environment variable and
+ the Attributes. If no variable name was specified, then all of the known
+ variables will be returned.
+
+ @param[in] Name A pointer to the environment variable name. If Name is NULL,
+ then the function will return all of the defined shell
+ environment variables. In the case where multiple environment
+ variables are being returned, each variable will be terminated
+ by a NULL, and the list will be terminated by a double NULL.
+ @param[out] Attributes If not NULL, a pointer to the returned attributes bitmask for
+ the environment variable. In the case where Name is NULL, and
+ multiple environment variables are being returned, Attributes
+ is undefined.
+
+ @retval NULL The environment variable doesn't exist.
+ @return The environment variable's value. The returned pointer does not
+ need to be freed by the caller.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ENV_EX) (
+ IN CONST CHAR16 *Name,
+ OUT UINT32 *Attributes OPTIONAL
+ );
+
+/**
+ Gets the file information from an open file handle.
+
+ This function allocates a buffer to store the file's information. It's the caller's
+ responsibility to free the buffer.
+
+ @param[in] FileHandle A File Handle.
+
+ @retval NULL Cannot get the file info.
+ @return A pointer to a buffer with file information.
+**/
+typedef
+EFI_FILE_INFO *
+(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
+ IN SHELL_FILE_HANDLE FileHandle
+ );
+
+/**
+ Converts a device path to a file system-style path.
+
+ This function converts a device path to a file system path by replacing part, or all, of
+ the device path with the file-system mapping. If there are more than one application
+ file system mappings, the one that most closely matches Path will be used.
+
+ @param[in] Path The pointer to the device path.
+
+ @return The pointer of the NULL-terminated file path. The path
+ is callee-allocated and should be freed by the caller.
+**/
+typedef
+CHAR16 *
+(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
+ );
+
+/**
+ Gets a file's current position.
+
+ This function returns the current file position for the file handle. For directories, the
+ current file position has no meaning outside of the file system driver and as such, the
+ operation is not supported.
+
+ @param[in] FileHandle The file handle on which to get the current position.
+ @param[out] Position Byte position from the start of the file.
+
+ @retval EFI_SUCCESS Data was accessed.
+ @retval EFI_UNSUPPORTED The request is not valid on open directories.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ OUT UINT64 *Position
+ );
+
+/**
+ Gets the size of a file.
+
+ This function returns the size of the file specified by FileHandle.
+
+ @param[in] FileHandle The handle of the file.
+ @param[out] Size The size of this file.
+
+ @retval EFI_SUCCESS Get the file's size.
+ @retval EFI_DEVICE_ERROR Can't access the file.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ OUT UINT64 *Size
+ );
+
+/**
+ Get the GUID value from a human readable name.
+
+ If GuidName is a known GUID name, then update Guid to have the correct value for
+ that GUID.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] GuidName A pointer to the localized name for the GUID being queried.
+ @param[out] Guid A pointer to the GUID structure to be filled in.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
+ IN CONST CHAR16 *GuidName,
+ OUT EFI_GUID *Guid
+ );
+
+/**
+ Get the human readable name for a GUID from the value.
+
+ If Guid is assigned a name, then update *GuidName to point to the name. The callee
+ should not modify the value.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] Guid A pointer to the GUID being queried.
+ @param[out] GuidName A pointer to a pointer the localized to name for the GUID being requested
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_NOT_FOUND Guid is not assigned a name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
+ IN CONST EFI_GUID *Guid,
+ OUT CONST CHAR16 **GuidName
+ );
+
+/**
+ Return help information about a specific command.
+
+ This function returns the help information for the specified command. The help text
+ can be internal to the shell or can be from a UEFI Shell manual page.
+
+ If Sections is specified, then each section name listed will be compared in a casesensitive
+ manner, to the section names described in Appendix B. If the section exists,
+ it will be appended to the returned help text. If the section does not exist, no
+ information will be returned. If Sections is NULL, then all help text information
+ available will be returned.
+
+ @param[in] Command Points to the NULL-terminated UEFI Shell command name.
+ @param[in] Sections Points to the NULL-terminated comma-delimited
+ section names to return. If NULL, then all
+ sections will be returned.
+ @param[out] HelpText On return, points to a callee-allocated buffer
+ containing all specified help text.
+
+ @retval EFI_SUCCESS The help text was returned.
+ @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
+ returned help text.
+ @retval EFI_INVALID_PARAMETER HelpText is NULL.
+ @retval EFI_NOT_FOUND There is no help text available for Command.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
+ IN CONST CHAR16 *Command,
+ IN CONST CHAR16 *Sections OPTIONAL,
+ OUT CHAR16 **HelpText
+ );
+
+/**
+ Gets the mapping(s) that most closely matches the device path.
+
+ This function gets the mapping which corresponds to the device path *DevicePath. If
+ there is no exact match, then the mapping which most closely matches *DevicePath
+ is returned, and *DevicePath is updated to point to the remaining portion of the
+ device path. If there is an exact match, the mapping is returned and *DevicePath
+ points to the end-of-device-path node.
+
+ If there are multiple map names they will be semi-colon seperated in the
+ NULL-terminated string.
+
+ @param[in, out] DevicePath On entry, points to a device path pointer. On
+ exit, updates the pointer to point to the
+ portion of the device path after the mapping.
+
+ @retval NULL No mapping was found.
+ @retval !=NULL Pointer to NULL-terminated mapping. The buffer
+ is callee allocated and should be freed by the caller.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+/**
+ Gets the enable status of the page break output mode.
+
+ User can use this function to determine current page break mode.
+
+ @retval TRUE The page break output mode is enabled.
+ @retval FALSE The page break output mode is disabled.
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
+ VOID
+ );
+
+/**
+ Judges whether the active shell is the root shell.
+
+ This function makes the user to know that whether the active Shell is the root shell.
+
+ @retval TRUE The active Shell is the root Shell.
+ @retval FALSE The active Shell is NOT the root Shell.
+**/
+typedef
+BOOLEAN
+(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
+VOID
+);
+
+/**
+ Opens a file or a directory by file name.
+
+ This function opens the specified file in the specified OpenMode and returns a file
+ handle.
+ If the file name begins with '>v', then the file handle which is returned refers to the
+ shell environment variable with the specified name. If the shell environment variable
+ exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
+ EFI_INVALID_PARAMETER is returned.
+
+ If the file name is '>i', then the file handle which is returned refers to the standard
+ input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is '>o', then the file handle which is returned refers to the standard
+ output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is '>e', then the file handle which is returned refers to the standard
+ error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
+ is returned.
+
+ If the file name is 'NUL', then the file handle that is returned refers to the standard NUL
+ file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
+ returned.
+
+ If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
+ FileHandle is NULL.
+
+ @param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
+ @param[out] FileHandle On return, points to the file handle.
+ @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
+ EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
+ Specification.
+ @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
+ @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
+ @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
+ system could not be found on the device. FileHandle is NULL.
+ @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
+ @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
+ longer supported. FileHandle is NULL.
+ @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
+ the FileName. FileHandle is NULL.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
+ @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
+ when the media is write-protected. FileHandle is NULL.
+ @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
+ is NULL.
+ @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
+ IN CONST CHAR16 *FileName,
+ OUT SHELL_FILE_HANDLE *FileHandle,
+ IN UINT64 OpenMode
+ );
+
+/**
+ Opens the files that match the path specified.
+
+ This function opens all of the files specified by Path. Wildcards are processed
+ according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
+ matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
+
+ @param[in] Path A pointer to the path string.
+ @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
+ EFI_FILE_MODE_WRITE.
+ @param[in, out] FileList Points to the start of a list of files opened.
+
+ @retval EFI_SUCCESS Create the file list successfully.
+ @return Can't create the file list.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
+ IN CHAR16 *Path,
+ IN UINT64 OpenMode,
+ IN OUT EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Opens the root directory of a device.
+
+ This function opens the root directory of a device and returns a file handle to it.
+
+ @param[in] DevicePath Points to the device path corresponding to the device where the
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
+ device.
+
+ @retval EFI_SUCCESS Root opened successfully.
+ @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
+ could not be opened.
+ @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
+ @retval EFI_DEVICE_ERROR The device had an error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_ROOT)(
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Opens the root directory of a device on a handle.
+
+ This function opens the root directory of a device and returns a file handle to it.
+
+ @param[in] DeviceHandle The handle of the device that contains the volume.
+ @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
+ device.
+
+ @retval EFI_SUCCESS Root opened successfully.
+ @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
+ could not be opened.
+ @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
+ @retval EFI_DEVICE_ERROR The device had an error.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
+ IN EFI_HANDLE DeviceHandle,
+ OUT SHELL_FILE_HANDLE *FileHandle
+ );
+
+/**
+ Reads data from the file.
+
+ If FileHandle is not a directory, the function reads the requested number of bytes
+ from the file at the file's current position and returns them in Buffer. If the read goes
+ beyond the end of the file, the read length is truncated to the end of the file. The file's
+ current position is increased by the number of bytes returned.
+ If FileHandle is a directory, then an error is returned.
+
+ @param[in] FileHandle The opened file handle for read.
+ @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
+ @param[in, out] Buffer The buffer in which data is read.
+
+ @retval EFI_SUCCESS Data was read.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_READ_FILE) (
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN OUT UINTN *ReadSize,
+ IN OUT VOID *Buffer
+ );
+
+/**
+ Register a GUID and a localized human readable name for it.
+
+ If Guid is not assigned a name, then assign GuidName to Guid. This list of GUID
+ names must be used whenever a shell command outputs GUID information.
+
+ This function is only available when the major and minor versions in the
+ EfiShellProtocol are greater than or equal to 2 and 1, respectively.
+
+ @param[in] Guid A pointer to the GUID being registered.
+ @param[in] GuidName A pointer to the localized name for the GUID being registered.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_INVALID_PARAMETER Guid was NULL.
+ @retval EFI_INVALID_PARAMETER GuidName was NULL.
+ @retval EFI_ACCESS_DENIED Guid already is assigned a name.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
+ IN CONST EFI_GUID *Guid,
+ IN CONST CHAR16 *GuidName
+ );
+
+/**
+ Deletes the duplicate file names files in the given file list.
+
+ @param[in] FileList A pointer to the first entry in the file list.
+
+ @retval EFI_SUCCESS Always success.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
+ IN EFI_SHELL_FILE_INFO **FileList
+ );
+
+/**
+ Changes a shell command alias.
+
+ This function creates an alias for a shell command.
+
+ @param[in] Command Points to the NULL-terminated shell command or existing alias.
+ @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
+ Command refers to an alias, that alias will be deleted.
+ @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
+ FALSE and the alias already exists, then the existing alias is unchanged and
+ EFI_ACCESS_DENIED is returned.
+ @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
+ Alias being set will be stored in a non-volatile fashion.
+
+ @retval EFI_SUCCESS Alias created or deleted successfully.
+ @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
+ FALSE.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_ALIAS)(
+ IN CONST CHAR16 *Command,
+ IN CONST CHAR16 *Alias,
+ IN BOOLEAN Replace,
+ IN BOOLEAN Volatile
+ );
+
+/**
+ This function returns the command associated with a alias or a list of all
+ alias'.
+
+ @param[in] Alias Points to the NULL-terminated shell alias.
+ If this parameter is NULL, then all
+ aliases will be returned in ReturnedData.
+ @param[out] Volatile Upon return of a single command if TRUE indicates
+ this is stored in a volatile fashion. FALSE otherwise.
+ @return If Alias is not NULL, it will return a pointer to
+ the NULL-terminated command for that alias.
+ If Alias is NULL, ReturnedData points to a ';'
+ delimited list of alias (e.g.
+ ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
+ @retval NULL An error ocurred.
+ @retval NULL Alias was not a valid Alias.
+**/
+typedef
+CONST CHAR16 *
+(EFIAPI *EFI_SHELL_GET_ALIAS)(
+ IN CONST CHAR16 *Alias,
+ OUT BOOLEAN *Volatile OPTIONAL
+ );
+
+/**
+ Changes the current directory on the specified device.
+
+ If the FileSystem is NULL, and the directory Dir does not contain a file system's
+ mapped name, this function changes the current working directory. If FileSystem is
+ NULL and the directory Dir contains a mapped name, then the current file system and
+ the current directory on that file system are changed.
+
+ If FileSystem is not NULL, and Dir is NULL, then this changes the current working file
+ system.
+
+ If FileSystem is not NULL and Dir is not NULL, then this function changes the current
+ directory on the specified file system.
+
+ If the current working directory or the current working file system is changed then the
+ %cwd% environment variable will be updated.
+
+ @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
+ directory is changed.
+ @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
+
+ @retval NULL Current directory does not exist.
+ @return The current directory.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
+ IN CONST CHAR16 *FileSystem OPTIONAL,
+ IN CONST CHAR16 *Dir
+ );
+
+/**
+ Sets the environment variable.
+
+ This function changes the current value of the specified environment variable. If the
+ environment variable exists and the Value is an empty string, then the environment
+ variable is deleted. If the environment variable exists and the Value is not an empty
+ string, then the value of the environment variable is changed. If the environment
+ variable does not exist and the Value is an empty string, there is no action. If the
+ environment variable does not exist and the Value is a non-empty string, then the
+ environment variable is created and assigned the specified value.
+
+ For a description of volatile and non-volatile environment variables, see UEFI Shell
+ 2.0 specification section 3.6.1.
+
+ @param[in] Name Points to the NULL-terminated environment variable name.
+ @param[in] Value Points to the NULL-terminated environment variable value. If the value is an
+ empty string then the environment variable is deleted.
+ @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
+
+ @retval EFI_SUCCESS The environment variable was successfully updated.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_ENV) (
+ IN CONST CHAR16 *Name,
+ IN CONST CHAR16 *Value,
+ IN BOOLEAN Volatile
+ );
+
+/**
+ Sets the file information to an opened file handle.
+
+ This function changes file information. All file information in the EFI_FILE_INFO
+ struct will be updated to the passed in data.
+
+ @param[in] FileHandle A file handle.
+ @param[in] FileInfo Points to new file information.
+
+ @retval EFI_SUCCESS The information was set.
+ @retval EFI_NO_MEDIA The device has no medium.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
+ @retval EFI_ACCESS_DENIED The file was opened read-only.
+ @retval EFI_VOLUME_FULL The volume is full.
+ @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of EFI_FILE_INFO.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST EFI_FILE_INFO *FileInfo
+ );
+
+/**
+ Sets a file's current position.
+
+ This function sets the current file position for the handle to the position supplied. With
+ the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute positioning is
+ supported, and seeking past the end of the file is allowed (a subsequent write would
+ grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
+ to be set to the end of the file.
+
+ @param[in] FileHandle The file handle on which requested position will be set.
+ @param[in] Position Byte position from the start of the file.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN UINT64 Position
+ );
+
+/**
+ This function creates a mapping for a device path.
+
+ @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
+ then the mapping will be deleted.
+ @param[in] Mapping Points to the NULL-terminated mapping for the device path.
+
+ @retval EFI_SUCCESS Mapping created or deleted successfully.
+ @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
+ boot service function LocateDevicePath().
+ @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_SET_MAP)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST CHAR16 *Mapping
+ );
+
+/**
+ Writes data to the file.
+
+ This function writes the specified number of bytes to the file at the current file position.
+ The current file position is advanced the actual number of bytes written, which is
+ returned in BufferSize. Partial writes only occur when there has been a data error
+ during the write attempt (such as "volume space full"). The file automatically grows to
+ hold the data, if required.
+
+ Direct writes to opened directories are not supported.
+
+ @param[in] FileHandle The opened file handle for writing.
+ @param[in, out] BufferSize On input, size of Buffer.
+ @param[in] Buffer The buffer in which data to write.
+
+ @retval EFI_SUCCESS Data was written.
+ @retval EFI_UNSUPPORTED Writes to open directory are not supported.
+ @retval EFI_NO_MEDIA The device has no media.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
+ @retval EFI_WRITE_PROTECTED The device is write-protected.
+ @retval EFI_ACCESS_DENIED The file was open for read only.
+ @retval EFI_VOLUME_FULL The volume is full.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SHELL_WRITE_FILE)(
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+ );
+
+//
+// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
+// Usage of this protocol will require version checking before attempting
+// to use any new members. There is no need to check the version for
+// members that existed in UEFI Shell Spec 2.0.
+//
+// Update below for any future UEFI Shell spec changes to this protocol.
+//
+// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
+// if ((2 == gEfiShellProtocol->MajorVersion) &&
+// (0 == gEfiShellProtocol->MinorVersion)) {
+// //
+// // Cannot call:
+// // RegisterGuidName - UEFI Shell 2.1
+// // GetGuidName - UEFI Shell 2.1
+// // GetGuidFromName - UEFI Shell 2.1
+// // GetEnvEx - UEFI Shell 2.1
+// //
+// } else {
+// //
+// // Can use all members
+// //
+// }
+//
+typedef struct _EFI_SHELL_PROTOCOL {
+ EFI_SHELL_EXECUTE Execute;
+ EFI_SHELL_GET_ENV GetEnv;
+ EFI_SHELL_SET_ENV SetEnv;
+ EFI_SHELL_GET_ALIAS GetAlias;
+ EFI_SHELL_SET_ALIAS SetAlias;
+ EFI_SHELL_GET_HELP_TEXT GetHelpText;
+ EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
+ EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
+ EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH GetDevicePathFromFilePath;
+ EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH GetFilePathFromDevicePath;
+ EFI_SHELL_SET_MAP SetMap;
+ EFI_SHELL_GET_CUR_DIR GetCurDir;
+ EFI_SHELL_SET_CUR_DIR SetCurDir;
+ EFI_SHELL_OPEN_FILE_LIST OpenFileList;
+ EFI_SHELL_FREE_FILE_LIST FreeFileList;
+ EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
+ EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
+ EFI_SHELL_IS_ROOT_SHELL IsRootShell;
+ EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
+ EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
+ EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
+ EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
+ EFI_SHELL_GET_FILE_INFO GetFileInfo;
+ EFI_SHELL_SET_FILE_INFO SetFileInfo;
+ EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
+ EFI_SHELL_CLOSE_FILE CloseFile;
+ EFI_SHELL_CREATE_FILE CreateFile;
+ EFI_SHELL_READ_FILE ReadFile;
+ EFI_SHELL_WRITE_FILE WriteFile;
+ EFI_SHELL_DELETE_FILE DeleteFile;
+ EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
+ EFI_SHELL_GET_FILE_POSITION GetFilePosition;
+ EFI_SHELL_SET_FILE_POSITION SetFilePosition;
+ EFI_SHELL_FLUSH_FILE FlushFile;
+ EFI_SHELL_FIND_FILES FindFiles;
+ EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
+ EFI_SHELL_GET_FILE_SIZE GetFileSize;
+ EFI_SHELL_OPEN_ROOT OpenRoot;
+ EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
+ EFI_EVENT ExecutionBreak;
+ UINT32 MajorVersion;
+ UINT32 MinorVersion;
+ // Added for Shell 2.1
+ EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
+ EFI_SHELL_GET_GUID_NAME GetGuidName;
+ EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
+ EFI_SHELL_GET_ENV_EX GetEnvEx;
+} EFI_SHELL_PROTOCOL;
+
+extern EFI_GUID gEfiShellProtocolGuid;
+
+enum ShellVersion {
+ SHELL_MAJOR_VERSION = 2,
+ SHELL_MINOR_VERSION = 1
+};
+
+#endif
diff --git a/MdePkg/Include/Protocol/ShellDynamicCommand.h b/MdePkg/Include/Protocol/ShellDynamicCommand.h
new file mode 100644
index 0000000..793b4fd
--- /dev/null
+++ b/MdePkg/Include/Protocol/ShellDynamicCommand.h
@@ -0,0 +1,85 @@
+/** @file
+ EFI Shell Dynamic Command registration protocol
+
+ (C) Copyright 2012-2014 Hewlett-Packard Development Company, L.P.<BR>
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
+#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
+
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
+
+// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
+#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
+ { \
+ 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 } \
+ }
+
+
+//
+// Define for forward reference.
+//
+typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
+
+
+/**
+ This is the shell command handler function pointer callback type. This
+ function handles the command when it is invoked in the shell.
+
+ @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
+ @param[in] SystemTable The pointer to the system table.
+ @param[in] ShellParameters The parameters associated with the command.
+ @param[in] Shell The instance of the shell protocol used in the context
+ of processing this command.
+
+ @return EFI_SUCCESS the operation was sucessful
+ @return other the operation failed.
+**/
+typedef
+SHELL_STATUS
+(EFIAPI * SHELL_COMMAND_HANDLER)(
+ IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
+ IN EFI_SHELL_PROTOCOL *Shell
+ );
+
+/**
+ This is the command help handler function pointer callback type. This
+ function is responsible for displaying help information for the associated
+ command.
+
+ @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
+ @param[in] Language The pointer to the language string to use.
+
+ @return string Pool allocated help string, must be freed by caller
+**/
+typedef
+CHAR16*
+(EFIAPI * SHELL_COMMAND_GETHELP)(
+ IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
+ IN CONST CHAR8 *Language
+ );
+
+/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
+struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
+
+ CONST CHAR16 *CommandName;
+ SHELL_COMMAND_HANDLER Handler;
+ SHELL_COMMAND_GETHELP GetHelp;
+
+};
+
+extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
+
+#endif
diff --git a/MdePkg/Include/Protocol/ShellParameters.h b/MdePkg/Include/Protocol/ShellParameters.h
new file mode 100644
index 0000000..68ca9ed
--- /dev/null
+++ b/MdePkg/Include/Protocol/ShellParameters.h
@@ -0,0 +1,60 @@
+/** @file
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
+
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
+#define __EFI_SHELL_PARAMETERS_PROTOCOL__
+
+#include <Protocol/Shell.h>
+
+#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
+ { \
+ 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca } \
+ }
+
+typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
+ ///
+ /// Points to an Argc-element array of points to NULL-terminated strings containing
+ /// the command-line parameters. The first entry in the array is always the full file
+ /// path of the executable. Any quotation marks that were used to preserve
+ /// whitespace have been removed.
+ ///
+ CHAR16 **Argv;
+
+ ///
+ /// The number of elements in the Argv array.
+ ///
+ UINTN Argc;
+
+ ///
+ /// The file handle for the standard input for this executable. This may be different
+ /// from the ConInHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdIn;
+
+ ///
+ /// The file handle for the standard output for this executable. This may be different
+ /// from the ConOutHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdOut;
+
+ ///
+ /// The file handle for the standard error output for this executable. This may be
+ /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
+ ///
+ SHELL_FILE_HANDLE StdErr;
+} EFI_SHELL_PARAMETERS_PROTOCOL;
+
+extern EFI_GUID gEfiShellParametersProtocolGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index f1e5151..3e08bed 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1645,6 +1645,21 @@ [Protocols]
## Include/Protocol/EraseBlock.h
gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa, 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}
+ #
+ # Protocols defined in Shell2.0
+ #
+ ## Include/Protocol/Shell.h
+ gEfiShellProtocolGuid = { 0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }}
+
+ ## Include/Protocol/ShellParameters.h
+ gEfiShellParametersProtocolGuid = { 0x752f3136, 0x4e16, 0x4fdc, {0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca }}
+
+ #
+ # Protocols defined in Shell2.1
+ #
+ ## Include/Protocol/ShellDynamicCommand.h
+ gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
+
#
# [Error.gEfiMdePkgTokenSpaceGuid]
# 0x80000001 | Invalid value provided.
--
2.9.0.windows.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
2016-10-14 9:44 ` [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions Ruiyu Ni
@ 2016-10-14 9:44 ` Ruiyu Ni
2016-10-14 19:55 ` Leif Lindholm
2016-10-14 9:44 ` [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: " Ruiyu Ni
` (2 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Leif Lindholm, Ard Biesheuvel
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ArmPkg/Application/LinuxLoader/LinuxLoader.h b/ArmPkg/Application/LinuxLoader/LinuxLoader.h
index 8a23d7f..0d18c24 100644
--- a/ArmPkg/Application/LinuxLoader/LinuxLoader.h
+++ b/ArmPkg/Application/LinuxLoader/LinuxLoader.h
@@ -25,8 +25,8 @@
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/EfiShell.h>
+#include <Protocol/ShellParameters.h>
+#include <Protocol/Shell.h>
#include <libfdt.h>
--
2.9.0.windows.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
` (2 preceding siblings ...)
2016-10-14 9:44 ` [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg Ruiyu Ni
@ 2016-10-14 9:44 ` Ruiyu Ni
2016-10-14 19:55 ` Leif Lindholm
2016-10-14 9:44 ` [PATCH 5/5] ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter definitions Ruiyu Ni
2016-10-14 13:08 ` [PATCH 0/5] Move Shell protocol definitions to MdePkg Yao, Jiewen
5 siblings, 1 reply; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Leif Lindholm, Ard Biesheuvel
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h b/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
index d49dd42..a631f28 100644
--- a/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
+++ b/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
@@ -19,8 +19,8 @@
#include <Protocol/DevicePathToText.h>
#include <Protocol/DevicePathFromText.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellDynamicCommand.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellDynamicCommand.h>
#include <Library/DebugLib.h>
#include <Library/HiiLib.h>
--
2.9.0.windows.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/5] ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter definitions
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
` (3 preceding siblings ...)
2016-10-14 9:44 ` [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: " Ruiyu Ni
@ 2016-10-14 9:44 ` Ruiyu Ni
2016-10-14 13:08 ` [PATCH 0/5] Move Shell protocol definitions to MdePkg Yao, Jiewen
5 siblings, 0 replies; 19+ messages in thread
From: Ruiyu Ni @ 2016-10-14 9:44 UTC (permalink / raw)
To: edk2-devel; +Cc: Jaben Carsey
Remove Shell/ShellDynamicCommand/ShellParameter definitions and
update all sources to reference the ones in MdePkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
---
ShellPkg/Application/Shell/Shell.h | 5 +-
ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
ShellPkg/Include/Library/ShellLib.h | 4 +-
ShellPkg/Include/Protocol/EfiShell.h | 1138 --------------------
ShellPkg/Include/Protocol/EfiShellDynamicCommand.h | 86 --
ShellPkg/Include/Protocol/EfiShellParameters.h | 60 --
ShellPkg/Include/ShellBase.h | 149 ---
ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
.../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
.../UefiShellBcfgCommandLib.c | 5 +-
.../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
.../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
.../Library/UefiShellDebug1CommandsLib/Compress.c | 1 -
.../UefiShellDebug1CommandsLib.h | 7 +-
.../UefiShellDriver1CommandsLib.h | 7 +-
.../UefiShellLevel1CommandsLib.h | 7 +-
.../UefiShellLevel2CommandsLib.h | 7 +-
ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
.../UefiShellLevel3CommandsLib.h | 7 +-
ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
.../UefiShellNetwork1CommandsLib.h | 3 +-
.../UefiShellTftpCommandLib.h | 3 +-
ShellPkg/ShellPkg.dec | 3 -
ShellPkg/ShellPkg.dsc | 2 +
26 files changed, 45 insertions(+), 1494 deletions(-)
delete mode 100644 ShellPkg/Include/Protocol/EfiShell.h
delete mode 100644 ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
delete mode 100644 ShellPkg/Include/Protocol/EfiShellParameters.h
delete mode 100644 ShellPkg/Include/ShellBase.h
diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h
index a93ea60..25ac114 100644
--- a/ShellPkg/Application/Shell/Shell.h
+++ b/ShellPkg/Application/Shell/Shell.h
@@ -17,17 +17,16 @@
#define _SHELL_INTERNAL_HEADER_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellVariableGuid.h>
#include <Guid/ShellAliasGuid.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleTextOut.h>
-#include <Protocol/EfiShell.h>
+#include <Protocol/Shell.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/BlockIo.h>
#include <Protocol/HiiPackageList.h>
diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h
index 3ee8200..08de133 100644
--- a/ShellPkg/Include/Library/ShellCommandLib.h
+++ b/ShellPkg/Include/Library/ShellCommandLib.h
@@ -21,10 +21,9 @@
#define _SHELL_COMMAND_LIB_
#include <Uefi.h>
-#include <ShellBase.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/UnicodeCollation.h>
#include <Protocol/SimpleFileSystem.h>
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
index fafa041..9b611d8 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -21,8 +21,8 @@
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#define SHELL_FREE_NON_NULL(Pointer) \
do { \
diff --git a/ShellPkg/Include/Protocol/EfiShell.h b/ShellPkg/Include/Protocol/EfiShell.h
deleted file mode 100644
index 5c7f4f6..0000000
--- a/ShellPkg/Include/Protocol/EfiShell.h
+++ /dev/null
@@ -1,1138 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
-
- (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PROTOCOL__
-#define __EFI_SHELL_PROTOCOL__
-
-#include <ShellBase.h>
-#include <Guid/FileInfo.h>
-
-#define EFI_SHELL_PROTOCOL_GUID \
- { \
- 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
- }
-
-// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
-// they are identical outside of the name.
-typedef struct {
- LIST_ENTRY Link; ///< Linked list members.
- EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL.
- CONST CHAR16 *FullName; ///< Fully qualified filename.
- CONST CHAR16 *FileName; ///< name of this file.
- SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened file or NULL if closed.
- EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or NULL.
-} EFI_SHELL_FILE_INFO;
-
-/**
- Returns whether any script files are currently being processed.
-
- @retval TRUE There is at least one script file active.
- @retval FALSE No script files are active now.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
- VOID
- );
-
-/**
- Closes the file handle.
-
- This function closes a specified file handle. All 'dirty' cached file data is
- flushed to the device, and the file is closed. In all cases, the handle is
- closed.
-
- @param[in] FileHandle The file handle to be closed.
-
- @retval EFI_SUCCESS The file closed sucessfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CLOSE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Creates a file or directory by name.
-
- This function creates an empty new file or directory with the specified attributes and
- returns the new file's handle. If the file already exists and is read-only, then
- EFI_INVALID_PARAMETER will be returned.
-
- If the file already existed, it is truncated and its attributes updated. If the file is
- created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
-
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
-
- @param[in] FileName Pointer to NULL-terminated file path.
- @param[in] FileAttribs The new file's attrbiutes. The different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param[out] FileHandle On return, points to the created file handle or directory's handle.
-
- @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The file path could not be opened.
- @retval EFI_NOT_FOUND The specified file could not be found on the device, or could not
- file the file system on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the DirName.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CREATE_FILE)(
- IN CONST CHAR16 *FileName,
- IN UINT64 FileAttribs,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Deletes the file specified by the file handle.
-
- This function closes and deletes a file. In all cases, the file handle is closed. If the file
- cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
- handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Deletes the file specified by the file name.
-
- This function deletes a file.
-
- @param[in] FileName Points to the NULL-terminated file name.
-
- @retval EFI_SUCCESS The file was deleted.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
- IN CONST CHAR16 *FileName
- );
-
-/**
- Disables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Enables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Execute the command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
-
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
-
- The CommandLine is executed from the current working directory on the current
- device.
-
- @param[in] ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param[in] CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param[in] Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param[out] ErrorCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_EXECUTE) (
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- );
-
-/**
- Find files that match a specified pattern.
-
- This function searches for all files and directories that match the specified
- FilePattern. The FilePattern can contain wild-card characters. The resulting file
- information is placed in the file list FileList.
-
- The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
- field is set to NULL.
-
- @param[in] FilePattern Points to a NULL-terminated shell file path, including wildcards.
- @param[out] FileList On return, points to the start of a file list containing the names
- of all matching files or else points to NULL if no matching files
- were found.
-
- @retval EFI_SUCCESS Files found.
- @retval EFI_NOT_FOUND No files found.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES)(
- IN CONST CHAR16 *FilePattern,
- OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Find all files in a specified directory.
-
- @param[in] FileDirHandle Handle of the directory to search.
- @param[out] FileList On return, points to the list of files in the directory
- or NULL if there are no files in the directory.
-
- @retval EFI_SUCCESS File information was returned successfully.
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_NO_MEDIA The device media is not present.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
-IN SHELL_FILE_HANDLE FileDirHandle,
-OUT EFI_SHELL_FILE_INFO **FileList
-);
-
-/**
- Flushes data back to a device.
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The handle of the file to flush.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FLUSH_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Frees the file list.
-
- This function cleans up the file list and any related data structures. It has no
- impact on the files themselves.
-
- @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList().
-
- @retval EFI_SUCCESS Free the file list successfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Returns the current directory on the specified device.
-
- If FileSystemMapping is NULL, it returns the current working directory. If the
- FileSystemMapping is not NULL, it returns the current directory associated with the
- FileSystemMapping. In both cases, the returned name includes the file system
- mapping (i.e. fs0:\current-dir).
-
- Note that the current directory string should exclude the tailing backslash character.
-
- @param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
- then the current working directory is returned.
-
- @retval !=NULL The current directory.
- @retval NULL Current directory does not exist.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
- IN CONST CHAR16 *FileSystemMapping OPTIONAL
- );
-
-typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
-#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
-#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
-
-/**
- Gets the name of the device specified by the device handle.
-
- This function gets the user-readable name of the device specified by the device
- handle. If no user-readable name could be generated, then *BestDeviceName will be
- NULL and EFI_NOT_FOUND will be returned.
-
- If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
- device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
- DeviceHandle.
-
- If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
- device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
- If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
- EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
- EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
-
- @param[in] DeviceHandle The handle of the device.
- @param[in] Flags Determines the possible sources of component names.
- @param[in] Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M.
- @param[out] BestDeviceName On return, points to the callee-allocated NULL-
- terminated name of the device. If no device name
- could be found, points to NULL. The name must be
- freed by the caller...
-
- @retval EFI_SUCCESS Get the name successfully.
- @retval EFI_NOT_FOUND Fail to get the device name.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
- IN EFI_HANDLE DeviceHandle,
- IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
- IN CHAR8 *Language,
- OUT CHAR16 **BestDeviceName
- );
-
-/**
- Gets the device path from the mapping.
-
- This function gets the device path associated with a mapping.
-
- @param[in] Mapping A pointer to the mapping
-
- @retval !=NULL Pointer to the device path that corresponds to the
- device mapping. The returned pointer does not need
- to be freed.
- @retval NULL There is no device path associated with the
- specified mapping.
-**/
-typedef
-CONST EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Converts a file system style name to a device path.
-
- This function converts a file system style name to a device path, by replacing any
- mapping references to the associated device path.
-
- @param[in] Path The pointer to the path.
-
- @return The pointer of the file path. The file path is callee
- allocated and should be freed by the caller.
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
- IN CONST CHAR16 *Path
- );
-
-/**
- Gets either a single or list of environment variables.
-
- If name is not NULL then this function returns the current value of the specified
- environment variable.
-
- If Name is NULL than a list of all environment variable names is returned. Each a
- NULL terminated string with a double NULL terminating the list.
-
- @param[in] Name A pointer to the environment variable name. If
- Name is NULL, then the function will return all
- of the defined shell environment variables. In
- the case where multiple environment variables are
- being returned, each variable will be terminated by
- a NULL, and the list will be terminated by a double
- NULL.
-
- @return A pointer to the returned string.
- The returned pointer does not need to be freed by the caller.
-
- @retval NULL The environment variable doesn't exist or there are
- no environment variables.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ENV) (
- IN CONST CHAR16 *Name OPTIONAL
- );
-
-/**
- Gets the environment variable and Attributes, or list of environment variables. Can be
- used instead of GetEnv().
-
- This function returns the current value of the specified environment variable and
- the Attributes. If no variable name was specified, then all of the known
- variables will be returned.
-
- @param[in] Name A pointer to the environment variable name. If Name is NULL,
- then the function will return all of the defined shell
- environment variables. In the case where multiple environment
- variables are being returned, each variable will be terminated
- by a NULL, and the list will be terminated by a double NULL.
- @param[out] Attributes If not NULL, a pointer to the returned attributes bitmask for
- the environment variable. In the case where Name is NULL, and
- multiple environment variables are being returned, Attributes
- is undefined.
-
- @retval NULL The environment variable doesn't exist.
- @return The environment variable's value. The returned pointer does not
- need to be freed by the caller.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ENV_EX) (
- IN CONST CHAR16 *Name,
- OUT UINT32 *Attributes OPTIONAL
- );
-
-/**
- Gets the file information from an open file handle.
-
- This function allocates a buffer to store the file's information. It's the caller's
- responsibility to free the buffer.
-
- @param[in] FileHandle A File Handle.
-
- @retval NULL Cannot get the file info.
- @return A pointer to a buffer with file information.
-**/
-typedef
-EFI_FILE_INFO *
-(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Converts a device path to a file system-style path.
-
- This function converts a device path to a file system path by replacing part, or all, of
- the device path with the file-system mapping. If there are more than one application
- file system mappings, the one that most closely matches Path will be used.
-
- @param[in] Path The pointer to the device path.
-
- @return The pointer of the NULL-terminated file path. The path
- is callee-allocated and should be freed by the caller.
-**/
-typedef
-CHAR16 *
-(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
- );
-
-/**
- Gets a file's current position.
-
- This function returns the current file position for the file handle. For directories, the
- current file position has no meaning outside of the file system driver and as such, the
- operation is not supported.
-
- @param[in] FileHandle The file handle on which to get the current position.
- @param[out] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was accessed.
- @retval EFI_UNSUPPORTED The request is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-
-/**
- Gets the size of a file.
-
- This function returns the size of the file specified by FileHandle.
-
- @param[in] FileHandle The handle of the file.
- @param[out] Size The size of this file.
-
- @retval EFI_SUCCESS Get the file's size.
- @retval EFI_DEVICE_ERROR Can't access the file.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- Get the GUID value from a human readable name.
-
- If GuidName is a known GUID name, then update Guid to have the correct value for
- that GUID.
-
- This function is only available when the major and minor versions in the
- EfiShellProtocol are greater than or equal to 2 and 1, respectively.
-
- @param[in] GuidName A pointer to the localized name for the GUID being queried.
- @param[out] Guid A pointer to the GUID structure to be filled in.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER Guid was NULL.
- @retval EFI_INVALID_PARAMETER GuidName was NULL.
- @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
- IN CONST CHAR16 *GuidName,
- OUT EFI_GUID *Guid
- );
-
-/**
- Get the human readable name for a GUID from the value.
-
- If Guid is assigned a name, then update *GuidName to point to the name. The callee
- should not modify the value.
-
- This function is only available when the major and minor versions in the
- EfiShellProtocol are greater than or equal to 2 and 1, respectively.
-
- @param[in] Guid A pointer to the GUID being queried.
- @param[out] GuidName A pointer to a pointer the localized to name for the GUID being requested
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER Guid was NULL.
- @retval EFI_INVALID_PARAMETER GuidName was NULL.
- @retval EFI_NOT_FOUND Guid is not assigned a name.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
- IN CONST EFI_GUID *Guid,
- OUT CONST CHAR16 **GuidName
- );
-
-/**
- Return help information about a specific command.
-
- This function returns the help information for the specified command. The help text
- can be internal to the shell or can be from a UEFI Shell manual page.
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- @param[in] Command Points to the NULL-terminated UEFI Shell command name.
- @param[in] Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param[out] HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL.
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **HelpText
- );
-
-/**
- Gets the mapping(s) that most closely matches the device path.
-
- This function gets the mapping which corresponds to the device path *DevicePath. If
- there is no exact match, then the mapping which most closely matches *DevicePath
- is returned, and *DevicePath is updated to point to the remaining portion of the
- device path. If there is an exact match, the mapping is returned and *DevicePath
- points to the end-of-device-path node.
-
- If there are multiple map names they will be semi-colon seperated in the
- NULL-terminated string.
-
- @param[in, out] DevicePath On entry, points to a device path pointer. On
- exit, updates the pointer to point to the
- portion of the device path after the mapping.
-
- @retval NULL No mapping was found.
- @retval !=NULL Pointer to NULL-terminated mapping. The buffer
- is callee allocated and should be freed by the caller.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- );
-
-/**
- Gets the enable status of the page break output mode.
-
- User can use this function to determine current page break mode.
-
- @retval TRUE The page break output mode is enabled.
- @retval FALSE The page break output mode is disabled.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
- VOID
- );
-
-/**
- Judges whether the active shell is the root shell.
-
- This function makes the user to know that whether the active Shell is the root shell.
-
- @retval TRUE The active Shell is the root Shell.
- @retval FALSE The active Shell is NOT the root Shell.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
-VOID
-);
-
-/**
- Opens a file or a directory by file name.
-
- This function opens the specified file in the specified OpenMode and returns a file
- handle.
- If the file name begins with '>v', then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
- EFI_INVALID_PARAMETER is returned.
-
- If the file name is '>i', then the file handle which is returned refers to the standard
- input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is '>o', then the file handle which is returned refers to the standard
- output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is '>e', then the file handle which is returned refers to the standard
- error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is 'NUL', then the file handle that is returned refers to the standard NUL
- file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
- returned.
-
- If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
- FileHandle is NULL.
-
- @param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
- @param[out] FileHandle On return, points to the file handle.
- @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
- Specification.
- @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
- @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
- @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
- system could not be found on the device. FileHandle is NULL.
- @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported. FileHandle is NULL.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the FileName. FileHandle is NULL.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected. FileHandle is NULL.
- @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
- is NULL.
- @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode
- );
-
-/**
- Opens the files that match the path specified.
-
- This function opens all of the files specified by Path. Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
- matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
-
- @param[in] Path A pointer to the path string.
- @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE.
- @param[in, out] FileList Points to the start of a list of files opened.
-
- @retval EFI_SUCCESS Create the file list successfully.
- @return Can't create the file list.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
- IN CHAR16 *Path,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Opens the root directory of a device.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DevicePath Points to the device path corresponding to the device where the
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT)(
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Opens the root directory of a device on a handle.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DeviceHandle The handle of the device that contains the volume.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
- IN EFI_HANDLE DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Reads data from the file.
-
- If FileHandle is not a directory, the function reads the requested number of bytes
- from the file at the file's current position and returns them in Buffer. If the read goes
- beyond the end of the file, the read length is truncated to the end of the file. The file's
- current position is increased by the number of bytes returned.
- If FileHandle is a directory, then an error is returned.
-
- @param[in] FileHandle The opened file handle for read.
- @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
- @param[in, out] Buffer The buffer in which data is read.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_READ_FILE) (
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *ReadSize,
- IN OUT VOID *Buffer
- );
-
-/**
- Register a GUID and a localized human readable name for it.
-
- If Guid is not assigned a name, then assign GuidName to Guid. This list of GUID
- names must be used whenever a shell command outputs GUID information.
-
- This function is only available when the major and minor versions in the
- EfiShellProtocol are greater than or equal to 2 and 1, respectively.
-
- @param[in] Guid A pointer to the GUID being registered.
- @param[in] GuidName A pointer to the localized name for the GUID being registered.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER Guid was NULL.
- @retval EFI_INVALID_PARAMETER GuidName was NULL.
- @retval EFI_ACCESS_DENIED Guid already is assigned a name.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
- IN CONST EFI_GUID *Guid,
- IN CONST CHAR16 *GuidName
- );
-
-/**
- Deletes the duplicate file names files in the given file list.
-
- @param[in] FileList A pointer to the first entry in the file list.
-
- @retval EFI_SUCCESS Always success.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command.
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
- FALSE and the alias already exists, then the existing alias is unchanged and
- EFI_ACCESS_DENIED is returned.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
- FALSE.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ALIAS)(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias,
- IN BOOLEAN Replace,
- IN BOOLEAN Volatile
- );
-
-/**
- This function returns the command associated with a alias or a list of all
- alias'.
-
- @param[in] Alias Points to the NULL-terminated shell alias.
- If this parameter is NULL, then all
- aliases will be returned in ReturnedData.
- @param[out] Volatile Upon return of a single command if TRUE indicates
- this is stored in a volatile fashion. FALSE otherwise.
- @return If Alias is not NULL, it will return a pointer to
- the NULL-terminated command for that alias.
- If Alias is NULL, ReturnedData points to a ';'
- delimited list of alias (e.g.
- ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
- @retval NULL An error ocurred.
- @retval NULL Alias was not a valid Alias.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ALIAS)(
- IN CONST CHAR16 *Alias,
- OUT BOOLEAN *Volatile OPTIONAL
- );
-
-/**
- Changes the current directory on the specified device.
-
- If the FileSystem is NULL, and the directory Dir does not contain a file system's
- mapped name, this function changes the current working directory. If FileSystem is
- NULL and the directory Dir contains a mapped name, then the current file system and
- the current directory on that file system are changed.
-
- If FileSystem is not NULL, and Dir is NULL, then this changes the current working file
- system.
-
- If FileSystem is not NULL and Dir is not NULL, then this function changes the current
- directory on the specified file system.
-
- If the current working directory or the current working file system is changed then the
- %cwd% environment variable will be updated.
-
- @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
- directory is changed.
- @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
-
- @retval NULL Current directory does not exist.
- @return The current directory.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
- IN CONST CHAR16 *FileSystem OPTIONAL,
- IN CONST CHAR16 *Dir
- );
-
-/**
- Sets the environment variable.
-
- This function changes the current value of the specified environment variable. If the
- environment variable exists and the Value is an empty string, then the environment
- variable is deleted. If the environment variable exists and the Value is not an empty
- string, then the value of the environment variable is changed. If the environment
- variable does not exist and the Value is an empty string, there is no action. If the
- environment variable does not exist and the Value is a non-empty string, then the
- environment variable is created and assigned the specified value.
-
- For a description of volatile and non-volatile environment variables, see UEFI Shell
- 2.0 specification section 3.6.1.
-
- @param[in] Name Points to the NULL-terminated environment variable name.
- @param[in] Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ENV) (
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- );
-
-/**
- Sets the file information to an opened file handle.
-
- This function changes file information. All file information in the EFI_FILE_INFO
- struct will be updated to the passed in data.
-
- @param[in] FileHandle A file handle.
- @param[in] FileInfo Points to new file information.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
- @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of EFI_FILE_INFO.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- );
-
-/**
- Sets a file's current position.
-
- This function sets the current file position for the handle to the position supplied. With
- the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute positioning is
- supported, and seeking past the end of the file is allowed (a subsequent write would
- grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
- to be set to the end of the file.
-
- @param[in] FileHandle The file handle on which requested position will be set.
- @param[in] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- This function creates a mapping for a device path.
-
- @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
- then the mapping will be deleted.
- @param[in] Mapping Points to the NULL-terminated mapping for the device path.
-
- @retval EFI_SUCCESS Mapping created or deleted successfully.
- @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
- boot service function LocateDevicePath().
- @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_MAP)(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Writes data to the file.
-
- This function writes the specified number of bytes to the file at the current file position.
- The current file position is advanced the actual number of bytes written, which is
- returned in BufferSize. Partial writes only occur when there has been a data error
- during the write attempt (such as "volume space full"). The file automatically grows to
- hold the data, if required.
-
- Direct writes to opened directories are not supported.
-
- @param[in] FileHandle The opened file handle for writing.
- @param[in, out] BufferSize On input, size of Buffer.
- @param[in] Buffer The buffer in which data to write.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_WRITE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- );
-
-//
-// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
-// Usage of this protocol will require version checking before attempting
-// to use any new members. There is no need to check the version for
-// members that existed in UEFI Shell Spec 2.0.
-//
-// Update below for any future UEFI Shell spec changes to this protocol.
-//
-// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
-// if ((2 == gEfiShellProtocol->MajorVersion) &&
-// (0 == gEfiShellProtocol->MinorVersion)) {
-// //
-// // Cannot call:
-// // RegisterGuidName - UEFI Shell 2.1
-// // GetGuidName - UEFI Shell 2.1
-// // GetGuidFromName - UEFI Shell 2.1
-// // GetEnvEx - UEFI Shell 2.1
-// //
-// } else {
-// //
-// // Can use all members
-// //
-// }
-//
-typedef struct _EFI_SHELL_PROTOCOL {
- EFI_SHELL_EXECUTE Execute;
- EFI_SHELL_GET_ENV GetEnv;
- EFI_SHELL_SET_ENV SetEnv;
- EFI_SHELL_GET_ALIAS GetAlias;
- EFI_SHELL_SET_ALIAS SetAlias;
- EFI_SHELL_GET_HELP_TEXT GetHelpText;
- EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
- EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
- EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH GetDevicePathFromFilePath;
- EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH GetFilePathFromDevicePath;
- EFI_SHELL_SET_MAP SetMap;
- EFI_SHELL_GET_CUR_DIR GetCurDir;
- EFI_SHELL_SET_CUR_DIR SetCurDir;
- EFI_SHELL_OPEN_FILE_LIST OpenFileList;
- EFI_SHELL_FREE_FILE_LIST FreeFileList;
- EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
- EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
- EFI_SHELL_IS_ROOT_SHELL IsRootShell;
- EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
- EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
- EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
- EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
- EFI_SHELL_GET_FILE_INFO GetFileInfo;
- EFI_SHELL_SET_FILE_INFO SetFileInfo;
- EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
- EFI_SHELL_CLOSE_FILE CloseFile;
- EFI_SHELL_CREATE_FILE CreateFile;
- EFI_SHELL_READ_FILE ReadFile;
- EFI_SHELL_WRITE_FILE WriteFile;
- EFI_SHELL_DELETE_FILE DeleteFile;
- EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
- EFI_SHELL_GET_FILE_POSITION GetFilePosition;
- EFI_SHELL_SET_FILE_POSITION SetFilePosition;
- EFI_SHELL_FLUSH_FILE FlushFile;
- EFI_SHELL_FIND_FILES FindFiles;
- EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
- EFI_SHELL_GET_FILE_SIZE GetFileSize;
- EFI_SHELL_OPEN_ROOT OpenRoot;
- EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
- EFI_EVENT ExecutionBreak;
- UINT32 MajorVersion;
- UINT32 MinorVersion;
- // Added for Shell 2.1
- EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
- EFI_SHELL_GET_GUID_NAME GetGuidName;
- EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
- EFI_SHELL_GET_ENV_EX GetEnvEx;
-} EFI_SHELL_PROTOCOL;
-
-extern EFI_GUID gEfiShellProtocolGuid;
-
-enum ShellVersion {
- SHELL_MAJOR_VERSION = 2,
- SHELL_MINOR_VERSION = 1
-};
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h b/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
deleted file mode 100644
index 27e384c..0000000
--- a/ShellPkg/Include/Protocol/EfiShellDynamicCommand.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
- EFI Shell Dynamic Command registration protocol
-
- (C) Copyright 2012-2014 Hewlett-Packard Development Company, L.P.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
-#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
-
-#include <ShellBase.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/EfiShell.h>
-
-
-// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
-#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
- { \
- 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 } \
- }
-
-
-//
-// Define for forward reference.
-//
-typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
-
-
-/**
- This is the shell command handler function pointer callback type. This
- function handles the command when it is invoked in the shell.
-
- @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
- @param[in] SystemTable The pointer to the system table.
- @param[in] ShellParameters The parameters associated with the command.
- @param[in] Shell The instance of the shell protocol used in the context
- of processing this command.
-
- @return EFI_SUCCESS the operation was sucessful
- @return other the operation failed.
-**/
-typedef
-SHELL_STATUS
-(EFIAPI * SHELL_COMMAND_HANDLER)(
- IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN EFI_SHELL_PROTOCOL *Shell
- );
-
-/**
- This is the command help handler function pointer callback type. This
- function is responsible for displaying help information for the associated
- command.
-
- @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
- @param[in] Language The pointer to the language string to use.
-
- @return string Pool allocated help string, must be freed by caller
-**/
-typedef
-CHAR16*
-(EFIAPI * SHELL_COMMAND_GETHELP)(
- IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
- IN CONST CHAR8 *Language
- );
-
-/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
-struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
-
- CONST CHAR16 *CommandName;
- SHELL_COMMAND_HANDLER Handler;
- SHELL_COMMAND_GETHELP GetHelp;
-
-};
-
-extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellParameters.h b/ShellPkg/Include/Protocol/EfiShellParameters.h
deleted file mode 100644
index e52328b..0000000
--- a/ShellPkg/Include/Protocol/EfiShellParameters.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
-#define __EFI_SHELL_PARAMETERS_PROTOCOL__
-
-#include <ShellBase.h>
-
-#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
- { \
- 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca } \
- }
-
-typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
- ///
- /// Points to an Argc-element array of points to NULL-terminated strings containing
- /// the command-line parameters. The first entry in the array is always the full file
- /// path of the executable. Any quotation marks that were used to preserve
- /// whitespace have been removed.
- ///
- CHAR16 **Argv;
-
- ///
- /// The number of elements in the Argv array.
- ///
- UINTN Argc;
-
- ///
- /// The file handle for the standard input for this executable. This may be different
- /// from the ConInHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdIn;
-
- ///
- /// The file handle for the standard output for this executable. This may be different
- /// from the ConOutHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdOut;
-
- ///
- /// The file handle for the standard error output for this executable. This may be
- /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdErr;
-} EFI_SHELL_PARAMETERS_PROTOCOL;
-
-extern EFI_GUID gEfiShellParametersProtocolGuid;
-
-#endif
diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h
deleted file mode 100644
index 4b7a3d1..0000000
--- a/ShellPkg/Include/ShellBase.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/** @file
- Root include file for Shell Package modules that utilize the SHELL_RETURN type
-
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_BASE_
-#define _SHELL_BASE_
-
-typedef VOID *SHELL_FILE_HANDLE;
-
-typedef enum {
-///
-/// The operation completed successfully.
-///
-SHELL_SUCCESS = 0,
-
-///
-/// The image failed to load.
-///
-SHELL_LOAD_ERROR = 1,
-
-///
-/// The parameter was incorrect.
-///
-SHELL_INVALID_PARAMETER = 2,
-
-///
-/// The operation is not supported.
-///
-SHELL_UNSUPPORTED = 3,
-
-///
-/// The buffer was not the proper size for the request.
-///
-SHELL_BAD_BUFFER_SIZE = 4,
-
-///
-/// The buffer was not large enough to hold the requested data.
-/// The required buffer size is returned in the appropriate
-/// parameter when this error occurs.
-///
-SHELL_BUFFER_TOO_SMALL = 5,
-
-///
-/// There is no data pending upon return.
-///
-SHELL_NOT_READY = 6,
-
-///
-/// The physical device reported an error while attempting the
-/// operation.
-///
-SHELL_DEVICE_ERROR = 7,
-
-///
-/// The device cannot be written to.
-///
-SHELL_WRITE_PROTECTED = 8,
-
-///
-/// The resource has run out.
-///
-SHELL_OUT_OF_RESOURCES = 9,
-
-///
-/// An inconsistency was detected on the file system causing the
-/// operation to fail.
-///
-SHELL_VOLUME_CORRUPTED = 10,
-
-///
-/// There is no more space on the file system.
-///
-SHELL_VOLUME_FULL = 11,
-
-///
-/// The device does not contain any medium to perform the
-/// operation.
-///
-SHELL_NO_MEDIA = 12,
-
-///
-/// The medium in the device has changed since the last
-/// access.
-///
-SHELL_MEDIA_CHANGED = 13,
-
-///
-/// The item was not found.
-///
-SHELL_NOT_FOUND = 14,
-
-///
-/// Access was denied.
-///
-SHELL_ACCESS_DENIED = 15,
-
-// note the skipping of 16 and 17
-
-///
-/// A timeout time expired.
-///
-SHELL_TIMEOUT = 18,
-
-///
-/// The protocol has not been started.
-///
-SHELL_NOT_STARTED = 19,
-
-///
-/// The protocol has already been started.
-///
-SHELL_ALREADY_STARTED = 20,
-
-///
-/// The operation was aborted.
-///
-SHELL_ABORTED = 21,
-
-// note the skipping of 22, 23, and 24
-
-///
-/// A function encountered an internal version that was
-/// incompatible with a version requested by the caller.
-///
-SHELL_INCOMPATIBLE_VERSION = 25,
-
-///
-/// The function was not performed due to a security violation.
-///
-SHELL_SECURITY_VIOLATION = 26,
-
-///
-/// The function was performed and resulted in an unequal
-/// comparison..
-///
-SHELL_NOT_EQUAL = 27
-}SHELL_STATUS;
-
-#endif //__SHELL_BASE_
diff --git a/ShellPkg/Library/UefiDpLib/Dp.h b/ShellPkg/Library/UefiDpLib/Dp.h
index 72e2c3b..06fee3b 100644
--- a/ShellPkg/Library/UefiDpLib/Dp.h
+++ b/ShellPkg/Library/UefiDpLib/Dp.h
@@ -1,7 +1,7 @@
/** @file
Common declarations for the Dp Performance Reporting Utility.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -15,7 +15,6 @@
#define _EFI_APP_DP_H_
#include <Library/ShellLib.h>
-#include <ShellBase.h>
#define DP_MAJOR_VERSION 2
#define DP_MINOR_VERSION 4
diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.h b/ShellPkg/Library/UefiDpLib/UefiDpLib.h
index 3dd9ddf..283f833 100644
--- a/ShellPkg/Library/UefiDpLib/UefiDpLib.h
+++ b/ShellPkg/Library/UefiDpLib/UefiDpLib.h
@@ -1,7 +1,7 @@
/** @file
Main file for NULL named library for dp command functions.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -17,12 +17,11 @@
#define _UEFI_DP_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
extern EFI_GUID gDpHiiGuid;
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index 9a45076..ada2b4a 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -1,7 +1,7 @@
/** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database.
- Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -32,8 +32,8 @@
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePathToText.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/DriverConfiguration2.h>
@@ -136,7 +136,7 @@
#include <Protocol/IdeControllerInit.h>
#include <Protocol/DiskIo2.h>
#include <Protocol/AdapterInformation.h>
-#include <Protocol/EfiShellDynamicCommand.h>
+#include <Protocol/ShellDynamicCommand.h>
#include <Protocol/DiskInfo.h>
#include <Library/HandleParsingLib.h>
diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
index dc3714d..62a52ad 100644
--- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
+++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
@@ -15,13 +15,12 @@
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ShellLibHiiGuid.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
index 525c1f1..7fcdedb 100644
--- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
+++ b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
@@ -1,7 +1,7 @@
/** @file
Provides application point extension for "C" style main funciton
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,7 +17,7 @@
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/ShellParameters.h>
#include <Library/ShellCEntryLib.h>
#include <Library/DebugLib.h>
@@ -32,7 +32,7 @@
Note that the Shell uses POSITIVE integers for error values, while UEFI
uses NEGATIVE values. If the application is to be used within a script,
- it needs to return one of the SHELL_STATUS values defined in ShellBase.h.
+ it needs to return one of the SHELL_STATUS values defined in Protocol/Shell.h.
@param ImageHandle The image handle of the UEFI Application.
@param SystemTable A pointer to the EFI System Table.
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
index faf2f51..b998656 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
@@ -17,7 +17,6 @@
#define _UEFI_COMMAND_LIB_INTERNAL_HEADER_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/FileInfo.h>
@@ -25,11 +24,11 @@
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/UnicodeCollation.h>
#include <Protocol/BlockIo.h>
-#include <Protocol/EfiShellDynamicCommand.h>
+#include <Protocol/ShellDynamicCommand.h>
#include <Library/DevicePathLib.h>
#include <Library/SortLib.h>
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
index da8e647..736d2a3 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
@@ -18,7 +18,6 @@
**/
#include <Uefi.h>
-#include <ShellBase.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
index 4a4932e..52ea56a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
@@ -1,7 +1,7 @@
/** @file
Main file for NULL named library for Profile1 shell command functions.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,7 +16,6 @@
#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ConsoleInDevice.h>
@@ -24,8 +23,8 @@
#include <Guid/FileSystemInfo.h>
#include <Guid/ShellLibHiiGuid.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
index 7d1a601..b061243 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
@@ -1,7 +1,7 @@
/** @file
Main file for NULL named library for Profile1 shell command functions.
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,7 +16,6 @@
#define _UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ConsoleInDevice.h>
@@ -25,8 +24,8 @@
#include <IndustryStandard/Pci.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
index 292abbf..04892a6 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
@@ -1,7 +1,7 @@
/** @file
Main file for NULL named library for level 1 shell command functions.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,12 +16,11 @@
#define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellLibHiiGuid.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
index 19e46a1..c262bb5 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
@@ -9,7 +9,7 @@
* functions are non-interactive only
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,12 +24,11 @@
#define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellLibHiiGuid.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
index 5940a1e..a71ade3 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
@@ -20,7 +20,7 @@
#include <Library/ShellLib.h>
#include <Library/HandleParsingLib.h>
-#include <Protocol/EfiShellDynamicCommand.h>
+#include <Protocol/ShellDynamicCommand.h>
/**
function to insert string items into a list in the correct alphabetical place
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
index bd5b9be..be88dd5 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
@@ -1,7 +1,7 @@
/** @file
header file for NULL named library for level 3 shell command functions.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,12 +16,11 @@
#define _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellLibHiiGuid.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index a7f84a8..2389207 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -15,7 +15,6 @@
**/
#include "UefiShellLib.h"
-#include <ShellBase.h>
#include <Library/SortLib.h>
#include <Library/BaseLib.h>
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.h b/ShellPkg/Library/UefiShellLib/UefiShellLib.h
index 955f8ac..fca6b7b 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.h
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.h
@@ -2,7 +2,7 @@
Provides interface to shell functionality for shell commands and applications.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,8 +24,8 @@
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
+#include <Protocol/Shell.h>
+#include <Protocol/ShellParameters.h>
#include <Protocol/UnicodeCollation.h>
#include <Library/UefiBootServicesTableLib.h>
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
index 98b40df..2df1b54 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
@@ -1,7 +1,7 @@
/** @file
header file for NULL named library for network1 shell command functions.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,6 @@
#define _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellLibHiiGuid.h>
diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h b/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
index bef1e1d..6767f95 100644
--- a/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
+++ b/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.h
@@ -1,7 +1,7 @@
/** @file
header file for NULL named library for 'tftp' Shell command functions.
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials
@@ -18,7 +18,6 @@
#define _UEFI_SHELL_TFTP_COMMAND_LIB_H_
#include <Uefi.h>
-#include <ShellBase.h>
#include <Guid/ShellLibHiiGuid.h>
diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec
index 39f8012..bb31c2d 100644
--- a/ShellPkg/ShellPkg.dec
+++ b/ShellPkg/ShellPkg.dec
@@ -58,11 +58,8 @@ [Guids]
gShellBcfgHiiGuid = {0x5f5f605d, 0x1583, 0x4a2d, {0xa6, 0xb2, 0xeb, 0x12, 0xda, 0xb4, 0xa2, 0xb6}}
[Protocols]
- gEfiShellProtocolGuid = {0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e}}
- gEfiShellParametersProtocolGuid = {0x752f3136, 0x4e16, 0x4fdc, {0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca}}
gEfiShellEnvironment2Guid = {0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
gEfiShellInterfaceGuid = {0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
- gEfiShellDynamicCommandProtocolGuid = {0x3c7200e9, 0x005f, 0x4ea4, {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3}}
[PcdsFeatureFlag]
## This flag is used to control whether the shell includes NT32 platform Guids
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index 809bd42..6b7864b 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -84,7 +84,9 @@ [Components]
#
ShellPkg/Library/UefiShellLib/UefiShellLib.inf
ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
+ ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+ ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
--
2.9.0.windows.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 0/5] Move Shell protocol definitions to MdePkg
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
` (4 preceding siblings ...)
2016-10-14 9:44 ` [PATCH 5/5] ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter definitions Ruiyu Ni
@ 2016-10-14 13:08 ` Yao, Jiewen
2016-10-14 13:13 ` Yao, Jiewen
5 siblings, 1 reply; 19+ messages in thread
From: Yao, Jiewen @ 2016-10-14 13:08 UTC (permalink / raw)
To: Ni, Ruiyu, edk2-devel@lists.01.org
Hi
I think the requests is just to *move*.
There is no request to *rename*.
Can we just move to avoid other update?
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 5:44 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> The patches moves Shell spec defined protocol definitions to
> MdePkg and updates all references.
> Content of ShellBase.h is moved to Protocol/Shell.h and
> ShellBase.h is removed.
>
> Ruiyu Ni (5):
> ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
> MdePkg: Include Shell/ShellDynamicCommand/ShellParameters
> definitions
> ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
> EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
> ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter
> definitions
>
> ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
> EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
> .../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134
> +++++++++++++++++-
> .../Include/Protocol/ShellDynamicCommand.h | 7 +-
> .../Include/Protocol/ShellParameters.h | 4 +-
> MdePkg/MdePkg.dec | 15 ++
> ShellPkg/Application/Shell/Shell.h | 5 +-
> ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
> ShellPkg/Include/Library/ShellLib.h | 14 +-
> ShellPkg/Include/ShellBase.h | 157
> ---------------------
> ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
> ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
> .../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
> .../UefiShellBcfgCommandLib.c | 5 +-
> .../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
> .../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
> .../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
> .../UefiShellDebug1CommandsLib.h | 7 +-
> .../UefiShellDriver1CommandsLib.h | 7 +-
> .../UefiShellLevel1CommandsLib.h | 7 +-
> .../UefiShellLevel2CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
> .../UefiShellLevel3CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
> ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
> .../UefiShellNetwork1CommandsLib.h | 3 +-
> .../UefiShellTftpCommandLib.h | 3 +-
> ShellPkg/ShellPkg.dec | 3 -
> ShellPkg/ShellPkg.dsc | 2 +
> 29 files changed, 213 insertions(+), 234 deletions(-)
> rename ShellPkg/Include/Protocol/EfiShell.h =>
> MdePkg/Include/Protocol/Shell.h (92%)
> rename ShellPkg/Include/Protocol/EfiShellDynamicCommand.h =>
> MdePkg/Include/Protocol/ShellDynamicCommand.h (92%)
> rename ShellPkg/Include/Protocol/EfiShellParameters.h =>
> MdePkg/Include/Protocol/ShellParameters.h (92%)
> delete mode 100644 ShellPkg/Include/ShellBase.h
>
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/5] Move Shell protocol definitions to MdePkg
2016-10-14 13:08 ` [PATCH 0/5] Move Shell protocol definitions to MdePkg Yao, Jiewen
@ 2016-10-14 13:13 ` Yao, Jiewen
2016-10-14 16:21 ` Tim Lewis
0 siblings, 1 reply; 19+ messages in thread
From: Yao, Jiewen @ 2016-10-14 13:13 UTC (permalink / raw)
To: Yao, Jiewen, Ni, Ruiyu, edk2-devel@lists.01.org
Or if you really think we should give a better name.
My recommendation is:
1) We add content in MdePkg.
2) We can keep the old protocol file in ShellPkg, but let .h in shellPkg include the .h in MdePkg.
Then we can avoid duplicated code and make it a compatible solution to avoid other module update.
Thank you
Yao Jiewen
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Friday, October 14, 2016 9:09 PM
To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
Hi
I think the requests is just to *move*.
There is no request to *rename*.
Can we just move to avoid other update?
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 5:44 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> The patches moves Shell spec defined protocol definitions to
> MdePkg and updates all references.
> Content of ShellBase.h is moved to Protocol/Shell.h and
> ShellBase.h is removed.
>
> Ruiyu Ni (5):
> ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
> MdePkg: Include Shell/ShellDynamicCommand/ShellParameters
> definitions
> ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
> EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
> ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter
> definitions
>
> ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
> EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
> .../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134
> +++++++++++++++++-
> .../Include/Protocol/ShellDynamicCommand.h | 7 +-
> .../Include/Protocol/ShellParameters.h | 4 +-
> MdePkg/MdePkg.dec | 15 ++
> ShellPkg/Application/Shell/Shell.h | 5 +-
> ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
> ShellPkg/Include/Library/ShellLib.h | 14 +-
> ShellPkg/Include/ShellBase.h | 157
> ---------------------
> ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
> ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
> .../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
> .../UefiShellBcfgCommandLib.c | 5 +-
> .../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
> .../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
> .../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
> .../UefiShellDebug1CommandsLib.h | 7 +-
> .../UefiShellDriver1CommandsLib.h | 7 +-
> .../UefiShellLevel1CommandsLib.h | 7 +-
> .../UefiShellLevel2CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
> .../UefiShellLevel3CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
> ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
> .../UefiShellNetwork1CommandsLib.h | 3 +-
> .../UefiShellTftpCommandLib.h | 3 +-
> ShellPkg/ShellPkg.dec | 3 -
> ShellPkg/ShellPkg.dsc | 2 +
> 29 files changed, 213 insertions(+), 234 deletions(-)
> rename ShellPkg/Include/Protocol/EfiShell.h =>
> MdePkg/Include/Protocol/Shell.h (92%)
> rename ShellPkg/Include/Protocol/EfiShellDynamicCommand.h =>
> MdePkg/Include/Protocol/ShellDynamicCommand.h (92%)
> rename ShellPkg/Include/Protocol/EfiShellParameters.h =>
> MdePkg/Include/Protocol/ShellParameters.h (92%)
> delete mode 100644 ShellPkg/Include/ShellBase.h
>
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/5] Move Shell protocol definitions to MdePkg
2016-10-14 13:13 ` Yao, Jiewen
@ 2016-10-14 16:21 ` Tim Lewis
2016-10-15 13:29 ` Yao, Jiewen
0 siblings, 1 reply; 19+ messages in thread
From: Tim Lewis @ 2016-10-14 16:21 UTC (permalink / raw)
To: Yao, Jiewen, Ni, Ruiyu, edk2-devel@lists.01.org
I prefer the renamed .h file, even though I have substantial investment in the current infrastructure.
Why? Because engineers don't have time to remember "how does protocol X translate to header file Y" It should be a consistent rule. How many times have I needed to grep the header file name just because I got a build error because the rule wasn't predictable.
1) remove the EFI_ prefix and the _PROTOCOL suffix (EFI_BLOCK_IO_PROTOCOL -> BLOCK_IO
2) Convert to upper-and-lower case, BLOCK_IO -> Block_Io
3) Remove the _ (Block_Io -> BlockIo)
4) add a .h BlockIo -> BlockIo.h
Most protocol and PPI header files already follow this rule. The current header files for shell are among the few exceptions, because they don't follow this.
Tim
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Friday, October 14, 2016 6:14 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
Or if you really think we should give a better name.
My recommendation is:
1) We add content in MdePkg.
2) We can keep the old protocol file in ShellPkg, but let .h in shellPkg include the .h in MdePkg.
Then we can avoid duplicated code and make it a compatible solution to avoid other module update.
Thank you
Yao Jiewen
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Friday, October 14, 2016 9:09 PM
To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
Hi
I think the requests is just to *move*.
There is no request to *rename*.
Can we just move to avoid other update?
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 5:44 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> The patches moves Shell spec defined protocol definitions to MdePkg
> and updates all references.
> Content of ShellBase.h is moved to Protocol/Shell.h and ShellBase.h is
> removed.
>
> Ruiyu Ni (5):
> ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
> MdePkg: Include Shell/ShellDynamicCommand/ShellParameters
> definitions
> ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
> EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
> ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter
> definitions
>
> ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
> EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
> .../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134
> +++++++++++++++++-
> .../Include/Protocol/ShellDynamicCommand.h | 7 +-
> .../Include/Protocol/ShellParameters.h | 4 +-
> MdePkg/MdePkg.dec | 15 ++
> ShellPkg/Application/Shell/Shell.h | 5 +-
> ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
> ShellPkg/Include/Library/ShellLib.h | 14 +-
> ShellPkg/Include/ShellBase.h | 157
> ---------------------
> ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
> ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
> .../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
> .../UefiShellBcfgCommandLib.c | 5 +-
> .../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
> .../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
> .../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
> .../UefiShellDebug1CommandsLib.h | 7 +-
> .../UefiShellDriver1CommandsLib.h | 7 +-
> .../UefiShellLevel1CommandsLib.h | 7 +-
> .../UefiShellLevel2CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
> .../UefiShellLevel3CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
> ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
> .../UefiShellNetwork1CommandsLib.h | 3 +-
> .../UefiShellTftpCommandLib.h | 3 +-
> ShellPkg/ShellPkg.dec | 3 -
> ShellPkg/ShellPkg.dsc | 2 +
> 29 files changed, 213 insertions(+), 234 deletions(-) rename
> ShellPkg/Include/Protocol/EfiShell.h =>
> MdePkg/Include/Protocol/Shell.h (92%) rename
> ShellPkg/Include/Protocol/EfiShellDynamicCommand.h =>
> MdePkg/Include/Protocol/ShellDynamicCommand.h (92%) rename
> ShellPkg/Include/Protocol/EfiShellParameters.h =>
> MdePkg/Include/Protocol/ShellParameters.h (92%) delete mode 100644
> ShellPkg/Include/ShellBase.h
>
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
@ 2016-10-14 16:22 ` Tim Lewis
2016-10-17 16:25 ` Carsey, Jaben
1 sibling, 0 replies; 19+ messages in thread
From: Tim Lewis @ 2016-10-14 16:22 UTC (permalink / raw)
To: Ruiyu Ni, edk2-devel@lists.01.org
Cc: Jaben Carsey, Michael D Kinney, Jiewen Yao
Glad to see this is finally being done!
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Friday, October 14, 2016 2:44 AM
To: edk2-devel@lists.01.org
Cc: Jaben Carsey <jaben.carsey@intel.com>; Michael D Kinney <michael.d.kinney@intel.com>; Jiewen Yao <jiewen.yao@intel.com>
Subject: [edk2] [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
The more proper place for macro SHELL_FREE_NON_NULL is ShellLib.h instead of ShellBase.h.
Modify Compress.c to resolve build failure due to this change.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
---
ShellPkg/Include/Library/ShellLib.h | 10 +++++++++-
ShellPkg/Include/ShellBase.h | 10 +---------
ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 8 ++++----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
index fe4b9cf..fafa041 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -1,7 +1,7 @@
/** @file
Provides interface to shell functionality for shell commands and applications.
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at @@ -24,6 +24,14 @@ #include <Protocol/EfiShell.h> #include <Protocol/EfiShellParameters.h>
+#define SHELL_FREE_NON_NULL(Pointer) \
+ do { \
+ if ((Pointer) != NULL) { \
+ FreePool((Pointer)); \
+ (Pointer) = NULL; \
+ } \
+ } while(FALSE)
+
// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes) #define MAX_FILE_NAME_LEN 512
diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h index 09f87b4..4b7a3d1 100644
--- a/ShellPkg/Include/ShellBase.h
+++ b/ShellPkg/Include/ShellBase.h
@@ -1,7 +1,7 @@
/** @file
Root include file for Shell Package modules that utilize the SHELL_RETURN type
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at @@ -17,14 +17,6 @@
typedef VOID *SHELL_FILE_HANDLE;
-#define SHELL_FREE_NON_NULL(Pointer) \
- do { \
- if ((Pointer) != NULL) { \
- FreePool((Pointer)); \
- (Pointer) = NULL; \
- } \
- } while(FALSE)
-
typedef enum {
///
/// The operation completed successfully.
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
index dda2fed..da8e647 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
@@ -7,7 +7,7 @@
This sequence is further divided into Blocks and Huffman codings
are applied to each Block.
- Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at @@ -17,12 +17,12 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-
+#include <Uefi.h>
+#include <ShellBase.h>
#include <Library/MemoryAllocationLib.h> #include <Library/BaseMemoryLib.h> #include <Library/DebugLib.h> -#include <ShellBase.h> -#include <Uefi.h>
+#include <Library/ShellLib.h>
//
// Macro Definitions
--
2.9.0.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
2016-10-14 9:44 ` [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg Ruiyu Ni
@ 2016-10-14 19:55 ` Leif Lindholm
0 siblings, 0 replies; 19+ messages in thread
From: Leif Lindholm @ 2016-10-14 19:55 UTC (permalink / raw)
To: Ruiyu Ni; +Cc: edk2-devel, Ard Biesheuvel
Much as I would like to kill off the LinuxLoader, I can't just yet,
and like Tim I approve of the core change.
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
On Fri, Oct 14, 2016 at 05:44:29PM +0800, Ruiyu Ni wrote:
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPkg/Application/LinuxLoader/LinuxLoader.h b/ArmPkg/Application/LinuxLoader/LinuxLoader.h
> index 8a23d7f..0d18c24 100644
> --- a/ArmPkg/Application/LinuxLoader/LinuxLoader.h
> +++ b/ArmPkg/Application/LinuxLoader/LinuxLoader.h
> @@ -25,8 +25,8 @@
> #include <Library/UefiBootServicesTableLib.h>
> #include <Library/UefiLib.h>
>
> -#include <Protocol/EfiShellParameters.h>
> -#include <Protocol/EfiShell.h>
> +#include <Protocol/ShellParameters.h>
> +#include <Protocol/Shell.h>
>
> #include <libfdt.h>
>
> --
> 2.9.0.windows.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
2016-10-14 9:44 ` [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: " Ruiyu Ni
@ 2016-10-14 19:55 ` Leif Lindholm
0 siblings, 0 replies; 19+ messages in thread
From: Leif Lindholm @ 2016-10-14 19:55 UTC (permalink / raw)
To: Ruiyu Ni; +Cc: edk2-devel, Ard Biesheuvel
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
On Fri, Oct 14, 2016 at 05:44:30PM +0800, Ruiyu Ni wrote:
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h b/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
> index d49dd42..a631f28 100644
> --- a/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
> +++ b/EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h
> @@ -19,8 +19,8 @@
>
> #include <Protocol/DevicePathToText.h>
> #include <Protocol/DevicePathFromText.h>
> -#include <Protocol/EfiShell.h>
> -#include <Protocol/EfiShellDynamicCommand.h>
> +#include <Protocol/Shell.h>
> +#include <Protocol/ShellDynamicCommand.h>
>
> #include <Library/DebugLib.h>
> #include <Library/HiiLib.h>
> --
> 2.9.0.windows.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/5] Move Shell protocol definitions to MdePkg
2016-10-14 16:21 ` Tim Lewis
@ 2016-10-15 13:29 ` Yao, Jiewen
2016-10-17 16:30 ` Carsey, Jaben
0 siblings, 1 reply; 19+ messages in thread
From: Yao, Jiewen @ 2016-10-15 13:29 UTC (permalink / raw)
To: Tim Lewis, Ni, Ruiyu, edk2-devel@lists.01.org
Of course, it is fine to give a good name in MdePkg. :)
My concern is only about "Compatibility".
This series patch only updated ArmPkg and EmbeddedPkg.
But there might be more close source IP protected packages using the original header file.
That is why I propose a compatible way: We give a good file name in MdePkg. At same time, we can keep the old file name in ShellPkg to include the good name in MdePkg.
I recommend we give a solution to make close source package unchanged after this patch is applied.
Thank you
Yao Jiewen
From: Tim Lewis [mailto:tim.lewis@insyde.com]
Sent: Saturday, October 15, 2016 12:21 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
I prefer the renamed .h file, even though I have substantial investment in the current infrastructure.
Why? Because engineers don't have time to remember "how does protocol X translate to header file Y" It should be a consistent rule. How many times have I needed to grep the header file name just because I got a build error because the rule wasn't predictable.
1) remove the EFI_ prefix and the _PROTOCOL suffix (EFI_BLOCK_IO_PROTOCOL -> BLOCK_IO
2) Convert to upper-and-lower case, BLOCK_IO -> Block_Io
3) Remove the _ (Block_Io -> BlockIo)
4) add a .h BlockIo -> BlockIo.h
Most protocol and PPI header files already follow this rule. The current header files for shell are among the few exceptions, because they don't follow this.
Tim
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Friday, October 14, 2016 6:14 AM
To: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Ni, Ruiyu <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
Or if you really think we should give a better name.
My recommendation is:
1) We add content in MdePkg.
2) We can keep the old protocol file in ShellPkg, but let .h in shellPkg include the .h in MdePkg.
Then we can avoid duplicated code and make it a compatible solution to avoid other module update.
Thank you
Yao Jiewen
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yao, Jiewen
Sent: Friday, October 14, 2016 9:09 PM
To: Ni, Ruiyu <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
Hi
I think the requests is just to *move*.
There is no request to *rename*.
Can we just move to avoid other update?
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 5:44 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
> Subject: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> The patches moves Shell spec defined protocol definitions to MdePkg
> and updates all references.
> Content of ShellBase.h is moved to Protocol/Shell.h and ShellBase.h is
> removed.
>
> Ruiyu Ni (5):
> ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
> MdePkg: Include Shell/ShellDynamicCommand/ShellParameters
> definitions
> ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
> EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
> ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter
> definitions
>
> ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
> EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
> .../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134
> +++++++++++++++++-
> .../Include/Protocol/ShellDynamicCommand.h | 7 +-
> .../Include/Protocol/ShellParameters.h | 4 +-
> MdePkg/MdePkg.dec | 15 ++
> ShellPkg/Application/Shell/Shell.h | 5 +-
> ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
> ShellPkg/Include/Library/ShellLib.h | 14 +-
> ShellPkg/Include/ShellBase.h | 157
> ---------------------
> ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
> ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
> .../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
> .../UefiShellBcfgCommandLib.c | 5 +-
> .../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
> .../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
> .../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
> .../UefiShellDebug1CommandsLib.h | 7 +-
> .../UefiShellDriver1CommandsLib.h | 7 +-
> .../UefiShellLevel1CommandsLib.h | 7 +-
> .../UefiShellLevel2CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
> .../UefiShellLevel3CommandsLib.h | 7 +-
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
> ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
> .../UefiShellNetwork1CommandsLib.h | 3 +-
> .../UefiShellTftpCommandLib.h | 3 +-
> ShellPkg/ShellPkg.dec | 3 -
> ShellPkg/ShellPkg.dsc | 2 +
> 29 files changed, 213 insertions(+), 234 deletions(-) rename
> ShellPkg/Include/Protocol/EfiShell.h =>
> MdePkg/Include/Protocol/Shell.h (92%) rename
> ShellPkg/Include/Protocol/EfiShellDynamicCommand.h =>
> MdePkg/Include/Protocol/ShellDynamicCommand.h (92%) rename
> ShellPkg/Include/Protocol/EfiShellParameters.h =>
> MdePkg/Include/Protocol/ShellParameters.h (92%) delete mode 100644
> ShellPkg/Include/ShellBase.h
>
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
2016-10-14 16:22 ` Tim Lewis
@ 2016-10-17 16:25 ` Carsey, Jaben
1 sibling, 0 replies; 19+ messages in thread
From: Carsey, Jaben @ 2016-10-17 16:25 UTC (permalink / raw)
To: Ni, Ruiyu, edk2-devel@lists.01.org
Cc: Kinney, Michael D, Yao, Jiewen, Carsey, Jaben
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 2:44 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [edk2] [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from
> ShellBase.h to ShellLib.h
> Importance: High
>
> The more proper place for macro SHELL_FREE_NON_NULL is ShellLib.h
> instead of ShellBase.h.
>
> Modify Compress.c to resolve build failure due to this change.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> ShellPkg/Include/Library/ShellLib.h | 10 +++++++++-
> ShellPkg/Include/ShellBase.h | 10 +---------
> ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 8 ++++----
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/ShellPkg/Include/Library/ShellLib.h
> b/ShellPkg/Include/Library/ShellLib.h
> index fe4b9cf..fafa041 100644
> --- a/ShellPkg/Include/Library/ShellLib.h
> +++ b/ShellPkg/Include/Library/ShellLib.h
> @@ -1,7 +1,7 @@
> /** @file
> Provides interface to shell functionality for shell commands and
> applications.
>
> - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
> License
> which accompanies this distribution. The full text of the license may be
> found at
> @@ -24,6 +24,14 @@
> #include <Protocol/EfiShell.h>
> #include <Protocol/EfiShellParameters.h>
>
> +#define SHELL_FREE_NON_NULL(Pointer) \
> + do { \
> + if ((Pointer) != NULL) { \
> + FreePool((Pointer)); \
> + (Pointer) = NULL; \
> + } \
> + } while(FALSE)
> +
> // (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for
> bytes)
> #define MAX_FILE_NAME_LEN 512
>
> diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h
> index 09f87b4..4b7a3d1 100644
> --- a/ShellPkg/Include/ShellBase.h
> +++ b/ShellPkg/Include/ShellBase.h
> @@ -1,7 +1,7 @@
> /** @file
> Root include file for Shell Package modules that utilize the SHELL_RETURN
> type
>
> - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
> License
> which accompanies this distribution. The full text of the license may be
> found at
> @@ -17,14 +17,6 @@
>
> typedef VOID *SHELL_FILE_HANDLE;
>
> -#define SHELL_FREE_NON_NULL(Pointer) \
> - do { \
> - if ((Pointer) != NULL) { \
> - FreePool((Pointer)); \
> - (Pointer) = NULL; \
> - } \
> - } while(FALSE)
> -
> typedef enum {
> ///
> /// The operation completed successfully.
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
> index dda2fed..da8e647 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
> @@ -7,7 +7,7 @@
> This sequence is further divided into Blocks and Huffman codings
> are applied to each Block.
>
> - Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
> License
> which accompanies this distribution. The full text of the license may be
> found at
> @@ -17,12 +17,12 @@
> WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
>
> **/
> -
> +#include <Uefi.h>
> +#include <ShellBase.h>
> #include <Library/MemoryAllocationLib.h>
> #include <Library/BaseMemoryLib.h>
> #include <Library/DebugLib.h>
> -#include <ShellBase.h>
> -#include <Uefi.h>
> +#include <Library/ShellLib.h>
>
> //
> // Macro Definitions
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/5] Move Shell protocol definitions to MdePkg
2016-10-15 13:29 ` Yao, Jiewen
@ 2016-10-17 16:30 ` Carsey, Jaben
0 siblings, 0 replies; 19+ messages in thread
From: Carsey, Jaben @ 2016-10-17 16:30 UTC (permalink / raw)
To: Yao, Jiewen, Tim Lewis, Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Carsey, Jaben
Yao,
How many closed source packages are going to be working against the trunk? Don't most of those platforms already have a copy of ShellPkg and therefore they wont care?
-Jaben
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Yao, Jiewen
> Sent: Saturday, October 15, 2016 6:30 AM
> To: Tim Lewis <tim.lewis@insyde.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
> Importance: High
>
> Of course, it is fine to give a good name in MdePkg. :)
>
> My concern is only about "Compatibility".
> This series patch only updated ArmPkg and EmbeddedPkg.
> But there might be more close source IP protected packages using the
> original header file.
>
> That is why I propose a compatible way: We give a good file name in MdePkg.
> At same time, we can keep the old file name in ShellPkg to include the good
> name in MdePkg.
>
> I recommend we give a solution to make close source package unchanged
> after this patch is applied.
>
> Thank you
> Yao Jiewen
>
>
> From: Tim Lewis [mailto:tim.lewis@insyde.com]
> Sent: Saturday, October 15, 2016 12:21 AM
> To: Yao, Jiewen <jiewen.yao@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> I prefer the renamed .h file, even though I have substantial investment in
> the current infrastructure.
>
> Why? Because engineers don't have time to remember "how does protocol
> X translate to header file Y" It should be a consistent rule. How many times
> have I needed to grep the header file name just because I got a build error
> because the rule wasn't predictable.
>
> 1) remove the EFI_ prefix and the _PROTOCOL suffix
> (EFI_BLOCK_IO_PROTOCOL -> BLOCK_IO
> 2) Convert to upper-and-lower case, BLOCK_IO -> Block_Io
> 3) Remove the _ (Block_Io -> BlockIo)
> 4) add a .h BlockIo -> BlockIo.h
>
> Most protocol and PPI header files already follow this rule. The current
> header files for shell are among the few exceptions, because they don't
> follow this.
>
> Tim
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Yao, Jiewen
> Sent: Friday, October 14, 2016 6:14 AM
> To: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>;
> Ni, Ruiyu <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>>; edk2-
> devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> Or if you really think we should give a better name.
>
> My recommendation is:
>
> 1) We add content in MdePkg.
>
> 2) We can keep the old protocol file in ShellPkg, but let .h in shellPkg
> include the .h in MdePkg.
>
> Then we can avoid duplicated code and make it a compatible solution to
> avoid other module update.
>
> Thank you
> Yao Jiewen
>
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Yao, Jiewen
> Sent: Friday, October 14, 2016 9:09 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>>; edk2-
> devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: Re: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
>
> Hi
> I think the requests is just to *move*.
>
> There is no request to *rename*.
>
> Can we just move to avoid other update?
>
>
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Ruiyu Ni
> > Sent: Friday, October 14, 2016 5:44 PM
> > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-
> devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
> > Subject: [edk2] [PATCH 0/5] Move Shell protocol definitions to MdePkg
> >
> > The patches moves Shell spec defined protocol definitions to MdePkg
> > and updates all references.
> > Content of ShellBase.h is moved to Protocol/Shell.h and ShellBase.h is
> > removed.
> >
> > Ruiyu Ni (5):
> > ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h
> > MdePkg: Include Shell/ShellDynamicCommand/ShellParameters
> > definitions
> > ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg
> > EmbeddedPkg/FdtPlatformDxe: Reference Shell protocols in MdePkg
> > ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter
> > definitions
> >
> > ArmPkg/Application/LinuxLoader/LinuxLoader.h | 4 +-
> > EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatform.h | 4 +-
> > .../EfiShell.h => MdePkg/Include/Protocol/Shell.h | 134
> > +++++++++++++++++-
> > .../Include/Protocol/ShellDynamicCommand.h | 7 +-
> > .../Include/Protocol/ShellParameters.h | 4 +-
> > MdePkg/MdePkg.dec | 15 ++
> > ShellPkg/Application/Shell/Shell.h | 5 +-
> > ShellPkg/Include/Library/ShellCommandLib.h | 5 +-
> > ShellPkg/Include/Library/ShellLib.h | 14 +-
> > ShellPkg/Include/ShellBase.h | 157
> > ---------------------
> > ShellPkg/Library/UefiDpLib/Dp.h | 3 +-
> > ShellPkg/Library/UefiDpLib/UefiDpLib.h | 7 +-
> > .../UefiHandleParsingLib/UefiHandleParsingLib.h | 8 +-
> > .../UefiShellBcfgCommandLib.c | 5 +-
> > .../UefiShellCEntryLib/UefiShellCEntryLib.c | 6 +-
> > .../UefiShellCommandLib/UefiShellCommandLib.h | 7 +-
> > .../Library/UefiShellDebug1CommandsLib/Compress.c | 7 +-
> > .../UefiShellDebug1CommandsLib.h | 7 +-
> > .../UefiShellDriver1CommandsLib.h | 7 +-
> > .../UefiShellLevel1CommandsLib.h | 7 +-
> > .../UefiShellLevel2CommandsLib.h | 7 +-
> > ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 2 +-
> > .../UefiShellLevel3CommandsLib.h | 7 +-
> > ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 -
> > ShellPkg/Library/UefiShellLib/UefiShellLib.h | 6 +-
> > .../UefiShellNetwork1CommandsLib.h | 3 +-
> > .../UefiShellTftpCommandLib.h | 3 +-
> > ShellPkg/ShellPkg.dec | 3 -
> > ShellPkg/ShellPkg.dsc | 2 +
> > 29 files changed, 213 insertions(+), 234 deletions(-) rename
> > ShellPkg/Include/Protocol/EfiShell.h =>
> > MdePkg/Include/Protocol/Shell.h (92%) rename
> > ShellPkg/Include/Protocol/EfiShellDynamicCommand.h =>
> > MdePkg/Include/Protocol/ShellDynamicCommand.h (92%) rename
> > ShellPkg/Include/Protocol/EfiShellParameters.h =>
> > MdePkg/Include/Protocol/ShellParameters.h (92%) delete mode 100644
> > ShellPkg/Include/ShellBase.h
> >
> > --
> > 2.9.0.windows.1
> >
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-
> devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
> > https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org<mailto:edk2-
> devel@lists.01.org%3cmailto:edk2-devel@lists.01.org>>
> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
2016-10-14 9:44 ` [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions Ruiyu Ni
@ 2016-10-17 18:02 ` Carsey, Jaben
2016-10-18 5:56 ` Ni, Ruiyu
0 siblings, 1 reply; 19+ messages in thread
From: Carsey, Jaben @ 2016-10-17 18:02 UTC (permalink / raw)
To: Ni, Ruiyu, edk2-devel@lists.01.org
Cc: Kinney, Michael D, Yao, Jiewen, Carsey, Jaben
Can we do a GIT move operation and then merge the content from ShellBase.h please? I do not want to lose the file history information.
When we move by "delete" then "add" we lose everything for no reason.
-Jaben
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Friday, October 14, 2016 2:44 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [edk2] [PATCH 2/5] MdePkg: Include
> Shell/ShellDynamicCommand/ShellParameters definitions
> Importance: High
>
> Copy Shell/ShellDynamicCommand/ShellParameters definitions from
> ShellPkg to MdePkg.
> Content of ShellBase.h is moved to Protocol/Shell.h.
>
> The following patches will update ShellPkg to reference all protocol
> definition to MdePkg.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> MdePkg/Include/Protocol/Shell.h | 1268
> +++++++++++++++++++++++++
> MdePkg/Include/Protocol/ShellDynamicCommand.h | 85 ++
> MdePkg/Include/Protocol/ShellParameters.h | 60 ++
> MdePkg/MdePkg.dec | 15 +
> 4 files changed, 1428 insertions(+)
> create mode 100644 MdePkg/Include/Protocol/Shell.h
> create mode 100644 MdePkg/Include/Protocol/ShellDynamicCommand.h
> create mode 100644 MdePkg/Include/Protocol/ShellParameters.h
>
> diff --git a/MdePkg/Include/Protocol/Shell.h
> b/MdePkg/Include/Protocol/Shell.h
> new file mode 100644
> index 0000000..cc1fbdc
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/Shell.h
> @@ -0,0 +1,1268 @@
> +/** @file
> + EFI Shell protocol as defined in the UEFI Shell 2.0 specification including
> errata.
> +
> + (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> + This program and the accompanying materials
> + are licensed and made available under the terms and conditions of the BSD
> License
> + which accompanies this distribution. The full text of the license may be
> found at
> + http://opensource.org/licenses/bsd-license.php
> +
> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef __EFI_SHELL_PROTOCOL__
> +#define __EFI_SHELL_PROTOCOL__
> +
> +#include <Guid/FileInfo.h>
> +
> +#define EFI_SHELL_PROTOCOL_GUID \
> + { \
> + 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e
> } \
> + }
> +typedef VOID *SHELL_FILE_HANDLE;
> +
> +typedef enum {
> + ///
> + /// The operation completed successfully.
> + ///
> + SHELL_SUCCESS = 0,
> +
> + ///
> + /// The image failed to load.
> + ///
> + SHELL_LOAD_ERROR = 1,
> +
> + ///
> + /// The parameter was incorrect.
> + ///
> + SHELL_INVALID_PARAMETER = 2,
> +
> + ///
> + /// The operation is not supported.
> + ///
> + SHELL_UNSUPPORTED = 3,
> +
> + ///
> + /// The buffer was not the proper size for the request.
> + ///
> + SHELL_BAD_BUFFER_SIZE = 4,
> +
> + ///
> + /// The buffer was not large enough to hold the requested data.
> + /// The required buffer size is returned in the appropriate
> + /// parameter when this error occurs.
> + ///
> + SHELL_BUFFER_TOO_SMALL = 5,
> +
> + ///
> + /// There is no data pending upon return.
> + ///
> + SHELL_NOT_READY = 6,
> +
> + ///
> + /// The physical device reported an error while attempting the
> + /// operation.
> + ///
> + SHELL_DEVICE_ERROR = 7,
> +
> + ///
> + /// The device cannot be written to.
> + ///
> + SHELL_WRITE_PROTECTED = 8,
> +
> + ///
> + /// The resource has run out.
> + ///
> + SHELL_OUT_OF_RESOURCES = 9,
> +
> + ///
> + /// An inconsistency was detected on the file system causing the
> + /// operation to fail.
> + ///
> + SHELL_VOLUME_CORRUPTED = 10,
> +
> + ///
> + /// There is no more space on the file system.
> + ///
> + SHELL_VOLUME_FULL = 11,
> +
> + ///
> + /// The device does not contain any medium to perform the
> + /// operation.
> + ///
> + SHELL_NO_MEDIA = 12,
> +
> + ///
> + /// The medium in the device has changed since the last
> + /// access.
> + ///
> + SHELL_MEDIA_CHANGED = 13,
> +
> + ///
> + /// The item was not found.
> + ///
> + SHELL_NOT_FOUND = 14,
> +
> + ///
> + /// Access was denied.
> + ///
> + SHELL_ACCESS_DENIED = 15,
> +
> + // note the skipping of 16 and 17
> +
> + ///
> + /// A timeout time expired.
> + ///
> + SHELL_TIMEOUT = 18,
> +
> + ///
> + /// The protocol has not been started.
> + ///
> + SHELL_NOT_STARTED = 19,
> +
> + ///
> + /// The protocol has already been started.
> + ///
> + SHELL_ALREADY_STARTED = 20,
> +
> + ///
> + /// The operation was aborted.
> + ///
> + SHELL_ABORTED = 21,
> +
> + // note the skipping of 22, 23, and 24
> +
> + ///
> + /// A function encountered an internal version that was
> + /// incompatible with a version requested by the caller.
> + ///
> + SHELL_INCOMPATIBLE_VERSION = 25,
> +
> + ///
> + /// The function was not performed due to a security violation.
> + ///
> + SHELL_SECURITY_VIOLATION = 26,
> +
> + ///
> + /// The function was performed and resulted in an unequal
> + /// comparison..
> + ///
> + SHELL_NOT_EQUAL = 27
> +} SHELL_STATUS;
> +
> +
> +// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
> +// they are identical outside of the name.
> +typedef struct {
> + LIST_ENTRY Link; ///< Linked list members.
> + EFI_STATUS Status; ///< Status of opening the file. Valid only if
> Handle != NULL.
> + CONST CHAR16 *FullName; ///< Fully qualified filename.
> + CONST CHAR16 *FileName; ///< name of this file.
> + SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened
> file or NULL if closed.
> + EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or
> NULL.
> +} EFI_SHELL_FILE_INFO;
> +
> +/**
> + Returns whether any script files are currently being processed.
> +
> + @retval TRUE There is at least one script file active.
> + @retval FALSE No script files are active now.
> +
> +**/
> +typedef
> +BOOLEAN
> +(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
> + VOID
> + );
> +
> +/**
> + Closes the file handle.
> +
> + This function closes a specified file handle. All 'dirty' cached file data is
> + flushed to the device, and the file is closed. In all cases, the handle is
> + closed.
> +
> + @param[in] FileHandle The file handle to be closed.
> +
> + @retval EFI_SUCCESS The file closed sucessfully.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_CLOSE_FILE)(
> + IN SHELL_FILE_HANDLE FileHandle
> + );
> +
> +/**
> + Creates a file or directory by name.
> +
> + This function creates an empty new file or directory with the specified
> attributes and
> + returns the new file's handle. If the file already exists and is read-only,
> then
> + EFI_INVALID_PARAMETER will be returned.
> +
> + If the file already existed, it is truncated and its attributes updated. If the
> file is
> + created successfully, the FileHandle is the file's handle, else, the FileHandle
> is NULL.
> +
> + If the file name begins with >v, then the file handle which is returned
> refers to the
> + shell environment variable with the specified name. If the shell
> environment variable
> + already exists and is non-volatile then EFI_INVALID_PARAMETER is
> returned.
> +
> + @param[in] FileName Pointer to NULL-terminated file path.
> + @param[in] FileAttribs The new file's attrbiutes. The different
> attributes are
> + described in EFI_FILE_PROTOCOL.Open().
> + @param[out] FileHandle On return, points to the created file handle or
> directory's handle.
> +
> + @retval EFI_SUCCESS The file was opened. FileHandle points to the
> new file's handle.
> + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> value.
> + @retval EFI_UNSUPPORTED The file path could not be opened.
> + @retval EFI_NOT_FOUND The specified file could not be found on the
> device, or could not
> + file the file system on the device.
> + @retval EFI_NO_MEDIA The device has no medium.
> + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> or the medium is no
> + longer supported.
> + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> the file path according
> + the DirName.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> + @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or
> open a file for write
> + when the media is write-protected.
> + @retval EFI_ACCESS_DENIED The service denied access to the file.
> + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> to open the file.
> + @retval EFI_VOLUME_FULL The volume is full.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_CREATE_FILE)(
> + IN CONST CHAR16 *FileName,
> + IN UINT64 FileAttribs,
> + OUT SHELL_FILE_HANDLE *FileHandle
> + );
> +
> +/**
> + Deletes the file specified by the file handle.
> +
> + This function closes and deletes a file. In all cases, the file handle is closed.
> If the file
> + cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
> returned, but the
> + handle is still closed.
> +
> + @param[in] FileHandle The file handle to delete.
> +
> + @retval EFI_SUCCESS The file was closed and deleted and the handle
> was closed.
> + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> was not deleted.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_DELETE_FILE)(
> + IN SHELL_FILE_HANDLE FileHandle
> + );
> +
> +/**
> + Deletes the file specified by the file name.
> +
> + This function deletes a file.
> +
> + @param[in] FileName Points to the NULL-terminated file name.
> +
> + @retval EFI_SUCCESS The file was deleted.
> + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> was not deleted.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
> + IN CONST CHAR16 *FileName
> + );
> +
> +/**
> + Disables the page break output mode.
> +**/
> +typedef
> +VOID
> +(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
> + VOID
> + );
> +
> +/**
> + Enables the page break output mode.
> +**/
> +typedef
> +VOID
> +(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
> + VOID
> + );
> +
> +/**
> + Execute the command line.
> +
> + This function creates a nested instance of the shell and executes the
> specified
> + command (CommandLine) with the specified environment (Environment).
> Upon return,
> + the status code returned by the specified command is placed in
> StatusCode.
> +
> + If Environment is NULL, then the current environment is used and all
> changes made
> + by the commands executed will be reflected in the current environment. If
> the
> + Environment is non-NULL, then the changes made will be discarded.
> +
> + The CommandLine is executed from the current working directory on the
> current
> + device.
> +
> + @param[in] ParentImageHandle A handle of the image that is executing
> the specified
> + command line.
> + @param[in] CommandLine Points to the NULL-terminated UCS-2
> encoded string
> + containing the command line. If NULL then the command-
> + line will be empty.
> + @param[in] Environment Points to a NULL-terminated array of
> environment
> + variables with the format 'x=y', where x is the
> + environment variable name and y is the value. If this
> + is NULL, then the current shell environment is used.
> + @param[out] ErrorCode Points to the status code returned by the
> command.
> +
> + @retval EFI_SUCCESS The command executed successfully. The
> status code
> + returned by the command is pointed to by StatusCode.
> + @retval EFI_INVALID_PARAMETER The parameters are invalid.
> + @retval EFI_OUT_OF_RESOURCES Out of resources.
> + @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_EXECUTE) (
> + IN EFI_HANDLE *ParentImageHandle,
> + IN CHAR16 *CommandLine OPTIONAL,
> + IN CHAR16 **Environment OPTIONAL,
> + OUT EFI_STATUS *StatusCode OPTIONAL
> + );
> +
> +/**
> + Find files that match a specified pattern.
> +
> + This function searches for all files and directories that match the specified
> + FilePattern. The FilePattern can contain wild-card characters. The resulting
> file
> + information is placed in the file list FileList.
> +
> + The files in the file list are not opened. The OpenMode field is set to 0 and
> the FileInfo
> + field is set to NULL.
> +
> + @param[in] FilePattern Points to a NULL-terminated shell file path,
> including wildcards.
> + @param[out] FileList On return, points to the start of a file list
> containing the names
> + of all matching files or else points to NULL if no matching
> files
> + were found.
> +
> + @retval EFI_SUCCESS Files found.
> + @retval EFI_NOT_FOUND No files found.
> + @retval EFI_NO_MEDIA The device has no media.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_FIND_FILES)(
> + IN CONST CHAR16 *FilePattern,
> + OUT EFI_SHELL_FILE_INFO **FileList
> + );
> +
> +/**
> + Find all files in a specified directory.
> +
> + @param[in] FileDirHandle Handle of the directory to search.
> + @param[out] FileList On return, points to the list of files in the
> directory
> + or NULL if there are no files in the directory.
> +
> + @retval EFI_SUCCESS File information was returned successfully.
> + @retval EFI_VOLUME_CORRUPTED The file system structures have been
> corrupted.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_NO_MEDIA The device media is not present.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
> +IN SHELL_FILE_HANDLE FileDirHandle,
> +OUT EFI_SHELL_FILE_INFO **FileList
> +);
> +
> +/**
> + Flushes data back to a device.
> +
> + This function flushes all modified data associated with a file to a device.
> +
> + @param[in] FileHandle The handle of the file to flush.
> +
> + @retval EFI_SUCCESS The data was flushed.
> + @retval EFI_NO_MEDIA The device has no medium.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> + @retval EFI_ACCESS_DENIED The file was opened read-only.
> + @retval EFI_VOLUME_FULL The volume is full.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_FLUSH_FILE)(
> + IN SHELL_FILE_HANDLE FileHandle
> + );
> +
> +/**
> + Frees the file list.
> +
> + This function cleans up the file list and any related data structures. It has no
> + impact on the files themselves.
> +
> + @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
> + defined in OpenFileList().
> +
> + @retval EFI_SUCCESS Free the file list successfully.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
> + IN EFI_SHELL_FILE_INFO **FileList
> + );
> +
> +/**
> + Returns the current directory on the specified device.
> +
> + If FileSystemMapping is NULL, it returns the current working directory. If
> the
> + FileSystemMapping is not NULL, it returns the current directory associated
> with the
> + FileSystemMapping. In both cases, the returned name includes the file
> system
> + mapping (i.e. fs0:\current-dir).
> +
> + Note that the current directory string should exclude the tailing backslash
> character.
> +
> + @param[in] FileSystemMapping A pointer to the file system mapping. If
> NULL,
> + then the current working directory is returned.
> +
> + @retval !=NULL The current directory.
> + @retval NULL Current directory does not exist.
> +**/
> +typedef
> +CONST CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
> + IN CONST CHAR16 *FileSystemMapping OPTIONAL
> + );
> +
> +typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
> +#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
> +#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
> +
> +/**
> + Gets the name of the device specified by the device handle.
> +
> + This function gets the user-readable name of the device specified by the
> device
> + handle. If no user-readable name could be generated, then
> *BestDeviceName will be
> + NULL and EFI_NOT_FOUND will be returned.
> +
> + If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function
> will return the
> + device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present
> on
> + DeviceHandle.
> +
> + If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will
> return the
> + device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on
> DeviceHandle.
> + If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
> + EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
> + EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
> +
> + @param[in] DeviceHandle The handle of the device.
> + @param[in] Flags Determines the possible sources of component
> names.
> + @param[in] Language A pointer to the language specified for the
> device
> + name, in the same format as described in the UEFI
> + specification, Appendix M.
> + @param[out] BestDeviceName On return, points to the callee-allocated
> NULL-
> + terminated name of the device. If no device name
> + could be found, points to NULL. The name must be
> + freed by the caller...
> +
> + @retval EFI_SUCCESS Get the name successfully.
> + @retval EFI_NOT_FOUND Fail to get the device name.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
> + IN EFI_HANDLE DeviceHandle,
> + IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
> + IN CHAR8 *Language,
> + OUT CHAR16 **BestDeviceName
> + );
> +
> +/**
> + Gets the device path from the mapping.
> +
> + This function gets the device path associated with a mapping.
> +
> + @param[in] Mapping A pointer to the mapping
> +
> + @retval !=NULL Pointer to the device path that corresponds to the
> + device mapping. The returned pointer does not need
> + to be freed.
> + @retval NULL There is no device path associated with the
> + specified mapping.
> +**/
> +typedef
> +CONST EFI_DEVICE_PATH_PROTOCOL *
> +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
> + IN CONST CHAR16 *Mapping
> + );
> +
> +/**
> + Converts a file system style name to a device path.
> +
> + This function converts a file system style name to a device path, by
> replacing any
> + mapping references to the associated device path.
> +
> + @param[in] Path The pointer to the path.
> +
> + @return The pointer of the file path. The file path is callee
> + allocated and should be freed by the caller.
> +**/
> +typedef
> +EFI_DEVICE_PATH_PROTOCOL *
> +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
> + IN CONST CHAR16 *Path
> + );
> +
> +/**
> + Gets either a single or list of environment variables.
> +
> + If name is not NULL then this function returns the current value of the
> specified
> + environment variable.
> +
> + If Name is NULL than a list of all environment variable names is returned.
> Each a
> + NULL terminated string with a double NULL terminating the list.
> +
> + @param[in] Name A pointer to the environment variable name. If
> + Name is NULL, then the function will return all
> + of the defined shell environment variables. In
> + the case where multiple environment variables are
> + being returned, each variable will be terminated by
> + a NULL, and the list will be terminated by a double
> + NULL.
> +
> + @return A pointer to the returned string.
> + The returned pointer does not need to be freed by the
> caller.
> +
> + @retval NULL The environment variable doesn't exist or there are
> + no environment variables.
> +**/
> +typedef
> +CONST CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_ENV) (
> + IN CONST CHAR16 *Name OPTIONAL
> + );
> +
> +/**
> + Gets the environment variable and Attributes, or list of environment
> variables. Can be
> + used instead of GetEnv().
> +
> + This function returns the current value of the specified environment
> variable and
> + the Attributes. If no variable name was specified, then all of the known
> + variables will be returned.
> +
> + @param[in] Name A pointer to the environment variable name. If
> Name is NULL,
> + then the function will return all of the defined shell
> + environment variables. In the case where multiple
> environment
> + variables are being returned, each variable will be
> terminated
> + by a NULL, and the list will be terminated by a double NULL.
> + @param[out] Attributes If not NULL, a pointer to the returned
> attributes bitmask for
> + the environment variable. In the case where Name is NULL,
> and
> + multiple environment variables are being returned,
> Attributes
> + is undefined.
> +
> + @retval NULL The environment variable doesn't exist.
> + @return The environment variable's value. The returned
> pointer does not
> + need to be freed by the caller.
> +**/
> +typedef
> +CONST CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_ENV_EX) (
> + IN CONST CHAR16 *Name,
> + OUT UINT32 *Attributes OPTIONAL
> + );
> +
> +/**
> + Gets the file information from an open file handle.
> +
> + This function allocates a buffer to store the file's information. It's the
> caller's
> + responsibility to free the buffer.
> +
> + @param[in] FileHandle A File Handle.
> +
> + @retval NULL Cannot get the file info.
> + @return A pointer to a buffer with file information.
> +**/
> +typedef
> +EFI_FILE_INFO *
> +(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
> + IN SHELL_FILE_HANDLE FileHandle
> + );
> +
> +/**
> + Converts a device path to a file system-style path.
> +
> + This function converts a device path to a file system path by replacing part,
> or all, of
> + the device path with the file-system mapping. If there are more than one
> application
> + file system mappings, the one that most closely matches Path will be used.
> +
> + @param[in] Path The pointer to the device path.
> +
> + @return The pointer of the NULL-terminated file path. The path
> + is callee-allocated and should be freed by the caller.
> +**/
> +typedef
> +CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
> + IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
> + );
> +
> +/**
> + Gets a file's current position.
> +
> + This function returns the current file position for the file handle. For
> directories, the
> + current file position has no meaning outside of the file system driver and
> as such, the
> + operation is not supported.
> +
> + @param[in] FileHandle The file handle on which to get the current
> position.
> + @param[out] Position Byte position from the start of the file.
> +
> + @retval EFI_SUCCESS Data was accessed.
> + @retval EFI_UNSUPPORTED The request is not valid on open
> directories.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
> + IN SHELL_FILE_HANDLE FileHandle,
> + OUT UINT64 *Position
> + );
> +
> +/**
> + Gets the size of a file.
> +
> + This function returns the size of the file specified by FileHandle.
> +
> + @param[in] FileHandle The handle of the file.
> + @param[out] Size The size of this file.
> +
> + @retval EFI_SUCCESS Get the file's size.
> + @retval EFI_DEVICE_ERROR Can't access the file.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
> + IN SHELL_FILE_HANDLE FileHandle,
> + OUT UINT64 *Size
> + );
> +
> +/**
> + Get the GUID value from a human readable name.
> +
> + If GuidName is a known GUID name, then update Guid to have the correct
> value for
> + that GUID.
> +
> + This function is only available when the major and minor versions in the
> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> +
> + @param[in] GuidName A pointer to the localized name for the GUID
> being queried.
> + @param[out] Guid A pointer to the GUID structure to be filled in.
> +
> + @retval EFI_SUCCESS The operation was successful.
> + @retval EFI_INVALID_PARAMETER Guid was NULL.
> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> + @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
> + IN CONST CHAR16 *GuidName,
> + OUT EFI_GUID *Guid
> + );
> +
> +/**
> + Get the human readable name for a GUID from the value.
> +
> + If Guid is assigned a name, then update *GuidName to point to the name.
> The callee
> + should not modify the value.
> +
> + This function is only available when the major and minor versions in the
> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> +
> + @param[in] Guid A pointer to the GUID being queried.
> + @param[out] GuidName A pointer to a pointer the localized to name for
> the GUID being requested
> +
> + @retval EFI_SUCCESS The operation was successful.
> + @retval EFI_INVALID_PARAMETER Guid was NULL.
> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> + @retval EFI_NOT_FOUND Guid is not assigned a name.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
> + IN CONST EFI_GUID *Guid,
> + OUT CONST CHAR16 **GuidName
> + );
> +
> +/**
> + Return help information about a specific command.
> +
> + This function returns the help information for the specified command. The
> help text
> + can be internal to the shell or can be from a UEFI Shell manual page.
> +
> + If Sections is specified, then each section name listed will be compared in a
> casesensitive
> + manner, to the section names described in Appendix B. If the section
> exists,
> + it will be appended to the returned help text. If the section does not exist,
> no
> + information will be returned. If Sections is NULL, then all help text
> information
> + available will be returned.
> +
> + @param[in] Command Points to the NULL-terminated UEFI Shell
> command name.
> + @param[in] Sections Points to the NULL-terminated comma-
> delimited
> + section names to return. If NULL, then all
> + sections will be returned.
> + @param[out] HelpText On return, points to a callee-allocated buffer
> + containing all specified help text.
> +
> + @retval EFI_SUCCESS The help text was returned.
> + @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be
> allocated to hold the
> + returned help text.
> + @retval EFI_INVALID_PARAMETER HelpText is NULL.
> + @retval EFI_NOT_FOUND There is no help text available for
> Command.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
> + IN CONST CHAR16 *Command,
> + IN CONST CHAR16 *Sections OPTIONAL,
> + OUT CHAR16 **HelpText
> + );
> +
> +/**
> + Gets the mapping(s) that most closely matches the device path.
> +
> + This function gets the mapping which corresponds to the device path
> *DevicePath. If
> + there is no exact match, then the mapping which most closely matches
> *DevicePath
> + is returned, and *DevicePath is updated to point to the remaining portion
> of the
> + device path. If there is an exact match, the mapping is returned and
> *DevicePath
> + points to the end-of-device-path node.
> +
> + If there are multiple map names they will be semi-colon seperated in the
> + NULL-terminated string.
> +
> + @param[in, out] DevicePath On entry, points to a device path pointer.
> On
> + exit, updates the pointer to point to the
> + portion of the device path after the mapping.
> +
> + @retval NULL No mapping was found.
> + @retval !=NULL Pointer to NULL-terminated mapping. The buffer
> + is callee allocated and should be freed by the caller.
> +**/
> +typedef
> +CONST CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
> + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
> + );
> +
> +/**
> + Gets the enable status of the page break output mode.
> +
> + User can use this function to determine current page break mode.
> +
> + @retval TRUE The page break output mode is enabled.
> + @retval FALSE The page break output mode is disabled.
> +**/
> +typedef
> +BOOLEAN
> +(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
> + VOID
> + );
> +
> +/**
> + Judges whether the active shell is the root shell.
> +
> + This function makes the user to know that whether the active Shell is the
> root shell.
> +
> + @retval TRUE The active Shell is the root Shell.
> + @retval FALSE The active Shell is NOT the root Shell.
> +**/
> +typedef
> +BOOLEAN
> +(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
> +VOID
> +);
> +
> +/**
> + Opens a file or a directory by file name.
> +
> + This function opens the specified file in the specified OpenMode and
> returns a file
> + handle.
> + If the file name begins with '>v', then the file handle which is returned
> refers to the
> + shell environment variable with the specified name. If the shell
> environment variable
> + exists, is non-volatile and the OpenMode indicates
> EFI_FILE_MODE_WRITE, then
> + EFI_INVALID_PARAMETER is returned.
> +
> + If the file name is '>i', then the file handle which is returned refers to the
> standard
> + input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then
> EFI_INVALID_PARAMETER
> + is returned.
> +
> + If the file name is '>o', then the file handle which is returned refers to the
> standard
> + output. If the OpenMode indicates EFI_FILE_MODE_READ, then
> EFI_INVALID_PARAMETER
> + is returned.
> +
> + If the file name is '>e', then the file handle which is returned refers to the
> standard
> + error. If the OpenMode indicates EFI_FILE_MODE_READ, then
> EFI_INVALID_PARAMETER
> + is returned.
> +
> + If the file name is 'NUL', then the file handle that is returned refers to the
> standard NUL
> + file. If the OpenMode indicates EFI_FILE_MODE_READ, then
> EFI_INVALID_PARAMETER is
> + returned.
> +
> + If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
> + FileHandle is NULL.
> +
> + @param[in] FileName Points to the NULL-terminated UCS-2 encoded
> file name.
> + @param[out] FileHandle On return, points to the file handle.
> + @param[in] OpenMode File open mode. Either
> EFI_FILE_MODE_READ or
> + EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
> + Specification.
> + @retval EFI_SUCCESS The file was opened. FileHandle has the
> opened file's handle.
> + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> value. FileHandle is NULL.
> + @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is
> NULL.
> + @retval EFI_NOT_FOUND The specified file could not be found on the
> device or the file
> + system could not be found on the device. FileHandle is
> NULL.
> + @retval EFI_NO_MEDIA The device has no medium. FileHandle is
> NULL.
> + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> or the medium is no
> + longer supported. FileHandle is NULL.
> + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> the file path according
> + the FileName. FileHandle is NULL.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted. FileHandle is NULL.
> + @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or
> open a file for write
> + when the media is write-protected. FileHandle is NULL.
> + @retval EFI_ACCESS_DENIED The service denied access to the file.
> FileHandle is NULL.
> + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> to open the file. FileHandle
> + is NULL.
> + @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
> + IN CONST CHAR16 *FileName,
> + OUT SHELL_FILE_HANDLE *FileHandle,
> + IN UINT64 OpenMode
> + );
> +
> +/**
> + Opens the files that match the path specified.
> +
> + This function opens all of the files specified by Path. Wildcards are
> processed
> + according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
> + matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
> +
> + @param[in] Path A pointer to the path string.
> + @param[in] OpenMode Specifies the mode used to open each file,
> EFI_FILE_MODE_READ or
> + EFI_FILE_MODE_WRITE.
> + @param[in, out] FileList Points to the start of a list of files opened.
> +
> + @retval EFI_SUCCESS Create the file list successfully.
> + @return Can't create the file list.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
> + IN CHAR16 *Path,
> + IN UINT64 OpenMode,
> + IN OUT EFI_SHELL_FILE_INFO **FileList
> + );
> +
> +/**
> + Opens the root directory of a device.
> +
> + This function opens the root directory of a device and returns a file handle
> to it.
> +
> + @param[in] DevicePath Points to the device path corresponding to the
> device where the
> + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
> + @param[out] FileHandle On exit, points to the file handle
> corresponding to the root directory on the
> + device.
> +
> + @retval EFI_SUCCESS Root opened successfully.
> + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> found or the root directory
> + could not be opened.
> + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> were corrupted.
> + @retval EFI_DEVICE_ERROR The device had an error.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_OPEN_ROOT)(
> + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> + OUT SHELL_FILE_HANDLE *FileHandle
> + );
> +
> +/**
> + Opens the root directory of a device on a handle.
> +
> + This function opens the root directory of a device and returns a file handle
> to it.
> +
> + @param[in] DeviceHandle The handle of the device that contains the
> volume.
> + @param[out] FileHandle On exit, points to the file handle
> corresponding to the root directory on the
> + device.
> +
> + @retval EFI_SUCCESS Root opened successfully.
> + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> found or the root directory
> + could not be opened.
> + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> were corrupted.
> + @retval EFI_DEVICE_ERROR The device had an error.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
> + IN EFI_HANDLE DeviceHandle,
> + OUT SHELL_FILE_HANDLE *FileHandle
> + );
> +
> +/**
> + Reads data from the file.
> +
> + If FileHandle is not a directory, the function reads the requested number
> of bytes
> + from the file at the file's current position and returns them in Buffer. If the
> read goes
> + beyond the end of the file, the read length is truncated to the end of the
> file. The file's
> + current position is increased by the number of bytes returned.
> + If FileHandle is a directory, then an error is returned.
> +
> + @param[in] FileHandle The opened file handle for read.
> + @param[in] ReadSize On input, the size of Buffer, in bytes. On
> output, the amount of data read.
> + @param[in, out] Buffer The buffer in which data is read.
> +
> + @retval EFI_SUCCESS Data was read.
> + @retval EFI_NO_MEDIA The device has no media.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> + @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains
> required size.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_READ_FILE) (
> + IN SHELL_FILE_HANDLE FileHandle,
> + IN OUT UINTN *ReadSize,
> + IN OUT VOID *Buffer
> + );
> +
> +/**
> + Register a GUID and a localized human readable name for it.
> +
> + If Guid is not assigned a name, then assign GuidName to Guid. This list of
> GUID
> + names must be used whenever a shell command outputs GUID
> information.
> +
> + This function is only available when the major and minor versions in the
> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> +
> + @param[in] Guid A pointer to the GUID being registered.
> + @param[in] GuidName A pointer to the localized name for the GUID
> being registered.
> +
> + @retval EFI_SUCCESS The operation was successful.
> + @retval EFI_INVALID_PARAMETER Guid was NULL.
> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> + @retval EFI_ACCESS_DENIED Guid already is assigned a name.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
> + IN CONST EFI_GUID *Guid,
> + IN CONST CHAR16 *GuidName
> + );
> +
> +/**
> + Deletes the duplicate file names files in the given file list.
> +
> + @param[in] FileList A pointer to the first entry in the file list.
> +
> + @retval EFI_SUCCESS Always success.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
> + IN EFI_SHELL_FILE_INFO **FileList
> + );
> +
> +/**
> + Changes a shell command alias.
> +
> + This function creates an alias for a shell command.
> +
> + @param[in] Command Points to the NULL-terminated shell
> command or existing alias.
> + @param[in] Alias Points to the NULL-terminated alias for the shell
> command. If this is NULL, and
> + Command refers to an alias, that alias will be deleted.
> + @param[in] Replace If TRUE and the alias already exists, then the
> existing alias will be replaced. If
> + FALSE and the alias already exists, then the existing alias is
> unchanged and
> + EFI_ACCESS_DENIED is returned.
> + @param[in] Volatile if TRUE the Alias being set will be stored in a
> volatile fashion. if FALSE the
> + Alias being set will be stored in a non-volatile fashion.
> +
> + @retval EFI_SUCCESS Alias created or deleted successfully.
> + @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed
> and Replace was set to
> + FALSE.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_ALIAS)(
> + IN CONST CHAR16 *Command,
> + IN CONST CHAR16 *Alias,
> + IN BOOLEAN Replace,
> + IN BOOLEAN Volatile
> + );
> +
> +/**
> + This function returns the command associated with a alias or a list of all
> + alias'.
> +
> + @param[in] Alias Points to the NULL-terminated shell alias.
> + If this parameter is NULL, then all
> + aliases will be returned in ReturnedData.
> + @param[out] Volatile Upon return of a single command if TRUE
> indicates
> + this is stored in a volatile fashion. FALSE otherwise.
> + @return If Alias is not NULL, it will return a pointer to
> + the NULL-terminated command for that alias.
> + If Alias is NULL, ReturnedData points to a ';'
> + delimited list of alias (e.g.
> + ReturnedData = "dir;del;copy;mfp") that is NULL-
> terminated.
> + @retval NULL An error ocurred.
> + @retval NULL Alias was not a valid Alias.
> +**/
> +typedef
> +CONST CHAR16 *
> +(EFIAPI *EFI_SHELL_GET_ALIAS)(
> + IN CONST CHAR16 *Alias,
> + OUT BOOLEAN *Volatile OPTIONAL
> + );
> +
> +/**
> + Changes the current directory on the specified device.
> +
> + If the FileSystem is NULL, and the directory Dir does not contain a file
> system's
> + mapped name, this function changes the current working directory. If
> FileSystem is
> + NULL and the directory Dir contains a mapped name, then the current file
> system and
> + the current directory on that file system are changed.
> +
> + If FileSystem is not NULL, and Dir is NULL, then this changes the current
> working file
> + system.
> +
> + If FileSystem is not NULL and Dir is not NULL, then this function changes
> the current
> + directory on the specified file system.
> +
> + If the current working directory or the current working file system is
> changed then the
> + %cwd% environment variable will be updated.
> +
> + @param[in] FileSystem A pointer to the file system's mapped name. If
> NULL, then the current working
> + directory is changed.
> + @param[in] Dir Points to the NULL-terminated directory on the
> device specified by FileSystem.
> +
> + @retval NULL Current directory does not exist.
> + @return The current directory.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
> + IN CONST CHAR16 *FileSystem OPTIONAL,
> + IN CONST CHAR16 *Dir
> + );
> +
> +/**
> + Sets the environment variable.
> +
> + This function changes the current value of the specified environment
> variable. If the
> + environment variable exists and the Value is an empty string, then the
> environment
> + variable is deleted. If the environment variable exists and the Value is not
> an empty
> + string, then the value of the environment variable is changed. If the
> environment
> + variable does not exist and the Value is an empty string, there is no action.
> If the
> + environment variable does not exist and the Value is a non-empty string,
> then the
> + environment variable is created and assigned the specified value.
> +
> + For a description of volatile and non-volatile environment variables, see
> UEFI Shell
> + 2.0 specification section 3.6.1.
> +
> + @param[in] Name Points to the NULL-terminated environment
> variable name.
> + @param[in] Value Points to the NULL-terminated environment
> variable value. If the value is an
> + empty string then the environment variable is deleted.
> + @param[in] Volatile Indicates whether the variable is non-volatile
> (FALSE) or volatile (TRUE).
> +
> + @retval EFI_SUCCESS The environment variable was successfully
> updated.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_ENV) (
> + IN CONST CHAR16 *Name,
> + IN CONST CHAR16 *Value,
> + IN BOOLEAN Volatile
> + );
> +
> +/**
> + Sets the file information to an opened file handle.
> +
> + This function changes file information. All file information in the
> EFI_FILE_INFO
> + struct will be updated to the passed in data.
> +
> + @param[in] FileHandle A file handle.
> + @param[in] FileInfo Points to new file information.
> +
> + @retval EFI_SUCCESS The information was set.
> + @retval EFI_NO_MEDIA The device has no medium.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> + @retval EFI_ACCESS_DENIED The file was opened read-only.
> + @retval EFI_VOLUME_FULL The volume is full.
> + @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of
> EFI_FILE_INFO.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
> + IN SHELL_FILE_HANDLE FileHandle,
> + IN CONST EFI_FILE_INFO *FileInfo
> + );
> +
> +/**
> + Sets a file's current position.
> +
> + This function sets the current file position for the handle to the position
> supplied. With
> + the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute
> positioning is
> + supported, and seeking past the end of the file is allowed (a subsequent
> write would
> + grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current
> position
> + to be set to the end of the file.
> +
> + @param[in] FileHandle The file handle on which requested position
> will be set.
> + @param[in] Position Byte position from the start of the file.
> +
> + @retval EFI_SUCCESS Data was written.
> + @retval EFI_UNSUPPORTED The seek request for nonzero is not valid
> on open directories.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
> + IN SHELL_FILE_HANDLE FileHandle,
> + IN UINT64 Position
> + );
> +
> +/**
> + This function creates a mapping for a device path.
> +
> + @param[in] DevicePath Points to the device path. If this is NULL and
> Mapping points to a valid mapping,
> + then the mapping will be deleted.
> + @param[in] Mapping Points to the NULL-terminated mapping for the
> device path.
> +
> + @retval EFI_SUCCESS Mapping created or deleted successfully.
> + @retval EFI_NO_MAPPING There is no handle that corresponds exactly
> to DevicePath. See the
> + boot service function LocateDevicePath().
> + @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_SET_MAP)(
> + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> + IN CONST CHAR16 *Mapping
> + );
> +
> +/**
> + Writes data to the file.
> +
> + This function writes the specified number of bytes to the file at the current
> file position.
> + The current file position is advanced the actual number of bytes written,
> which is
> + returned in BufferSize. Partial writes only occur when there has been a
> data error
> + during the write attempt (such as "volume space full"). The file
> automatically grows to
> + hold the data, if required.
> +
> + Direct writes to opened directories are not supported.
> +
> + @param[in] FileHandle The opened file handle for writing.
> + @param[in, out] BufferSize On input, size of Buffer.
> + @param[in] Buffer The buffer in which data to write.
> +
> + @retval EFI_SUCCESS Data was written.
> + @retval EFI_UNSUPPORTED Writes to open directory are not
> supported.
> + @retval EFI_NO_MEDIA The device has no media.
> + @retval EFI_DEVICE_ERROR The device reported an error.
> + @retval EFI_VOLUME_CORRUPTED The file system structures are
> corrupted.
> + @retval EFI_WRITE_PROTECTED The device is write-protected.
> + @retval EFI_ACCESS_DENIED The file was open for read only.
> + @retval EFI_VOLUME_FULL The volume is full.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_SHELL_WRITE_FILE)(
> + IN SHELL_FILE_HANDLE FileHandle,
> + IN OUT UINTN *BufferSize,
> + IN VOID *Buffer
> + );
> +
> +//
> +// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
> +// Usage of this protocol will require version checking before attempting
> +// to use any new members. There is no need to check the version for
> +// members that existed in UEFI Shell Spec 2.0.
> +//
> +// Update below for any future UEFI Shell spec changes to this protocol.
> +//
> +// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
> +// if ((2 == gEfiShellProtocol->MajorVersion) &&
> +// (0 == gEfiShellProtocol->MinorVersion)) {
> +// //
> +// // Cannot call:
> +// // RegisterGuidName - UEFI Shell 2.1
> +// // GetGuidName - UEFI Shell 2.1
> +// // GetGuidFromName - UEFI Shell 2.1
> +// // GetEnvEx - UEFI Shell 2.1
> +// //
> +// } else {
> +// //
> +// // Can use all members
> +// //
> +// }
> +//
> +typedef struct _EFI_SHELL_PROTOCOL {
> + EFI_SHELL_EXECUTE Execute;
> + EFI_SHELL_GET_ENV GetEnv;
> + EFI_SHELL_SET_ENV SetEnv;
> + EFI_SHELL_GET_ALIAS GetAlias;
> + EFI_SHELL_SET_ALIAS SetAlias;
> + EFI_SHELL_GET_HELP_TEXT GetHelpText;
> + EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
> + EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
> + EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH
> GetDevicePathFromFilePath;
> + EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH
> GetFilePathFromDevicePath;
> + EFI_SHELL_SET_MAP SetMap;
> + EFI_SHELL_GET_CUR_DIR GetCurDir;
> + EFI_SHELL_SET_CUR_DIR SetCurDir;
> + EFI_SHELL_OPEN_FILE_LIST OpenFileList;
> + EFI_SHELL_FREE_FILE_LIST FreeFileList;
> + EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
> + EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
> + EFI_SHELL_IS_ROOT_SHELL IsRootShell;
> + EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
> + EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
> + EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
> + EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
> + EFI_SHELL_GET_FILE_INFO GetFileInfo;
> + EFI_SHELL_SET_FILE_INFO SetFileInfo;
> + EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
> + EFI_SHELL_CLOSE_FILE CloseFile;
> + EFI_SHELL_CREATE_FILE CreateFile;
> + EFI_SHELL_READ_FILE ReadFile;
> + EFI_SHELL_WRITE_FILE WriteFile;
> + EFI_SHELL_DELETE_FILE DeleteFile;
> + EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
> + EFI_SHELL_GET_FILE_POSITION GetFilePosition;
> + EFI_SHELL_SET_FILE_POSITION SetFilePosition;
> + EFI_SHELL_FLUSH_FILE FlushFile;
> + EFI_SHELL_FIND_FILES FindFiles;
> + EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
> + EFI_SHELL_GET_FILE_SIZE GetFileSize;
> + EFI_SHELL_OPEN_ROOT OpenRoot;
> + EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
> + EFI_EVENT ExecutionBreak;
> + UINT32 MajorVersion;
> + UINT32 MinorVersion;
> + // Added for Shell 2.1
> + EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
> + EFI_SHELL_GET_GUID_NAME GetGuidName;
> + EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
> + EFI_SHELL_GET_ENV_EX GetEnvEx;
> +} EFI_SHELL_PROTOCOL;
> +
> +extern EFI_GUID gEfiShellProtocolGuid;
> +
> +enum ShellVersion {
> + SHELL_MAJOR_VERSION = 2,
> + SHELL_MINOR_VERSION = 1
> +};
> +
> +#endif
> diff --git a/MdePkg/Include/Protocol/ShellDynamicCommand.h
> b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> new file mode 100644
> index 0000000..793b4fd
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> @@ -0,0 +1,85 @@
> +/** @file
> + EFI Shell Dynamic Command registration protocol
> +
> + (C) Copyright 2012-2014 Hewlett-Packard Development Company,
> L.P.<BR>
> + Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
> + This program and the accompanying materials
> + are licensed and made available under the terms and conditions of the BSD
> License
> + which accompanies this distribution. The full text of the license may be
> found at
> + http://opensource.org/licenses/bsd-license.php
> +
> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> +#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> +
> +#include <Protocol/Shell.h>
> +#include <Protocol/ShellParameters.h>
> +
> +// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
> +#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
> + { \
> + 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3
> } \
> + }
> +
> +
> +//
> +// Define for forward reference.
> +//
> +typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
> +
> +
> +/**
> + This is the shell command handler function pointer callback type. This
> + function handles the command when it is invoked in the shell.
> +
> + @param[in] This The instance of the
> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> + @param[in] SystemTable The pointer to the system table.
> + @param[in] ShellParameters The parameters associated with the
> command.
> + @param[in] Shell The instance of the shell protocol used in the
> context
> + of processing this command.
> +
> + @return EFI_SUCCESS the operation was sucessful
> + @return other the operation failed.
> +**/
> +typedef
> +SHELL_STATUS
> +(EFIAPI * SHELL_COMMAND_HANDLER)(
> + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> + IN EFI_SYSTEM_TABLE *SystemTable,
> + IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
> + IN EFI_SHELL_PROTOCOL *Shell
> + );
> +
> +/**
> + This is the command help handler function pointer callback type. This
> + function is responsible for displaying help information for the associated
> + command.
> +
> + @param[in] This The instance of the
> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> + @param[in] Language The pointer to the language string to use.
> +
> + @return string Pool allocated help string, must be freed by caller
> +**/
> +typedef
> +CHAR16*
> +(EFIAPI * SHELL_COMMAND_GETHELP)(
> + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> + IN CONST CHAR8 *Language
> + );
> +
> +/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
> +struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
> +
> + CONST CHAR16 *CommandName;
> + SHELL_COMMAND_HANDLER Handler;
> + SHELL_COMMAND_GETHELP GetHelp;
> +
> +};
> +
> +extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
> +
> +#endif
> diff --git a/MdePkg/Include/Protocol/ShellParameters.h
> b/MdePkg/Include/Protocol/ShellParameters.h
> new file mode 100644
> index 0000000..68ca9ed
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/ShellParameters.h
> @@ -0,0 +1,60 @@
> +/** @file
> + EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
> +
> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> + This program and the accompanying materials
> + are licensed and made available under the terms and conditions of the BSD
> License
> + which accompanies this distribution. The full text of the license may be
> found at
> + http://opensource.org/licenses/bsd-license.php
> +
> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
> +#define __EFI_SHELL_PARAMETERS_PROTOCOL__
> +
> +#include <Protocol/Shell.h>
> +
> +#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
> + { \
> + 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca
> } \
> + }
> +
> +typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
> + ///
> + /// Points to an Argc-element array of points to NULL-terminated strings
> containing
> + /// the command-line parameters. The first entry in the array is always the
> full file
> + /// path of the executable. Any quotation marks that were used to
> preserve
> + /// whitespace have been removed.
> + ///
> + CHAR16 **Argv;
> +
> + ///
> + /// The number of elements in the Argv array.
> + ///
> + UINTN Argc;
> +
> + ///
> + /// The file handle for the standard input for this executable. This may be
> different
> + /// from the ConInHandle in EFI_SYSTEM_TABLE.
> + ///
> + SHELL_FILE_HANDLE StdIn;
> +
> + ///
> + /// The file handle for the standard output for this executable. This may be
> different
> + /// from the ConOutHandle in EFI_SYSTEM_TABLE.
> + ///
> + SHELL_FILE_HANDLE StdOut;
> +
> + ///
> + /// The file handle for the standard error output for this executable. This
> may be
> + /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
> + ///
> + SHELL_FILE_HANDLE StdErr;
> +} EFI_SHELL_PARAMETERS_PROTOCOL;
> +
> +extern EFI_GUID gEfiShellParametersProtocolGuid;
> +
> +#endif
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index f1e5151..3e08bed 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -1645,6 +1645,21 @@ [Protocols]
> ## Include/Protocol/EraseBlock.h
> gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa,
> 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}
>
> + #
> + # Protocols defined in Shell2.0
> + #
> + ## Include/Protocol/Shell.h
> + gEfiShellProtocolGuid = { 0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac,
> 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }}
> +
> + ## Include/Protocol/ShellParameters.h
> + gEfiShellParametersProtocolGuid = { 0x752f3136, 0x4e16, 0x4fdc, {0xa2,
> 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca }}
> +
> + #
> + # Protocols defined in Shell2.1
> + #
> + ## Include/Protocol/ShellDynamicCommand.h
> + gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4,
> {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> +
> #
> # [Error.gEfiMdePkgTokenSpaceGuid]
> # 0x80000001 | Invalid value provided.
> --
> 2.9.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
2016-10-17 18:02 ` Carsey, Jaben
@ 2016-10-18 5:56 ` Ni, Ruiyu
2016-10-18 5:59 ` Kinney, Michael D
0 siblings, 1 reply; 19+ messages in thread
From: Ni, Ruiyu @ 2016-10-18 5:56 UTC (permalink / raw)
To: Carsey, Jaben, edk2-devel@lists.01.org; +Cc: Kinney, Michael D, Yao, Jiewen
I don't want to lose the file history either.
I thought git can auto-detect the copy/move of files. I will investigate further.
Thanks/Ray
> -----Original Message-----
> From: Carsey, Jaben
> Sent: Tuesday, October 18, 2016 2:02 AM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
> Subject: RE: [edk2] [PATCH 2/5] MdePkg: Include
> Shell/ShellDynamicCommand/ShellParameters definitions
>
> Can we do a GIT move operation and then merge the content from
> ShellBase.h please? I do not want to lose the file history information.
>
> When we move by "delete" then "add" we lose everything for no reason.
>
> -Jaben
>
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Ruiyu Ni
> > Sent: Friday, October 14, 2016 2:44 AM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben <jaben.carsey@intel.com>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> > Subject: [edk2] [PATCH 2/5] MdePkg: Include
> > Shell/ShellDynamicCommand/ShellParameters definitions
> > Importance: High
> >
> > Copy Shell/ShellDynamicCommand/ShellParameters definitions from
> > ShellPkg to MdePkg.
> > Content of ShellBase.h is moved to Protocol/Shell.h.
> >
> > The following patches will update ShellPkg to reference all protocol
> > definition to MdePkg.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Jaben Carsey <jaben.carsey@intel.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> > MdePkg/Include/Protocol/Shell.h | 1268
> > +++++++++++++++++++++++++
> > MdePkg/Include/Protocol/ShellDynamicCommand.h | 85 ++
> > MdePkg/Include/Protocol/ShellParameters.h | 60 ++
> > MdePkg/MdePkg.dec | 15 +
> > 4 files changed, 1428 insertions(+)
> > create mode 100644 MdePkg/Include/Protocol/Shell.h
> > create mode 100644 MdePkg/Include/Protocol/ShellDynamicCommand.h
> > create mode 100644 MdePkg/Include/Protocol/ShellParameters.h
> >
> > diff --git a/MdePkg/Include/Protocol/Shell.h
> > b/MdePkg/Include/Protocol/Shell.h
> > new file mode 100644
> > index 0000000..cc1fbdc
> > --- /dev/null
> > +++ b/MdePkg/Include/Protocol/Shell.h
> > @@ -0,0 +1,1268 @@
> > +/** @file
> > + EFI Shell protocol as defined in the UEFI Shell 2.0 specification including
> > errata.
> > +
> > + (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> > + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> > + This program and the accompanying materials
> > + are licensed and made available under the terms and conditions of the
> BSD
> > License
> > + which accompanies this distribution. The full text of the license may be
> > found at
> > + http://opensource.org/licenses/bsd-license.php
> > +
> > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > BASIS,
> > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > EXPRESS OR IMPLIED.
> > +
> > +**/
> > +
> > +#ifndef __EFI_SHELL_PROTOCOL__
> > +#define __EFI_SHELL_PROTOCOL__
> > +
> > +#include <Guid/FileInfo.h>
> > +
> > +#define EFI_SHELL_PROTOCOL_GUID \
> > + { \
> > + 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda,
> 0x4e
> > } \
> > + }
> > +typedef VOID *SHELL_FILE_HANDLE;
> > +
> > +typedef enum {
> > + ///
> > + /// The operation completed successfully.
> > + ///
> > + SHELL_SUCCESS = 0,
> > +
> > + ///
> > + /// The image failed to load.
> > + ///
> > + SHELL_LOAD_ERROR = 1,
> > +
> > + ///
> > + /// The parameter was incorrect.
> > + ///
> > + SHELL_INVALID_PARAMETER = 2,
> > +
> > + ///
> > + /// The operation is not supported.
> > + ///
> > + SHELL_UNSUPPORTED = 3,
> > +
> > + ///
> > + /// The buffer was not the proper size for the request.
> > + ///
> > + SHELL_BAD_BUFFER_SIZE = 4,
> > +
> > + ///
> > + /// The buffer was not large enough to hold the requested data.
> > + /// The required buffer size is returned in the appropriate
> > + /// parameter when this error occurs.
> > + ///
> > + SHELL_BUFFER_TOO_SMALL = 5,
> > +
> > + ///
> > + /// There is no data pending upon return.
> > + ///
> > + SHELL_NOT_READY = 6,
> > +
> > + ///
> > + /// The physical device reported an error while attempting the
> > + /// operation.
> > + ///
> > + SHELL_DEVICE_ERROR = 7,
> > +
> > + ///
> > + /// The device cannot be written to.
> > + ///
> > + SHELL_WRITE_PROTECTED = 8,
> > +
> > + ///
> > + /// The resource has run out.
> > + ///
> > + SHELL_OUT_OF_RESOURCES = 9,
> > +
> > + ///
> > + /// An inconsistency was detected on the file system causing the
> > + /// operation to fail.
> > + ///
> > + SHELL_VOLUME_CORRUPTED = 10,
> > +
> > + ///
> > + /// There is no more space on the file system.
> > + ///
> > + SHELL_VOLUME_FULL = 11,
> > +
> > + ///
> > + /// The device does not contain any medium to perform the
> > + /// operation.
> > + ///
> > + SHELL_NO_MEDIA = 12,
> > +
> > + ///
> > + /// The medium in the device has changed since the last
> > + /// access.
> > + ///
> > + SHELL_MEDIA_CHANGED = 13,
> > +
> > + ///
> > + /// The item was not found.
> > + ///
> > + SHELL_NOT_FOUND = 14,
> > +
> > + ///
> > + /// Access was denied.
> > + ///
> > + SHELL_ACCESS_DENIED = 15,
> > +
> > + // note the skipping of 16 and 17
> > +
> > + ///
> > + /// A timeout time expired.
> > + ///
> > + SHELL_TIMEOUT = 18,
> > +
> > + ///
> > + /// The protocol has not been started.
> > + ///
> > + SHELL_NOT_STARTED = 19,
> > +
> > + ///
> > + /// The protocol has already been started.
> > + ///
> > + SHELL_ALREADY_STARTED = 20,
> > +
> > + ///
> > + /// The operation was aborted.
> > + ///
> > + SHELL_ABORTED = 21,
> > +
> > + // note the skipping of 22, 23, and 24
> > +
> > + ///
> > + /// A function encountered an internal version that was
> > + /// incompatible with a version requested by the caller.
> > + ///
> > + SHELL_INCOMPATIBLE_VERSION = 25,
> > +
> > + ///
> > + /// The function was not performed due to a security violation.
> > + ///
> > + SHELL_SECURITY_VIOLATION = 26,
> > +
> > + ///
> > + /// The function was performed and resulted in an unequal
> > + /// comparison..
> > + ///
> > + SHELL_NOT_EQUAL = 27
> > +} SHELL_STATUS;
> > +
> > +
> > +// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
> > +// they are identical outside of the name.
> > +typedef struct {
> > + LIST_ENTRY Link; ///< Linked list members.
> > + EFI_STATUS Status; ///< Status of opening the file. Valid only if
> > Handle != NULL.
> > + CONST CHAR16 *FullName; ///< Fully qualified filename.
> > + CONST CHAR16 *FileName; ///< name of this file.
> > + SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the
> opened
> > file or NULL if closed.
> > + EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or
> > NULL.
> > +} EFI_SHELL_FILE_INFO;
> > +
> > +/**
> > + Returns whether any script files are currently being processed.
> > +
> > + @retval TRUE There is at least one script file active.
> > + @retval FALSE No script files are active now.
> > +
> > +**/
> > +typedef
> > +BOOLEAN
> > +(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
> > + VOID
> > + );
> > +
> > +/**
> > + Closes the file handle.
> > +
> > + This function closes a specified file handle. All 'dirty' cached file data is
> > + flushed to the device, and the file is closed. In all cases, the handle is
> > + closed.
> > +
> > + @param[in] FileHandle The file handle to be closed.
> > +
> > + @retval EFI_SUCCESS The file closed sucessfully.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_CLOSE_FILE)(
> > + IN SHELL_FILE_HANDLE FileHandle
> > + );
> > +
> > +/**
> > + Creates a file or directory by name.
> > +
> > + This function creates an empty new file or directory with the specified
> > attributes and
> > + returns the new file's handle. If the file already exists and is read-only,
> > then
> > + EFI_INVALID_PARAMETER will be returned.
> > +
> > + If the file already existed, it is truncated and its attributes updated. If the
> > file is
> > + created successfully, the FileHandle is the file's handle, else, the
> FileHandle
> > is NULL.
> > +
> > + If the file name begins with >v, then the file handle which is returned
> > refers to the
> > + shell environment variable with the specified name. If the shell
> > environment variable
> > + already exists and is non-volatile then EFI_INVALID_PARAMETER is
> > returned.
> > +
> > + @param[in] FileName Pointer to NULL-terminated file path.
> > + @param[in] FileAttribs The new file's attrbiutes. The different
> > attributes are
> > + described in EFI_FILE_PROTOCOL.Open().
> > + @param[out] FileHandle On return, points to the created file handle
> or
> > directory's handle.
> > +
> > + @retval EFI_SUCCESS The file was opened. FileHandle points to the
> > new file's handle.
> > + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> > value.
> > + @retval EFI_UNSUPPORTED The file path could not be opened.
> > + @retval EFI_NOT_FOUND The specified file could not be found on
> the
> > device, or could not
> > + file the file system on the device.
> > + @retval EFI_NO_MEDIA The device has no medium.
> > + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> > or the medium is no
> > + longer supported.
> > + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> > the file path according
> > + the DirName.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
> or
> > open a file for write
> > + when the media is write-protected.
> > + @retval EFI_ACCESS_DENIED The service denied access to the file.
> > + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> > to open the file.
> > + @retval EFI_VOLUME_FULL The volume is full.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_CREATE_FILE)(
> > + IN CONST CHAR16 *FileName,
> > + IN UINT64 FileAttribs,
> > + OUT SHELL_FILE_HANDLE *FileHandle
> > + );
> > +
> > +/**
> > + Deletes the file specified by the file handle.
> > +
> > + This function closes and deletes a file. In all cases, the file handle is closed.
> > If the file
> > + cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
> > returned, but the
> > + handle is still closed.
> > +
> > + @param[in] FileHandle The file handle to delete.
> > +
> > + @retval EFI_SUCCESS The file was closed and deleted and the
> handle
> > was closed.
> > + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> > was not deleted.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_DELETE_FILE)(
> > + IN SHELL_FILE_HANDLE FileHandle
> > + );
> > +
> > +/**
> > + Deletes the file specified by the file name.
> > +
> > + This function deletes a file.
> > +
> > + @param[in] FileName Points to the NULL-terminated file name.
> > +
> > + @retval EFI_SUCCESS The file was deleted.
> > + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> > was not deleted.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
> > + IN CONST CHAR16 *FileName
> > + );
> > +
> > +/**
> > + Disables the page break output mode.
> > +**/
> > +typedef
> > +VOID
> > +(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
> > + VOID
> > + );
> > +
> > +/**
> > + Enables the page break output mode.
> > +**/
> > +typedef
> > +VOID
> > +(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
> > + VOID
> > + );
> > +
> > +/**
> > + Execute the command line.
> > +
> > + This function creates a nested instance of the shell and executes the
> > specified
> > + command (CommandLine) with the specified environment
> (Environment).
> > Upon return,
> > + the status code returned by the specified command is placed in
> > StatusCode.
> > +
> > + If Environment is NULL, then the current environment is used and all
> > changes made
> > + by the commands executed will be reflected in the current environment.
> If
> > the
> > + Environment is non-NULL, then the changes made will be discarded.
> > +
> > + The CommandLine is executed from the current working directory on the
> > current
> > + device.
> > +
> > + @param[in] ParentImageHandle A handle of the image that is executing
> > the specified
> > + command line.
> > + @param[in] CommandLine Points to the NULL-terminated UCS-2
> > encoded string
> > + containing the command line. If NULL then the command-
> > + line will be empty.
> > + @param[in] Environment Points to a NULL-terminated array of
> > environment
> > + variables with the format 'x=y', where x is the
> > + environment variable name and y is the value. If this
> > + is NULL, then the current shell environment is used.
> > + @param[out] ErrorCode Points to the status code returned by the
> > command.
> > +
> > + @retval EFI_SUCCESS The command executed successfully. The
> > status code
> > + returned by the command is pointed to by StatusCode.
> > + @retval EFI_INVALID_PARAMETER The parameters are invalid.
> > + @retval EFI_OUT_OF_RESOURCES Out of resources.
> > + @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_EXECUTE) (
> > + IN EFI_HANDLE *ParentImageHandle,
> > + IN CHAR16 *CommandLine OPTIONAL,
> > + IN CHAR16 **Environment OPTIONAL,
> > + OUT EFI_STATUS *StatusCode OPTIONAL
> > + );
> > +
> > +/**
> > + Find files that match a specified pattern.
> > +
> > + This function searches for all files and directories that match the specified
> > + FilePattern. The FilePattern can contain wild-card characters. The
> resulting
> > file
> > + information is placed in the file list FileList.
> > +
> > + The files in the file list are not opened. The OpenMode field is set to 0
> and
> > the FileInfo
> > + field is set to NULL.
> > +
> > + @param[in] FilePattern Points to a NULL-terminated shell file path,
> > including wildcards.
> > + @param[out] FileList On return, points to the start of a file list
> > containing the names
> > + of all matching files or else points to NULL if no matching
> > files
> > + were found.
> > +
> > + @retval EFI_SUCCESS Files found.
> > + @retval EFI_NOT_FOUND No files found.
> > + @retval EFI_NO_MEDIA The device has no media.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_FIND_FILES)(
> > + IN CONST CHAR16 *FilePattern,
> > + OUT EFI_SHELL_FILE_INFO **FileList
> > + );
> > +
> > +/**
> > + Find all files in a specified directory.
> > +
> > + @param[in] FileDirHandle Handle of the directory to search.
> > + @param[out] FileList On return, points to the list of files in the
> > directory
> > + or NULL if there are no files in the directory.
> > +
> > + @retval EFI_SUCCESS File information was returned successfully.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures have
> been
> > corrupted.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_NO_MEDIA The device media is not present.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
> > +IN SHELL_FILE_HANDLE FileDirHandle,
> > +OUT EFI_SHELL_FILE_INFO **FileList
> > +);
> > +
> > +/**
> > + Flushes data back to a device.
> > +
> > + This function flushes all modified data associated with a file to a device.
> > +
> > + @param[in] FileHandle The handle of the file to flush.
> > +
> > + @retval EFI_SUCCESS The data was flushed.
> > + @retval EFI_NO_MEDIA The device has no medium.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> > + @retval EFI_ACCESS_DENIED The file was opened read-only.
> > + @retval EFI_VOLUME_FULL The volume is full.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_FLUSH_FILE)(
> > + IN SHELL_FILE_HANDLE FileHandle
> > + );
> > +
> > +/**
> > + Frees the file list.
> > +
> > + This function cleans up the file list and any related data structures. It has
> no
> > + impact on the files themselves.
> > +
> > + @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
> > + defined in OpenFileList().
> > +
> > + @retval EFI_SUCCESS Free the file list successfully.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
> > + IN EFI_SHELL_FILE_INFO **FileList
> > + );
> > +
> > +/**
> > + Returns the current directory on the specified device.
> > +
> > + If FileSystemMapping is NULL, it returns the current working directory. If
> > the
> > + FileSystemMapping is not NULL, it returns the current directory
> associated
> > with the
> > + FileSystemMapping. In both cases, the returned name includes the file
> > system
> > + mapping (i.e. fs0:\current-dir).
> > +
> > + Note that the current directory string should exclude the tailing backslash
> > character.
> > +
> > + @param[in] FileSystemMapping A pointer to the file system mapping. If
> > NULL,
> > + then the current working directory is returned.
> > +
> > + @retval !=NULL The current directory.
> > + @retval NULL Current directory does not exist.
> > +**/
> > +typedef
> > +CONST CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
> > + IN CONST CHAR16 *FileSystemMapping OPTIONAL
> > + );
> > +
> > +typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
> > +#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
> > +#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
> > +
> > +/**
> > + Gets the name of the device specified by the device handle.
> > +
> > + This function gets the user-readable name of the device specified by the
> > device
> > + handle. If no user-readable name could be generated, then
> > *BestDeviceName will be
> > + NULL and EFI_NOT_FOUND will be returned.
> > +
> > + If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the
> function
> > will return the
> > + device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if
> present
> > on
> > + DeviceHandle.
> > +
> > + If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will
> > return the
> > + device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on
> > DeviceHandle.
> > + If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
> > + EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
> > + EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
> > +
> > + @param[in] DeviceHandle The handle of the device.
> > + @param[in] Flags Determines the possible sources of component
> > names.
> > + @param[in] Language A pointer to the language specified for the
> > device
> > + name, in the same format as described in the UEFI
> > + specification, Appendix M.
> > + @param[out] BestDeviceName On return, points to the callee-
> allocated
> > NULL-
> > + terminated name of the device. If no device name
> > + could be found, points to NULL. The name must be
> > + freed by the caller...
> > +
> > + @retval EFI_SUCCESS Get the name successfully.
> > + @retval EFI_NOT_FOUND Fail to get the device name.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
> > + IN EFI_HANDLE DeviceHandle,
> > + IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
> > + IN CHAR8 *Language,
> > + OUT CHAR16 **BestDeviceName
> > + );
> > +
> > +/**
> > + Gets the device path from the mapping.
> > +
> > + This function gets the device path associated with a mapping.
> > +
> > + @param[in] Mapping A pointer to the mapping
> > +
> > + @retval !=NULL Pointer to the device path that corresponds to
> the
> > + device mapping. The returned pointer does not need
> > + to be freed.
> > + @retval NULL There is no device path associated with the
> > + specified mapping.
> > +**/
> > +typedef
> > +CONST EFI_DEVICE_PATH_PROTOCOL *
> > +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
> > + IN CONST CHAR16 *Mapping
> > + );
> > +
> > +/**
> > + Converts a file system style name to a device path.
> > +
> > + This function converts a file system style name to a device path, by
> > replacing any
> > + mapping references to the associated device path.
> > +
> > + @param[in] Path The pointer to the path.
> > +
> > + @return The pointer of the file path. The file path is callee
> > + allocated and should be freed by the caller.
> > +**/
> > +typedef
> > +EFI_DEVICE_PATH_PROTOCOL *
> > +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
> > + IN CONST CHAR16 *Path
> > + );
> > +
> > +/**
> > + Gets either a single or list of environment variables.
> > +
> > + If name is not NULL then this function returns the current value of the
> > specified
> > + environment variable.
> > +
> > + If Name is NULL than a list of all environment variable names is returned.
> > Each a
> > + NULL terminated string with a double NULL terminating the list.
> > +
> > + @param[in] Name A pointer to the environment variable name.
> If
> > + Name is NULL, then the function will return all
> > + of the defined shell environment variables. In
> > + the case where multiple environment variables are
> > + being returned, each variable will be terminated by
> > + a NULL, and the list will be terminated by a double
> > + NULL.
> > +
> > + @return A pointer to the returned string.
> > + The returned pointer does not need to be freed by the
> > caller.
> > +
> > + @retval NULL The environment variable doesn't exist or there
> are
> > + no environment variables.
> > +**/
> > +typedef
> > +CONST CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_ENV) (
> > + IN CONST CHAR16 *Name OPTIONAL
> > + );
> > +
> > +/**
> > + Gets the environment variable and Attributes, or list of environment
> > variables. Can be
> > + used instead of GetEnv().
> > +
> > + This function returns the current value of the specified environment
> > variable and
> > + the Attributes. If no variable name was specified, then all of the known
> > + variables will be returned.
> > +
> > + @param[in] Name A pointer to the environment variable name. If
> > Name is NULL,
> > + then the function will return all of the defined shell
> > + environment variables. In the case where multiple
> > environment
> > + variables are being returned, each variable will be
> > terminated
> > + by a NULL, and the list will be terminated by a double
> NULL.
> > + @param[out] Attributes If not NULL, a pointer to the returned
> > attributes bitmask for
> > + the environment variable. In the case where Name is
> NULL,
> > and
> > + multiple environment variables are being returned,
> > Attributes
> > + is undefined.
> > +
> > + @retval NULL The environment variable doesn't exist.
> > + @return The environment variable's value. The returned
> > pointer does not
> > + need to be freed by the caller.
> > +**/
> > +typedef
> > +CONST CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_ENV_EX) (
> > + IN CONST CHAR16 *Name,
> > + OUT UINT32 *Attributes OPTIONAL
> > + );
> > +
> > +/**
> > + Gets the file information from an open file handle.
> > +
> > + This function allocates a buffer to store the file's information. It's the
> > caller's
> > + responsibility to free the buffer.
> > +
> > + @param[in] FileHandle A File Handle.
> > +
> > + @retval NULL Cannot get the file info.
> > + @return A pointer to a buffer with file information.
> > +**/
> > +typedef
> > +EFI_FILE_INFO *
> > +(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
> > + IN SHELL_FILE_HANDLE FileHandle
> > + );
> > +
> > +/**
> > + Converts a device path to a file system-style path.
> > +
> > + This function converts a device path to a file system path by replacing
> part,
> > or all, of
> > + the device path with the file-system mapping. If there are more than
> one
> > application
> > + file system mappings, the one that most closely matches Path will be
> used.
> > +
> > + @param[in] Path The pointer to the device path.
> > +
> > + @return The pointer of the NULL-terminated file path. The
> path
> > + is callee-allocated and should be freed by the caller.
> > +**/
> > +typedef
> > +CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
> > + IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
> > + );
> > +
> > +/**
> > + Gets a file's current position.
> > +
> > + This function returns the current file position for the file handle. For
> > directories, the
> > + current file position has no meaning outside of the file system driver and
> > as such, the
> > + operation is not supported.
> > +
> > + @param[in] FileHandle The file handle on which to get the current
> > position.
> > + @param[out] Position Byte position from the start of the file.
> > +
> > + @retval EFI_SUCCESS Data was accessed.
> > + @retval EFI_UNSUPPORTED The request is not valid on open
> > directories.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + OUT UINT64 *Position
> > + );
> > +
> > +/**
> > + Gets the size of a file.
> > +
> > + This function returns the size of the file specified by FileHandle.
> > +
> > + @param[in] FileHandle The handle of the file.
> > + @param[out] Size The size of this file.
> > +
> > + @retval EFI_SUCCESS Get the file's size.
> > + @retval EFI_DEVICE_ERROR Can't access the file.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + OUT UINT64 *Size
> > + );
> > +
> > +/**
> > + Get the GUID value from a human readable name.
> > +
> > + If GuidName is a known GUID name, then update Guid to have the
> correct
> > value for
> > + that GUID.
> > +
> > + This function is only available when the major and minor versions in the
> > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > +
> > + @param[in] GuidName A pointer to the localized name for the GUID
> > being queried.
> > + @param[out] Guid A pointer to the GUID structure to be filled in.
> > +
> > + @retval EFI_SUCCESS The operation was successful.
> > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > + @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
> > + IN CONST CHAR16 *GuidName,
> > + OUT EFI_GUID *Guid
> > + );
> > +
> > +/**
> > + Get the human readable name for a GUID from the value.
> > +
> > + If Guid is assigned a name, then update *GuidName to point to the
> name.
> > The callee
> > + should not modify the value.
> > +
> > + This function is only available when the major and minor versions in the
> > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > +
> > + @param[in] Guid A pointer to the GUID being queried.
> > + @param[out] GuidName A pointer to a pointer the localized to name
> for
> > the GUID being requested
> > +
> > + @retval EFI_SUCCESS The operation was successful.
> > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > + @retval EFI_NOT_FOUND Guid is not assigned a name.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
> > + IN CONST EFI_GUID *Guid,
> > + OUT CONST CHAR16 **GuidName
> > + );
> > +
> > +/**
> > + Return help information about a specific command.
> > +
> > + This function returns the help information for the specified command.
> The
> > help text
> > + can be internal to the shell or can be from a UEFI Shell manual page.
> > +
> > + If Sections is specified, then each section name listed will be compared in
> a
> > casesensitive
> > + manner, to the section names described in Appendix B. If the section
> > exists,
> > + it will be appended to the returned help text. If the section does not
> exist,
> > no
> > + information will be returned. If Sections is NULL, then all help text
> > information
> > + available will be returned.
> > +
> > + @param[in] Command Points to the NULL-terminated UEFI Shell
> > command name.
> > + @param[in] Sections Points to the NULL-terminated comma-
> > delimited
> > + section names to return. If NULL, then all
> > + sections will be returned.
> > + @param[out] HelpText On return, points to a callee-allocated buffer
> > + containing all specified help text.
> > +
> > + @retval EFI_SUCCESS The help text was returned.
> > + @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be
> > allocated to hold the
> > + returned help text.
> > + @retval EFI_INVALID_PARAMETER HelpText is NULL.
> > + @retval EFI_NOT_FOUND There is no help text available for
> > Command.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
> > + IN CONST CHAR16 *Command,
> > + IN CONST CHAR16 *Sections OPTIONAL,
> > + OUT CHAR16 **HelpText
> > + );
> > +
> > +/**
> > + Gets the mapping(s) that most closely matches the device path.
> > +
> > + This function gets the mapping which corresponds to the device path
> > *DevicePath. If
> > + there is no exact match, then the mapping which most closely matches
> > *DevicePath
> > + is returned, and *DevicePath is updated to point to the remaining
> portion
> > of the
> > + device path. If there is an exact match, the mapping is returned and
> > *DevicePath
> > + points to the end-of-device-path node.
> > +
> > + If there are multiple map names they will be semi-colon seperated in the
> > + NULL-terminated string.
> > +
> > + @param[in, out] DevicePath On entry, points to a device path pointer.
> > On
> > + exit, updates the pointer to point to the
> > + portion of the device path after the mapping.
> > +
> > + @retval NULL No mapping was found.
> > + @retval !=NULL Pointer to NULL-terminated mapping. The buffer
> > + is callee allocated and should be freed by the caller.
> > +**/
> > +typedef
> > +CONST CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
> > + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
> > + );
> > +
> > +/**
> > + Gets the enable status of the page break output mode.
> > +
> > + User can use this function to determine current page break mode.
> > +
> > + @retval TRUE The page break output mode is enabled.
> > + @retval FALSE The page break output mode is disabled.
> > +**/
> > +typedef
> > +BOOLEAN
> > +(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
> > + VOID
> > + );
> > +
> > +/**
> > + Judges whether the active shell is the root shell.
> > +
> > + This function makes the user to know that whether the active Shell is the
> > root shell.
> > +
> > + @retval TRUE The active Shell is the root Shell.
> > + @retval FALSE The active Shell is NOT the root Shell.
> > +**/
> > +typedef
> > +BOOLEAN
> > +(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
> > +VOID
> > +);
> > +
> > +/**
> > + Opens a file or a directory by file name.
> > +
> > + This function opens the specified file in the specified OpenMode and
> > returns a file
> > + handle.
> > + If the file name begins with '>v', then the file handle which is returned
> > refers to the
> > + shell environment variable with the specified name. If the shell
> > environment variable
> > + exists, is non-volatile and the OpenMode indicates
> > EFI_FILE_MODE_WRITE, then
> > + EFI_INVALID_PARAMETER is returned.
> > +
> > + If the file name is '>i', then the file handle which is returned refers to the
> > standard
> > + input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then
> > EFI_INVALID_PARAMETER
> > + is returned.
> > +
> > + If the file name is '>o', then the file handle which is returned refers to
> the
> > standard
> > + output. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > EFI_INVALID_PARAMETER
> > + is returned.
> > +
> > + If the file name is '>e', then the file handle which is returned refers to
> the
> > standard
> > + error. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > EFI_INVALID_PARAMETER
> > + is returned.
> > +
> > + If the file name is 'NUL', then the file handle that is returned refers to the
> > standard NUL
> > + file. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > EFI_INVALID_PARAMETER is
> > + returned.
> > +
> > + If return EFI_SUCCESS, the FileHandle is the opened file's handle, else,
> the
> > + FileHandle is NULL.
> > +
> > + @param[in] FileName Points to the NULL-terminated UCS-2
> encoded
> > file name.
> > + @param[out] FileHandle On return, points to the file handle.
> > + @param[in] OpenMode File open mode. Either
> > EFI_FILE_MODE_READ or
> > + EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
> > + Specification.
> > + @retval EFI_SUCCESS The file was opened. FileHandle has the
> > opened file's handle.
> > + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> > value. FileHandle is NULL.
> > + @retval EFI_UNSUPPORTED Could not open the file path. FileHandle
> is
> > NULL.
> > + @retval EFI_NOT_FOUND The specified file could not be found on
> the
> > device or the file
> > + system could not be found on the device. FileHandle is
> > NULL.
> > + @retval EFI_NO_MEDIA The device has no medium. FileHandle is
> > NULL.
> > + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> > or the medium is no
> > + longer supported. FileHandle is NULL.
> > + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> > the file path according
> > + the FileName. FileHandle is NULL.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted. FileHandle is NULL.
> > + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
> or
> > open a file for write
> > + when the media is write-protected. FileHandle is NULL.
> > + @retval EFI_ACCESS_DENIED The service denied access to the file.
> > FileHandle is NULL.
> > + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> > to open the file. FileHandle
> > + is NULL.
> > + @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
> > + IN CONST CHAR16 *FileName,
> > + OUT SHELL_FILE_HANDLE *FileHandle,
> > + IN UINT64 OpenMode
> > + );
> > +
> > +/**
> > + Opens the files that match the path specified.
> > +
> > + This function opens all of the files specified by Path. Wildcards are
> > processed
> > + according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
> > + matching file has an EFI_SHELL_FILE_INFO structure created in a linked
> list.
> > +
> > + @param[in] Path A pointer to the path string.
> > + @param[in] OpenMode Specifies the mode used to open each file,
> > EFI_FILE_MODE_READ or
> > + EFI_FILE_MODE_WRITE.
> > + @param[in, out] FileList Points to the start of a list of files opened.
> > +
> > + @retval EFI_SUCCESS Create the file list successfully.
> > + @return Can't create the file list.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
> > + IN CHAR16 *Path,
> > + IN UINT64 OpenMode,
> > + IN OUT EFI_SHELL_FILE_INFO **FileList
> > + );
> > +
> > +/**
> > + Opens the root directory of a device.
> > +
> > + This function opens the root directory of a device and returns a file
> handle
> > to it.
> > +
> > + @param[in] DevicePath Points to the device path corresponding to
> the
> > device where the
> > + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
> > + @param[out] FileHandle On exit, points to the file handle
> > corresponding to the root directory on the
> > + device.
> > +
> > + @retval EFI_SUCCESS Root opened successfully.
> > + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> > found or the root directory
> > + could not be opened.
> > + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> > were corrupted.
> > + @retval EFI_DEVICE_ERROR The device had an error.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_OPEN_ROOT)(
> > + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> > + OUT SHELL_FILE_HANDLE *FileHandle
> > + );
> > +
> > +/**
> > + Opens the root directory of a device on a handle.
> > +
> > + This function opens the root directory of a device and returns a file
> handle
> > to it.
> > +
> > + @param[in] DeviceHandle The handle of the device that contains the
> > volume.
> > + @param[out] FileHandle On exit, points to the file handle
> > corresponding to the root directory on the
> > + device.
> > +
> > + @retval EFI_SUCCESS Root opened successfully.
> > + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> > found or the root directory
> > + could not be opened.
> > + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> > were corrupted.
> > + @retval EFI_DEVICE_ERROR The device had an error.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
> > + IN EFI_HANDLE DeviceHandle,
> > + OUT SHELL_FILE_HANDLE *FileHandle
> > + );
> > +
> > +/**
> > + Reads data from the file.
> > +
> > + If FileHandle is not a directory, the function reads the requested number
> > of bytes
> > + from the file at the file's current position and returns them in Buffer. If
> the
> > read goes
> > + beyond the end of the file, the read length is truncated to the end of the
> > file. The file's
> > + current position is increased by the number of bytes returned.
> > + If FileHandle is a directory, then an error is returned.
> > +
> > + @param[in] FileHandle The opened file handle for read.
> > + @param[in] ReadSize On input, the size of Buffer, in bytes. On
> > output, the amount of data read.
> > + @param[in, out] Buffer The buffer in which data is read.
> > +
> > + @retval EFI_SUCCESS Data was read.
> > + @retval EFI_NO_MEDIA The device has no media.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > + @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains
> > required size.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_READ_FILE) (
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + IN OUT UINTN *ReadSize,
> > + IN OUT VOID *Buffer
> > + );
> > +
> > +/**
> > + Register a GUID and a localized human readable name for it.
> > +
> > + If Guid is not assigned a name, then assign GuidName to Guid. This list of
> > GUID
> > + names must be used whenever a shell command outputs GUID
> > information.
> > +
> > + This function is only available when the major and minor versions in the
> > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > +
> > + @param[in] Guid A pointer to the GUID being registered.
> > + @param[in] GuidName A pointer to the localized name for the GUID
> > being registered.
> > +
> > + @retval EFI_SUCCESS The operation was successful.
> > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > + @retval EFI_ACCESS_DENIED Guid already is assigned a name.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
> > + IN CONST EFI_GUID *Guid,
> > + IN CONST CHAR16 *GuidName
> > + );
> > +
> > +/**
> > + Deletes the duplicate file names files in the given file list.
> > +
> > + @param[in] FileList A pointer to the first entry in the file list.
> > +
> > + @retval EFI_SUCCESS Always success.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
> > + IN EFI_SHELL_FILE_INFO **FileList
> > + );
> > +
> > +/**
> > + Changes a shell command alias.
> > +
> > + This function creates an alias for a shell command.
> > +
> > + @param[in] Command Points to the NULL-terminated shell
> > command or existing alias.
> > + @param[in] Alias Points to the NULL-terminated alias for the shell
> > command. If this is NULL, and
> > + Command refers to an alias, that alias will be deleted.
> > + @param[in] Replace If TRUE and the alias already exists, then the
> > existing alias will be replaced. If
> > + FALSE and the alias already exists, then the existing alias is
> > unchanged and
> > + EFI_ACCESS_DENIED is returned.
> > + @param[in] Volatile if TRUE the Alias being set will be stored in a
> > volatile fashion. if FALSE the
> > + Alias being set will be stored in a non-volatile fashion.
> > +
> > + @retval EFI_SUCCESS Alias created or deleted successfully.
> > + @retval EFI_ACCESS_DENIED The alias is a built-in alias or already
> existed
> > and Replace was set to
> > + FALSE.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_ALIAS)(
> > + IN CONST CHAR16 *Command,
> > + IN CONST CHAR16 *Alias,
> > + IN BOOLEAN Replace,
> > + IN BOOLEAN Volatile
> > + );
> > +
> > +/**
> > + This function returns the command associated with a alias or a list of all
> > + alias'.
> > +
> > + @param[in] Alias Points to the NULL-terminated shell alias.
> > + If this parameter is NULL, then all
> > + aliases will be returned in ReturnedData.
> > + @param[out] Volatile Upon return of a single command if TRUE
> > indicates
> > + this is stored in a volatile fashion. FALSE otherwise.
> > + @return If Alias is not NULL, it will return a pointer to
> > + the NULL-terminated command for that alias.
> > + If Alias is NULL, ReturnedData points to a ';'
> > + delimited list of alias (e.g.
> > + ReturnedData = "dir;del;copy;mfp") that is NULL-
> > terminated.
> > + @retval NULL An error ocurred.
> > + @retval NULL Alias was not a valid Alias.
> > +**/
> > +typedef
> > +CONST CHAR16 *
> > +(EFIAPI *EFI_SHELL_GET_ALIAS)(
> > + IN CONST CHAR16 *Alias,
> > + OUT BOOLEAN *Volatile OPTIONAL
> > + );
> > +
> > +/**
> > + Changes the current directory on the specified device.
> > +
> > + If the FileSystem is NULL, and the directory Dir does not contain a file
> > system's
> > + mapped name, this function changes the current working directory. If
> > FileSystem is
> > + NULL and the directory Dir contains a mapped name, then the current
> file
> > system and
> > + the current directory on that file system are changed.
> > +
> > + If FileSystem is not NULL, and Dir is NULL, then this changes the current
> > working file
> > + system.
> > +
> > + If FileSystem is not NULL and Dir is not NULL, then this function changes
> > the current
> > + directory on the specified file system.
> > +
> > + If the current working directory or the current working file system is
> > changed then the
> > + %cwd% environment variable will be updated.
> > +
> > + @param[in] FileSystem A pointer to the file system's mapped name.
> If
> > NULL, then the current working
> > + directory is changed.
> > + @param[in] Dir Points to the NULL-terminated directory on the
> > device specified by FileSystem.
> > +
> > + @retval NULL Current directory does not exist.
> > + @return The current directory.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
> > + IN CONST CHAR16 *FileSystem OPTIONAL,
> > + IN CONST CHAR16 *Dir
> > + );
> > +
> > +/**
> > + Sets the environment variable.
> > +
> > + This function changes the current value of the specified environment
> > variable. If the
> > + environment variable exists and the Value is an empty string, then the
> > environment
> > + variable is deleted. If the environment variable exists and the Value is
> not
> > an empty
> > + string, then the value of the environment variable is changed. If the
> > environment
> > + variable does not exist and the Value is an empty string, there is no
> action.
> > If the
> > + environment variable does not exist and the Value is a non-empty string,
> > then the
> > + environment variable is created and assigned the specified value.
> > +
> > + For a description of volatile and non-volatile environment variables, see
> > UEFI Shell
> > + 2.0 specification section 3.6.1.
> > +
> > + @param[in] Name Points to the NULL-terminated environment
> > variable name.
> > + @param[in] Value Points to the NULL-terminated environment
> > variable value. If the value is an
> > + empty string then the environment variable is deleted.
> > + @param[in] Volatile Indicates whether the variable is non-volatile
> > (FALSE) or volatile (TRUE).
> > +
> > + @retval EFI_SUCCESS The environment variable was successfully
> > updated.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_ENV) (
> > + IN CONST CHAR16 *Name,
> > + IN CONST CHAR16 *Value,
> > + IN BOOLEAN Volatile
> > + );
> > +
> > +/**
> > + Sets the file information to an opened file handle.
> > +
> > + This function changes file information. All file information in the
> > EFI_FILE_INFO
> > + struct will be updated to the passed in data.
> > +
> > + @param[in] FileHandle A file handle.
> > + @param[in] FileInfo Points to new file information.
> > +
> > + @retval EFI_SUCCESS The information was set.
> > + @retval EFI_NO_MEDIA The device has no medium.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> > + @retval EFI_ACCESS_DENIED The file was opened read-only.
> > + @retval EFI_VOLUME_FULL The volume is full.
> > + @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of
> > EFI_FILE_INFO.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + IN CONST EFI_FILE_INFO *FileInfo
> > + );
> > +
> > +/**
> > + Sets a file's current position.
> > +
> > + This function sets the current file position for the handle to the position
> > supplied. With
> > + the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute
> > positioning is
> > + supported, and seeking past the end of the file is allowed (a subsequent
> > write would
> > + grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the
> current
> > position
> > + to be set to the end of the file.
> > +
> > + @param[in] FileHandle The file handle on which requested position
> > will be set.
> > + @param[in] Position Byte position from the start of the file.
> > +
> > + @retval EFI_SUCCESS Data was written.
> > + @retval EFI_UNSUPPORTED The seek request for nonzero is not valid
> > on open directories.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + IN UINT64 Position
> > + );
> > +
> > +/**
> > + This function creates a mapping for a device path.
> > +
> > + @param[in] DevicePath Points to the device path. If this is NULL and
> > Mapping points to a valid mapping,
> > + then the mapping will be deleted.
> > + @param[in] Mapping Points to the NULL-terminated mapping for
> the
> > device path.
> > +
> > + @retval EFI_SUCCESS Mapping created or deleted successfully.
> > + @retval EFI_NO_MAPPING There is no handle that corresponds
> exactly
> > to DevicePath. See the
> > + boot service function LocateDevicePath().
> > + @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_SET_MAP)(
> > + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> > + IN CONST CHAR16 *Mapping
> > + );
> > +
> > +/**
> > + Writes data to the file.
> > +
> > + This function writes the specified number of bytes to the file at the
> current
> > file position.
> > + The current file position is advanced the actual number of bytes written,
> > which is
> > + returned in BufferSize. Partial writes only occur when there has been a
> > data error
> > + during the write attempt (such as "volume space full"). The file
> > automatically grows to
> > + hold the data, if required.
> > +
> > + Direct writes to opened directories are not supported.
> > +
> > + @param[in] FileHandle The opened file handle for writing.
> > + @param[in, out] BufferSize On input, size of Buffer.
> > + @param[in] Buffer The buffer in which data to write.
> > +
> > + @retval EFI_SUCCESS Data was written.
> > + @retval EFI_UNSUPPORTED Writes to open directory are not
> > supported.
> > + @retval EFI_NO_MEDIA The device has no media.
> > + @retval EFI_DEVICE_ERROR The device reported an error.
> > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > corrupted.
> > + @retval EFI_WRITE_PROTECTED The device is write-protected.
> > + @retval EFI_ACCESS_DENIED The file was open for read only.
> > + @retval EFI_VOLUME_FULL The volume is full.
> > +**/
> > +typedef
> > +EFI_STATUS
> > +(EFIAPI *EFI_SHELL_WRITE_FILE)(
> > + IN SHELL_FILE_HANDLE FileHandle,
> > + IN OUT UINTN *BufferSize,
> > + IN VOID *Buffer
> > + );
> > +
> > +//
> > +// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
> > +// Usage of this protocol will require version checking before attempting
> > +// to use any new members. There is no need to check the version for
> > +// members that existed in UEFI Shell Spec 2.0.
> > +//
> > +// Update below for any future UEFI Shell spec changes to this protocol.
> > +//
> > +// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
> > +// if ((2 == gEfiShellProtocol->MajorVersion) &&
> > +// (0 == gEfiShellProtocol->MinorVersion)) {
> > +// //
> > +// // Cannot call:
> > +// // RegisterGuidName - UEFI Shell 2.1
> > +// // GetGuidName - UEFI Shell 2.1
> > +// // GetGuidFromName - UEFI Shell 2.1
> > +// // GetEnvEx - UEFI Shell 2.1
> > +// //
> > +// } else {
> > +// //
> > +// // Can use all members
> > +// //
> > +// }
> > +//
> > +typedef struct _EFI_SHELL_PROTOCOL {
> > + EFI_SHELL_EXECUTE Execute;
> > + EFI_SHELL_GET_ENV GetEnv;
> > + EFI_SHELL_SET_ENV SetEnv;
> > + EFI_SHELL_GET_ALIAS GetAlias;
> > + EFI_SHELL_SET_ALIAS SetAlias;
> > + EFI_SHELL_GET_HELP_TEXT GetHelpText;
> > + EFI_SHELL_GET_DEVICE_PATH_FROM_MAP
> GetDevicePathFromMap;
> > + EFI_SHELL_GET_MAP_FROM_DEVICE_PATH
> GetMapFromDevicePath;
> > + EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH
> > GetDevicePathFromFilePath;
> > + EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH
> > GetFilePathFromDevicePath;
> > + EFI_SHELL_SET_MAP SetMap;
> > + EFI_SHELL_GET_CUR_DIR GetCurDir;
> > + EFI_SHELL_SET_CUR_DIR SetCurDir;
> > + EFI_SHELL_OPEN_FILE_LIST OpenFileList;
> > + EFI_SHELL_FREE_FILE_LIST FreeFileList;
> > + EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
> > + EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
> > + EFI_SHELL_IS_ROOT_SHELL IsRootShell;
> > + EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
> > + EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
> > + EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
> > + EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
> > + EFI_SHELL_GET_FILE_INFO GetFileInfo;
> > + EFI_SHELL_SET_FILE_INFO SetFileInfo;
> > + EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
> > + EFI_SHELL_CLOSE_FILE CloseFile;
> > + EFI_SHELL_CREATE_FILE CreateFile;
> > + EFI_SHELL_READ_FILE ReadFile;
> > + EFI_SHELL_WRITE_FILE WriteFile;
> > + EFI_SHELL_DELETE_FILE DeleteFile;
> > + EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
> > + EFI_SHELL_GET_FILE_POSITION GetFilePosition;
> > + EFI_SHELL_SET_FILE_POSITION SetFilePosition;
> > + EFI_SHELL_FLUSH_FILE FlushFile;
> > + EFI_SHELL_FIND_FILES FindFiles;
> > + EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
> > + EFI_SHELL_GET_FILE_SIZE GetFileSize;
> > + EFI_SHELL_OPEN_ROOT OpenRoot;
> > + EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
> > + EFI_EVENT ExecutionBreak;
> > + UINT32 MajorVersion;
> > + UINT32 MinorVersion;
> > + // Added for Shell 2.1
> > + EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
> > + EFI_SHELL_GET_GUID_NAME GetGuidName;
> > + EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
> > + EFI_SHELL_GET_ENV_EX GetEnvEx;
> > +} EFI_SHELL_PROTOCOL;
> > +
> > +extern EFI_GUID gEfiShellProtocolGuid;
> > +
> > +enum ShellVersion {
> > + SHELL_MAJOR_VERSION = 2,
> > + SHELL_MINOR_VERSION = 1
> > +};
> > +
> > +#endif
> > diff --git a/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > new file mode 100644
> > index 0000000..793b4fd
> > --- /dev/null
> > +++ b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > @@ -0,0 +1,85 @@
> > +/** @file
> > + EFI Shell Dynamic Command registration protocol
> > +
> > + (C) Copyright 2012-2014 Hewlett-Packard Development Company,
> > L.P.<BR>
> > + Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
> > + This program and the accompanying materials
> > + are licensed and made available under the terms and conditions of the
> BSD
> > License
> > + which accompanies this distribution. The full text of the license may be
> > found at
> > + http://opensource.org/licenses/bsd-license.php
> > +
> > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > BASIS,
> > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > EXPRESS OR IMPLIED.
> > +
> > +**/
> > +
> > +#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> > +#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> > +
> > +#include <Protocol/Shell.h>
> > +#include <Protocol/ShellParameters.h>
> > +
> > +// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
> > +#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
> > + { \
> > + 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27,
> 0xc3
> > } \
> > + }
> > +
> > +
> > +//
> > +// Define for forward reference.
> > +//
> > +typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
> > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
> > +
> > +
> > +/**
> > + This is the shell command handler function pointer callback type. This
> > + function handles the command when it is invoked in the shell.
> > +
> > + @param[in] This The instance of the
> > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> > + @param[in] SystemTable The pointer to the system table.
> > + @param[in] ShellParameters The parameters associated with the
> > command.
> > + @param[in] Shell The instance of the shell protocol used in the
> > context
> > + of processing this command.
> > +
> > + @return EFI_SUCCESS the operation was sucessful
> > + @return other the operation failed.
> > +**/
> > +typedef
> > +SHELL_STATUS
> > +(EFIAPI * SHELL_COMMAND_HANDLER)(
> > + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> > + IN EFI_SYSTEM_TABLE *SystemTable,
> > + IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
> > + IN EFI_SHELL_PROTOCOL *Shell
> > + );
> > +
> > +/**
> > + This is the command help handler function pointer callback type. This
> > + function is responsible for displaying help information for the associated
> > + command.
> > +
> > + @param[in] This The instance of the
> > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> > + @param[in] Language The pointer to the language string to use.
> > +
> > + @return string Pool allocated help string, must be freed by
> caller
> > +**/
> > +typedef
> > +CHAR16*
> > +(EFIAPI * SHELL_COMMAND_GETHELP)(
> > + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> > + IN CONST CHAR8 *Language
> > + );
> > +
> > +/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
> > +struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
> > +
> > + CONST CHAR16 *CommandName;
> > + SHELL_COMMAND_HANDLER Handler;
> > + SHELL_COMMAND_GETHELP GetHelp;
> > +
> > +};
> > +
> > +extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
> > +
> > +#endif
> > diff --git a/MdePkg/Include/Protocol/ShellParameters.h
> > b/MdePkg/Include/Protocol/ShellParameters.h
> > new file mode 100644
> > index 0000000..68ca9ed
> > --- /dev/null
> > +++ b/MdePkg/Include/Protocol/ShellParameters.h
> > @@ -0,0 +1,60 @@
> > +/** @file
> > + EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
> > +
> > + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> > + This program and the accompanying materials
> > + are licensed and made available under the terms and conditions of the
> BSD
> > License
> > + which accompanies this distribution. The full text of the license may be
> > found at
> > + http://opensource.org/licenses/bsd-license.php
> > +
> > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > BASIS,
> > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > EXPRESS OR IMPLIED.
> > +
> > +**/
> > +
> > +#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
> > +#define __EFI_SHELL_PARAMETERS_PROTOCOL__
> > +
> > +#include <Protocol/Shell.h>
> > +
> > +#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
> > + { \
> > + 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4,
> 0xca
> > } \
> > + }
> > +
> > +typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
> > + ///
> > + /// Points to an Argc-element array of points to NULL-terminated strings
> > containing
> > + /// the command-line parameters. The first entry in the array is always
> the
> > full file
> > + /// path of the executable. Any quotation marks that were used to
> > preserve
> > + /// whitespace have been removed.
> > + ///
> > + CHAR16 **Argv;
> > +
> > + ///
> > + /// The number of elements in the Argv array.
> > + ///
> > + UINTN Argc;
> > +
> > + ///
> > + /// The file handle for the standard input for this executable. This may be
> > different
> > + /// from the ConInHandle in EFI_SYSTEM_TABLE.
> > + ///
> > + SHELL_FILE_HANDLE StdIn;
> > +
> > + ///
> > + /// The file handle for the standard output for this executable. This may
> be
> > different
> > + /// from the ConOutHandle in EFI_SYSTEM_TABLE.
> > + ///
> > + SHELL_FILE_HANDLE StdOut;
> > +
> > + ///
> > + /// The file handle for the standard error output for this executable. This
> > may be
> > + /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
> > + ///
> > + SHELL_FILE_HANDLE StdErr;
> > +} EFI_SHELL_PARAMETERS_PROTOCOL;
> > +
> > +extern EFI_GUID gEfiShellParametersProtocolGuid;
> > +
> > +#endif
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > index f1e5151..3e08bed 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -1645,6 +1645,21 @@ [Protocols]
> > ## Include/Protocol/EraseBlock.h
> > gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa,
> > 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}
> >
> > + #
> > + # Protocols defined in Shell2.0
> > + #
> > + ## Include/Protocol/Shell.h
> > + gEfiShellProtocolGuid = { 0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac,
> > 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }}
> > +
> > + ## Include/Protocol/ShellParameters.h
> > + gEfiShellParametersProtocolGuid = { 0x752f3136, 0x4e16, 0x4fdc, {0xa2,
> > 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca }}
> > +
> > + #
> > + # Protocols defined in Shell2.1
> > + #
> > + ## Include/Protocol/ShellDynamicCommand.h
> > + gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4,
> > {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> > +
> > #
> > # [Error.gEfiMdePkgTokenSpaceGuid]
> > # 0x80000001 | Invalid value provided.
> > --
> > 2.9.0.windows.1
> >
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
2016-10-18 5:56 ` Ni, Ruiyu
@ 2016-10-18 5:59 ` Kinney, Michael D
2016-10-18 15:19 ` Brian J. Johnson
0 siblings, 1 reply; 19+ messages in thread
From: Kinney, Michael D @ 2016-10-18 5:59 UTC (permalink / raw)
To: Ni, Ruiyu, Carsey, Jaben, edk2-devel@lists.01.org,
Kinney, Michael D
Cc: Yao, Jiewen
Use 'git mv' command.
Mike
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Tuesday, October 18, 2016 1:57 PM
> To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>
> Subject: RE: [edk2] [PATCH 2/5] MdePkg: Include
> Shell/ShellDynamicCommand/ShellParameters definitions
>
> I don't want to lose the file history either.
> I thought git can auto-detect the copy/move of files. I will investigate further.
>
> Thanks/Ray
>
> > -----Original Message-----
> > From: Carsey, Jaben
> > Sent: Tuesday, October 18, 2016 2:02 AM
> > To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen
> > <jiewen.yao@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
> > Subject: RE: [edk2] [PATCH 2/5] MdePkg: Include
> > Shell/ShellDynamicCommand/ShellParameters definitions
> >
> > Can we do a GIT move operation and then merge the content from
> > ShellBase.h please? I do not want to lose the file history information.
> >
> > When we move by "delete" then "add" we lose everything for no reason.
> >
> > -Jaben
> >
> > > -----Original Message-----
> > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > > Ruiyu Ni
> > > Sent: Friday, October 14, 2016 2:44 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Carsey, Jaben <jaben.carsey@intel.com>; Kinney, Michael D
> > > <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> > > Subject: [edk2] [PATCH 2/5] MdePkg: Include
> > > Shell/ShellDynamicCommand/ShellParameters definitions
> > > Importance: High
> > >
> > > Copy Shell/ShellDynamicCommand/ShellParameters definitions from
> > > ShellPkg to MdePkg.
> > > Content of ShellBase.h is moved to Protocol/Shell.h.
> > >
> > > The following patches will update ShellPkg to reference all protocol
> > > definition to MdePkg.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> > > Cc: Jaben Carsey <jaben.carsey@intel.com>
> > > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > ---
> > > MdePkg/Include/Protocol/Shell.h | 1268
> > > +++++++++++++++++++++++++
> > > MdePkg/Include/Protocol/ShellDynamicCommand.h | 85 ++
> > > MdePkg/Include/Protocol/ShellParameters.h | 60 ++
> > > MdePkg/MdePkg.dec | 15 +
> > > 4 files changed, 1428 insertions(+)
> > > create mode 100644 MdePkg/Include/Protocol/Shell.h
> > > create mode 100644 MdePkg/Include/Protocol/ShellDynamicCommand.h
> > > create mode 100644 MdePkg/Include/Protocol/ShellParameters.h
> > >
> > > diff --git a/MdePkg/Include/Protocol/Shell.h
> > > b/MdePkg/Include/Protocol/Shell.h
> > > new file mode 100644
> > > index 0000000..cc1fbdc
> > > --- /dev/null
> > > +++ b/MdePkg/Include/Protocol/Shell.h
> > > @@ -0,0 +1,1268 @@
> > > +/** @file
> > > + EFI Shell protocol as defined in the UEFI Shell 2.0 specification including
> > > errata.
> > > +
> > > + (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> > > + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> > > + This program and the accompanying materials
> > > + are licensed and made available under the terms and conditions of the
> > BSD
> > > License
> > > + which accompanies this distribution. The full text of the license may be
> > > found at
> > > + http://opensource.org/licenses/bsd-license.php
> > > +
> > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > > BASIS,
> > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > > EXPRESS OR IMPLIED.
> > > +
> > > +**/
> > > +
> > > +#ifndef __EFI_SHELL_PROTOCOL__
> > > +#define __EFI_SHELL_PROTOCOL__
> > > +
> > > +#include <Guid/FileInfo.h>
> > > +
> > > +#define EFI_SHELL_PROTOCOL_GUID \
> > > + { \
> > > + 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda,
> > 0x4e
> > > } \
> > > + }
> > > +typedef VOID *SHELL_FILE_HANDLE;
> > > +
> > > +typedef enum {
> > > + ///
> > > + /// The operation completed successfully.
> > > + ///
> > > + SHELL_SUCCESS = 0,
> > > +
> > > + ///
> > > + /// The image failed to load.
> > > + ///
> > > + SHELL_LOAD_ERROR = 1,
> > > +
> > > + ///
> > > + /// The parameter was incorrect.
> > > + ///
> > > + SHELL_INVALID_PARAMETER = 2,
> > > +
> > > + ///
> > > + /// The operation is not supported.
> > > + ///
> > > + SHELL_UNSUPPORTED = 3,
> > > +
> > > + ///
> > > + /// The buffer was not the proper size for the request.
> > > + ///
> > > + SHELL_BAD_BUFFER_SIZE = 4,
> > > +
> > > + ///
> > > + /// The buffer was not large enough to hold the requested data.
> > > + /// The required buffer size is returned in the appropriate
> > > + /// parameter when this error occurs.
> > > + ///
> > > + SHELL_BUFFER_TOO_SMALL = 5,
> > > +
> > > + ///
> > > + /// There is no data pending upon return.
> > > + ///
> > > + SHELL_NOT_READY = 6,
> > > +
> > > + ///
> > > + /// The physical device reported an error while attempting the
> > > + /// operation.
> > > + ///
> > > + SHELL_DEVICE_ERROR = 7,
> > > +
> > > + ///
> > > + /// The device cannot be written to.
> > > + ///
> > > + SHELL_WRITE_PROTECTED = 8,
> > > +
> > > + ///
> > > + /// The resource has run out.
> > > + ///
> > > + SHELL_OUT_OF_RESOURCES = 9,
> > > +
> > > + ///
> > > + /// An inconsistency was detected on the file system causing the
> > > + /// operation to fail.
> > > + ///
> > > + SHELL_VOLUME_CORRUPTED = 10,
> > > +
> > > + ///
> > > + /// There is no more space on the file system.
> > > + ///
> > > + SHELL_VOLUME_FULL = 11,
> > > +
> > > + ///
> > > + /// The device does not contain any medium to perform the
> > > + /// operation.
> > > + ///
> > > + SHELL_NO_MEDIA = 12,
> > > +
> > > + ///
> > > + /// The medium in the device has changed since the last
> > > + /// access.
> > > + ///
> > > + SHELL_MEDIA_CHANGED = 13,
> > > +
> > > + ///
> > > + /// The item was not found.
> > > + ///
> > > + SHELL_NOT_FOUND = 14,
> > > +
> > > + ///
> > > + /// Access was denied.
> > > + ///
> > > + SHELL_ACCESS_DENIED = 15,
> > > +
> > > + // note the skipping of 16 and 17
> > > +
> > > + ///
> > > + /// A timeout time expired.
> > > + ///
> > > + SHELL_TIMEOUT = 18,
> > > +
> > > + ///
> > > + /// The protocol has not been started.
> > > + ///
> > > + SHELL_NOT_STARTED = 19,
> > > +
> > > + ///
> > > + /// The protocol has already been started.
> > > + ///
> > > + SHELL_ALREADY_STARTED = 20,
> > > +
> > > + ///
> > > + /// The operation was aborted.
> > > + ///
> > > + SHELL_ABORTED = 21,
> > > +
> > > + // note the skipping of 22, 23, and 24
> > > +
> > > + ///
> > > + /// A function encountered an internal version that was
> > > + /// incompatible with a version requested by the caller.
> > > + ///
> > > + SHELL_INCOMPATIBLE_VERSION = 25,
> > > +
> > > + ///
> > > + /// The function was not performed due to a security violation.
> > > + ///
> > > + SHELL_SECURITY_VIOLATION = 26,
> > > +
> > > + ///
> > > + /// The function was performed and resulted in an unequal
> > > + /// comparison..
> > > + ///
> > > + SHELL_NOT_EQUAL = 27
> > > +} SHELL_STATUS;
> > > +
> > > +
> > > +// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
> > > +// they are identical outside of the name.
> > > +typedef struct {
> > > + LIST_ENTRY Link; ///< Linked list members.
> > > + EFI_STATUS Status; ///< Status of opening the file. Valid only if
> > > Handle != NULL.
> > > + CONST CHAR16 *FullName; ///< Fully qualified filename.
> > > + CONST CHAR16 *FileName; ///< name of this file.
> > > + SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the
> > opened
> > > file or NULL if closed.
> > > + EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this
> file or
> > > NULL.
> > > +} EFI_SHELL_FILE_INFO;
> > > +
> > > +/**
> > > + Returns whether any script files are currently being processed.
> > > +
> > > + @retval TRUE There is at least one script file active.
> > > + @retval FALSE No script files are active now.
> > > +
> > > +**/
> > > +typedef
> > > +BOOLEAN
> > > +(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
> > > + VOID
> > > + );
> > > +
> > > +/**
> > > + Closes the file handle.
> > > +
> > > + This function closes a specified file handle. All 'dirty' cached file data is
> > > + flushed to the device, and the file is closed. In all cases, the handle is
> > > + closed.
> > > +
> > > + @param[in] FileHandle The file handle to be closed.
> > > +
> > > + @retval EFI_SUCCESS The file closed sucessfully.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_CLOSE_FILE)(
> > > + IN SHELL_FILE_HANDLE FileHandle
> > > + );
> > > +
> > > +/**
> > > + Creates a file or directory by name.
> > > +
> > > + This function creates an empty new file or directory with the specified
> > > attributes and
> > > + returns the new file's handle. If the file already exists and is read-only,
> > > then
> > > + EFI_INVALID_PARAMETER will be returned.
> > > +
> > > + If the file already existed, it is truncated and its attributes updated. If
> the
> > > file is
> > > + created successfully, the FileHandle is the file's handle, else, the
> > FileHandle
> > > is NULL.
> > > +
> > > + If the file name begins with >v, then the file handle which is returned
> > > refers to the
> > > + shell environment variable with the specified name. If the shell
> > > environment variable
> > > + already exists and is non-volatile then EFI_INVALID_PARAMETER is
> > > returned.
> > > +
> > > + @param[in] FileName Pointer to NULL-terminated file path.
> > > + @param[in] FileAttribs The new file's attrbiutes. The different
> > > attributes are
> > > + described in EFI_FILE_PROTOCOL.Open().
> > > + @param[out] FileHandle On return, points to the created file handle
> > or
> > > directory's handle.
> > > +
> > > + @retval EFI_SUCCESS The file was opened. FileHandle points to the
> > > new file's handle.
> > > + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> > > value.
> > > + @retval EFI_UNSUPPORTED The file path could not be opened.
> > > + @retval EFI_NOT_FOUND The specified file could not be found on
> > the
> > > device, or could not
> > > + file the file system on the device.
> > > + @retval EFI_NO_MEDIA The device has no medium.
> > > + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> > > or the medium is no
> > > + longer supported.
> > > + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> > > the file path according
> > > + the DirName.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
> > or
> > > open a file for write
> > > + when the media is write-protected.
> > > + @retval EFI_ACCESS_DENIED The service denied access to the file.
> > > + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> > > to open the file.
> > > + @retval EFI_VOLUME_FULL The volume is full.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_CREATE_FILE)(
> > > + IN CONST CHAR16 *FileName,
> > > + IN UINT64 FileAttribs,
> > > + OUT SHELL_FILE_HANDLE *FileHandle
> > > + );
> > > +
> > > +/**
> > > + Deletes the file specified by the file handle.
> > > +
> > > + This function closes and deletes a file. In all cases, the file handle is
> closed.
> > > If the file
> > > + cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
> > > returned, but the
> > > + handle is still closed.
> > > +
> > > + @param[in] FileHandle The file handle to delete.
> > > +
> > > + @retval EFI_SUCCESS The file was closed and deleted and the
> > handle
> > > was closed.
> > > + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> > > was not deleted.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_DELETE_FILE)(
> > > + IN SHELL_FILE_HANDLE FileHandle
> > > + );
> > > +
> > > +/**
> > > + Deletes the file specified by the file name.
> > > +
> > > + This function deletes a file.
> > > +
> > > + @param[in] FileName Points to the NULL-terminated file name.
> > > +
> > > + @retval EFI_SUCCESS The file was deleted.
> > > + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
> > > was not deleted.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
> > > + IN CONST CHAR16 *FileName
> > > + );
> > > +
> > > +/**
> > > + Disables the page break output mode.
> > > +**/
> > > +typedef
> > > +VOID
> > > +(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
> > > + VOID
> > > + );
> > > +
> > > +/**
> > > + Enables the page break output mode.
> > > +**/
> > > +typedef
> > > +VOID
> > > +(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
> > > + VOID
> > > + );
> > > +
> > > +/**
> > > + Execute the command line.
> > > +
> > > + This function creates a nested instance of the shell and executes the
> > > specified
> > > + command (CommandLine) with the specified environment
> > (Environment).
> > > Upon return,
> > > + the status code returned by the specified command is placed in
> > > StatusCode.
> > > +
> > > + If Environment is NULL, then the current environment is used and all
> > > changes made
> > > + by the commands executed will be reflected in the current environment.
> > If
> > > the
> > > + Environment is non-NULL, then the changes made will be discarded.
> > > +
> > > + The CommandLine is executed from the current working directory on the
> > > current
> > > + device.
> > > +
> > > + @param[in] ParentImageHandle A handle of the image that is executing
> > > the specified
> > > + command line.
> > > + @param[in] CommandLine Points to the NULL-terminated UCS-2
> > > encoded string
> > > + containing the command line. If NULL then the
> command-
> > > + line will be empty.
> > > + @param[in] Environment Points to a NULL-terminated array of
> > > environment
> > > + variables with the format 'x=y', where x is the
> > > + environment variable name and y is the value. If
> this
> > > + is NULL, then the current shell environment is
> used.
> > > + @param[out] ErrorCode Points to the status code returned by the
> > > command.
> > > +
> > > + @retval EFI_SUCCESS The command executed successfully. The
> > > status code
> > > + returned by the command is pointed to by
> StatusCode.
> > > + @retval EFI_INVALID_PARAMETER The parameters are invalid.
> > > + @retval EFI_OUT_OF_RESOURCES Out of resources.
> > > + @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_EXECUTE) (
> > > + IN EFI_HANDLE *ParentImageHandle,
> > > + IN CHAR16 *CommandLine OPTIONAL,
> > > + IN CHAR16 **Environment OPTIONAL,
> > > + OUT EFI_STATUS *StatusCode OPTIONAL
> > > + );
> > > +
> > > +/**
> > > + Find files that match a specified pattern.
> > > +
> > > + This function searches for all files and directories that match the specified
> > > + FilePattern. The FilePattern can contain wild-card characters. The
> > resulting
> > > file
> > > + information is placed in the file list FileList.
> > > +
> > > + The files in the file list are not opened. The OpenMode field is set to 0
> > and
> > > the FileInfo
> > > + field is set to NULL.
> > > +
> > > + @param[in] FilePattern Points to a NULL-terminated shell file path,
> > > including wildcards.
> > > + @param[out] FileList On return, points to the start of a file list
> > > containing the names
> > > + of all matching files or else points to NULL if
> no matching
> > > files
> > > + were found.
> > > +
> > > + @retval EFI_SUCCESS Files found.
> > > + @retval EFI_NOT_FOUND No files found.
> > > + @retval EFI_NO_MEDIA The device has no media.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_FIND_FILES)(
> > > + IN CONST CHAR16 *FilePattern,
> > > + OUT EFI_SHELL_FILE_INFO **FileList
> > > + );
> > > +
> > > +/**
> > > + Find all files in a specified directory.
> > > +
> > > + @param[in] FileDirHandle Handle of the directory to search.
> > > + @param[out] FileList On return, points to the list of files in the
> > > directory
> > > + or NULL if there are no files in the directory.
> > > +
> > > + @retval EFI_SUCCESS File information was returned successfully.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures have
> > been
> > > corrupted.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_NO_MEDIA The device media is not present.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
> > > +IN SHELL_FILE_HANDLE FileDirHandle,
> > > +OUT EFI_SHELL_FILE_INFO **FileList
> > > +);
> > > +
> > > +/**
> > > + Flushes data back to a device.
> > > +
> > > + This function flushes all modified data associated with a file to a device.
> > > +
> > > + @param[in] FileHandle The handle of the file to flush.
> > > +
> > > + @retval EFI_SUCCESS The data was flushed.
> > > + @retval EFI_NO_MEDIA The device has no medium.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> > > + @retval EFI_ACCESS_DENIED The file was opened read-only.
> > > + @retval EFI_VOLUME_FULL The volume is full.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_FLUSH_FILE)(
> > > + IN SHELL_FILE_HANDLE FileHandle
> > > + );
> > > +
> > > +/**
> > > + Frees the file list.
> > > +
> > > + This function cleans up the file list and any related data structures. It has
> > no
> > > + impact on the files themselves.
> > > +
> > > + @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO
> is
> > > + defined in OpenFileList().
> > > +
> > > + @retval EFI_SUCCESS Free the file list successfully.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
> > > + IN EFI_SHELL_FILE_INFO **FileList
> > > + );
> > > +
> > > +/**
> > > + Returns the current directory on the specified device.
> > > +
> > > + If FileSystemMapping is NULL, it returns the current working directory. If
> > > the
> > > + FileSystemMapping is not NULL, it returns the current directory
> > associated
> > > with the
> > > + FileSystemMapping. In both cases, the returned name includes the file
> > > system
> > > + mapping (i.e. fs0:\current-dir).
> > > +
> > > + Note that the current directory string should exclude the tailing backslash
> > > character.
> > > +
> > > + @param[in] FileSystemMapping A pointer to the file system mapping. If
> > > NULL,
> > > + then the current working directory is returned.
> > > +
> > > + @retval !=NULL The current directory.
> > > + @retval NULL Current directory does not exist.
> > > +**/
> > > +typedef
> > > +CONST CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
> > > + IN CONST CHAR16 *FileSystemMapping OPTIONAL
> > > + );
> > > +
> > > +typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
> > > +#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
> > > +#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
> > > +
> > > +/**
> > > + Gets the name of the device specified by the device handle.
> > > +
> > > + This function gets the user-readable name of the device specified by the
> > > device
> > > + handle. If no user-readable name could be generated, then
> > > *BestDeviceName will be
> > > + NULL and EFI_NOT_FOUND will be returned.
> > > +
> > > + If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the
> > function
> > > will return the
> > > + device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if
> > present
> > > on
> > > + DeviceHandle.
> > > +
> > > + If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will
> > > return the
> > > + device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on
> > > DeviceHandle.
> > > + If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
> > > + EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
> > > + EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
> > > +
> > > + @param[in] DeviceHandle The handle of the device.
> > > + @param[in] Flags Determines the possible sources of component
> > > names.
> > > + @param[in] Language A pointer to the language specified for the
> > > device
> > > + name, in the same format as described in the
> UEFI
> > > + specification, Appendix M.
> > > + @param[out] BestDeviceName On return, points to the callee-
> > allocated
> > > NULL-
> > > + terminated name of the device. If no device name
> > > + could be found, points to NULL. The name must be
> > > + freed by the caller...
> > > +
> > > + @retval EFI_SUCCESS Get the name successfully.
> > > + @retval EFI_NOT_FOUND Fail to get the device name.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
> > > + IN EFI_HANDLE DeviceHandle,
> > > + IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
> > > + IN CHAR8 *Language,
> > > + OUT CHAR16 **BestDeviceName
> > > + );
> > > +
> > > +/**
> > > + Gets the device path from the mapping.
> > > +
> > > + This function gets the device path associated with a mapping.
> > > +
> > > + @param[in] Mapping A pointer to the mapping
> > > +
> > > + @retval !=NULL Pointer to the device path that corresponds to
> > the
> > > + device mapping. The returned pointer does not
> need
> > > + to be freed.
> > > + @retval NULL There is no device path associated with the
> > > + specified mapping.
> > > +**/
> > > +typedef
> > > +CONST EFI_DEVICE_PATH_PROTOCOL *
> > > +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
> > > + IN CONST CHAR16 *Mapping
> > > + );
> > > +
> > > +/**
> > > + Converts a file system style name to a device path.
> > > +
> > > + This function converts a file system style name to a device path, by
> > > replacing any
> > > + mapping references to the associated device path.
> > > +
> > > + @param[in] Path The pointer to the path.
> > > +
> > > + @return The pointer of the file path. The file path is
> callee
> > > + allocated and should be freed by the caller.
> > > +**/
> > > +typedef
> > > +EFI_DEVICE_PATH_PROTOCOL *
> > > +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
> > > + IN CONST CHAR16 *Path
> > > + );
> > > +
> > > +/**
> > > + Gets either a single or list of environment variables.
> > > +
> > > + If name is not NULL then this function returns the current value of the
> > > specified
> > > + environment variable.
> > > +
> > > + If Name is NULL than a list of all environment variable names is returned.
> > > Each a
> > > + NULL terminated string with a double NULL terminating the list.
> > > +
> > > + @param[in] Name A pointer to the environment variable name.
> > If
> > > + Name is NULL, then the function will return all
> > > + of the defined shell environment variables. In
> > > + the case where multiple environment variables
> are
> > > + being returned, each variable will be terminated
> by
> > > + a NULL, and the list will be terminated by a
> double
> > > + NULL.
> > > +
> > > + @return A pointer to the returned string.
> > > + The returned pointer does not need to be freed
> by the
> > > caller.
> > > +
> > > + @retval NULL The environment variable doesn't exist or there
> > are
> > > + no environment variables.
> > > +**/
> > > +typedef
> > > +CONST CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_ENV) (
> > > + IN CONST CHAR16 *Name OPTIONAL
> > > + );
> > > +
> > > +/**
> > > + Gets the environment variable and Attributes, or list of environment
> > > variables. Can be
> > > + used instead of GetEnv().
> > > +
> > > + This function returns the current value of the specified environment
> > > variable and
> > > + the Attributes. If no variable name was specified, then all of the known
> > > + variables will be returned.
> > > +
> > > + @param[in] Name A pointer to the environment variable name. If
> > > Name is NULL,
> > > + then the function will return all of the defined
> shell
> > > + environment variables. In the case where
> multiple
> > > environment
> > > + variables are being returned, each variable will
> be
> > > terminated
> > > + by a NULL, and the list will be terminated by a
> double
> > NULL.
> > > + @param[out] Attributes If not NULL, a pointer to the returned
> > > attributes bitmask for
> > > + the environment variable. In the case where Name
> is
> > NULL,
> > > and
> > > + multiple environment variables are being
> returned,
> > > Attributes
> > > + is undefined.
> > > +
> > > + @retval NULL The environment variable doesn't exist.
> > > + @return The environment variable's value. The returned
> > > pointer does not
> > > + need to be freed by the caller.
> > > +**/
> > > +typedef
> > > +CONST CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_ENV_EX) (
> > > + IN CONST CHAR16 *Name,
> > > + OUT UINT32 *Attributes OPTIONAL
> > > + );
> > > +
> > > +/**
> > > + Gets the file information from an open file handle.
> > > +
> > > + This function allocates a buffer to store the file's information. It's the
> > > caller's
> > > + responsibility to free the buffer.
> > > +
> > > + @param[in] FileHandle A File Handle.
> > > +
> > > + @retval NULL Cannot get the file info.
> > > + @return A pointer to a buffer with file information.
> > > +**/
> > > +typedef
> > > +EFI_FILE_INFO *
> > > +(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
> > > + IN SHELL_FILE_HANDLE FileHandle
> > > + );
> > > +
> > > +/**
> > > + Converts a device path to a file system-style path.
> > > +
> > > + This function converts a device path to a file system path by replacing
> > part,
> > > or all, of
> > > + the device path with the file-system mapping. If there are more than
> > one
> > > application
> > > + file system mappings, the one that most closely matches Path will be
> > used.
> > > +
> > > + @param[in] Path The pointer to the device path.
> > > +
> > > + @return The pointer of the NULL-terminated file path.
> The
> > path
> > > + is callee-allocated and should be freed by the
> caller.
> > > +**/
> > > +typedef
> > > +CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
> > > + IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
> > > + );
> > > +
> > > +/**
> > > + Gets a file's current position.
> > > +
> > > + This function returns the current file position for the file handle. For
> > > directories, the
> > > + current file position has no meaning outside of the file system driver and
> > > as such, the
> > > + operation is not supported.
> > > +
> > > + @param[in] FileHandle The file handle on which to get the current
> > > position.
> > > + @param[out] Position Byte position from the start of the file.
> > > +
> > > + @retval EFI_SUCCESS Data was accessed.
> > > + @retval EFI_UNSUPPORTED The request is not valid on open
> > > directories.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + OUT UINT64 *Position
> > > + );
> > > +
> > > +/**
> > > + Gets the size of a file.
> > > +
> > > + This function returns the size of the file specified by FileHandle.
> > > +
> > > + @param[in] FileHandle The handle of the file.
> > > + @param[out] Size The size of this file.
> > > +
> > > + @retval EFI_SUCCESS Get the file's size.
> > > + @retval EFI_DEVICE_ERROR Can't access the file.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + OUT UINT64 *Size
> > > + );
> > > +
> > > +/**
> > > + Get the GUID value from a human readable name.
> > > +
> > > + If GuidName is a known GUID name, then update Guid to have the
> > correct
> > > value for
> > > + that GUID.
> > > +
> > > + This function is only available when the major and minor versions in the
> > > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > > +
> > > + @param[in] GuidName A pointer to the localized name for the GUID
> > > being queried.
> > > + @param[out] Guid A pointer to the GUID structure to be filled in.
> > > +
> > > + @retval EFI_SUCCESS The operation was successful.
> > > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > > + @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
> > > + IN CONST CHAR16 *GuidName,
> > > + OUT EFI_GUID *Guid
> > > + );
> > > +
> > > +/**
> > > + Get the human readable name for a GUID from the value.
> > > +
> > > + If Guid is assigned a name, then update *GuidName to point to the
> > name.
> > > The callee
> > > + should not modify the value.
> > > +
> > > + This function is only available when the major and minor versions in the
> > > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > > +
> > > + @param[in] Guid A pointer to the GUID being queried.
> > > + @param[out] GuidName A pointer to a pointer the localized to name
> > for
> > > the GUID being requested
> > > +
> > > + @retval EFI_SUCCESS The operation was successful.
> > > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > > + @retval EFI_NOT_FOUND Guid is not assigned a name.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
> > > + IN CONST EFI_GUID *Guid,
> > > + OUT CONST CHAR16 **GuidName
> > > + );
> > > +
> > > +/**
> > > + Return help information about a specific command.
> > > +
> > > + This function returns the help information for the specified command.
> > The
> > > help text
> > > + can be internal to the shell or can be from a UEFI Shell manual page.
> > > +
> > > + If Sections is specified, then each section name listed will be compared in
> > a
> > > casesensitive
> > > + manner, to the section names described in Appendix B. If the section
> > > exists,
> > > + it will be appended to the returned help text. If the section does not
> > exist,
> > > no
> > > + information will be returned. If Sections is NULL, then all help text
> > > information
> > > + available will be returned.
> > > +
> > > + @param[in] Command Points to the NULL-terminated UEFI Shell
> > > command name.
> > > + @param[in] Sections Points to the NULL-terminated comma-
> > > delimited
> > > + section names to return. If NULL, then all
> > > + sections will be returned.
> > > + @param[out] HelpText On return, points to a callee-allocated buffer
> > > + containing all specified help text.
> > > +
> > > + @retval EFI_SUCCESS The help text was returned.
> > > + @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be
> > > allocated to hold the
> > > + returned help text.
> > > + @retval EFI_INVALID_PARAMETER HelpText is NULL.
> > > + @retval EFI_NOT_FOUND There is no help text available for
> > > Command.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
> > > + IN CONST CHAR16 *Command,
> > > + IN CONST CHAR16 *Sections OPTIONAL,
> > > + OUT CHAR16 **HelpText
> > > + );
> > > +
> > > +/**
> > > + Gets the mapping(s) that most closely matches the device path.
> > > +
> > > + This function gets the mapping which corresponds to the device path
> > > *DevicePath. If
> > > + there is no exact match, then the mapping which most closely matches
> > > *DevicePath
> > > + is returned, and *DevicePath is updated to point to the remaining
> > portion
> > > of the
> > > + device path. If there is an exact match, the mapping is returned and
> > > *DevicePath
> > > + points to the end-of-device-path node.
> > > +
> > > + If there are multiple map names they will be semi-colon seperated in the
> > > + NULL-terminated string.
> > > +
> > > + @param[in, out] DevicePath On entry, points to a device path pointer.
> > > On
> > > + exit, updates the pointer to point to the
> > > + portion of the device path after the mapping.
> > > +
> > > + @retval NULL No mapping was found.
> > > + @retval !=NULL Pointer to NULL-terminated mapping. The buffer
> > > + is callee allocated and should be freed by the
> caller.
> > > +**/
> > > +typedef
> > > +CONST CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
> > > + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
> > > + );
> > > +
> > > +/**
> > > + Gets the enable status of the page break output mode.
> > > +
> > > + User can use this function to determine current page break mode.
> > > +
> > > + @retval TRUE The page break output mode is enabled.
> > > + @retval FALSE The page break output mode is disabled.
> > > +**/
> > > +typedef
> > > +BOOLEAN
> > > +(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
> > > + VOID
> > > + );
> > > +
> > > +/**
> > > + Judges whether the active shell is the root shell.
> > > +
> > > + This function makes the user to know that whether the active Shell is the
> > > root shell.
> > > +
> > > + @retval TRUE The active Shell is the root Shell.
> > > + @retval FALSE The active Shell is NOT the root Shell.
> > > +**/
> > > +typedef
> > > +BOOLEAN
> > > +(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
> > > +VOID
> > > +);
> > > +
> > > +/**
> > > + Opens a file or a directory by file name.
> > > +
> > > + This function opens the specified file in the specified OpenMode and
> > > returns a file
> > > + handle.
> > > + If the file name begins with '>v', then the file handle which is returned
> > > refers to the
> > > + shell environment variable with the specified name. If the shell
> > > environment variable
> > > + exists, is non-volatile and the OpenMode indicates
> > > EFI_FILE_MODE_WRITE, then
> > > + EFI_INVALID_PARAMETER is returned.
> > > +
> > > + If the file name is '>i', then the file handle which is returned refers to the
> > > standard
> > > + input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then
> > > EFI_INVALID_PARAMETER
> > > + is returned.
> > > +
> > > + If the file name is '>o', then the file handle which is returned refers to
> > the
> > > standard
> > > + output. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > > EFI_INVALID_PARAMETER
> > > + is returned.
> > > +
> > > + If the file name is '>e', then the file handle which is returned refers to
> > the
> > > standard
> > > + error. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > > EFI_INVALID_PARAMETER
> > > + is returned.
> > > +
> > > + If the file name is 'NUL', then the file handle that is returned refers to the
> > > standard NUL
> > > + file. If the OpenMode indicates EFI_FILE_MODE_READ, then
> > > EFI_INVALID_PARAMETER is
> > > + returned.
> > > +
> > > + If return EFI_SUCCESS, the FileHandle is the opened file's handle, else,
> > the
> > > + FileHandle is NULL.
> > > +
> > > + @param[in] FileName Points to the NULL-terminated UCS-2
> > encoded
> > > file name.
> > > + @param[out] FileHandle On return, points to the file handle.
> > > + @param[in] OpenMode File open mode. Either
> > > EFI_FILE_MODE_READ or
> > > + EFI_FILE_MODE_WRITE from section 12.4 of the
> UEFI
> > > + Specification.
> > > + @retval EFI_SUCCESS The file was opened. FileHandle has the
> > > opened file's handle.
> > > + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
> > > value. FileHandle is NULL.
> > > + @retval EFI_UNSUPPORTED Could not open the file path. FileHandle
> > is
> > > NULL.
> > > + @retval EFI_NOT_FOUND The specified file could not be found on
> > the
> > > device or the file
> > > + system could not be found on the device.
> FileHandle is
> > > NULL.
> > > + @retval EFI_NO_MEDIA The device has no medium. FileHandle is
> > > NULL.
> > > + @retval EFI_MEDIA_CHANGED The device has a different medium in it
> > > or the medium is no
> > > + longer supported. FileHandle is NULL.
> > > + @retval EFI_DEVICE_ERROR The device reported an error or can't get
> > > the file path according
> > > + the FileName. FileHandle is NULL.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted. FileHandle is NULL.
> > > + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
> > or
> > > open a file for write
> > > + when the media is write-protected. FileHandle is
> NULL.
> > > + @retval EFI_ACCESS_DENIED The service denied access to the file.
> > > FileHandle is NULL.
> > > + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
> > > to open the file. FileHandle
> > > + is NULL.
> > > + @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
> > > + IN CONST CHAR16 *FileName,
> > > + OUT SHELL_FILE_HANDLE *FileHandle,
> > > + IN UINT64 OpenMode
> > > + );
> > > +
> > > +/**
> > > + Opens the files that match the path specified.
> > > +
> > > + This function opens all of the files specified by Path. Wildcards are
> > > processed
> > > + according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
> > > + matching file has an EFI_SHELL_FILE_INFO structure created in a linked
> > list.
> > > +
> > > + @param[in] Path A pointer to the path string.
> > > + @param[in] OpenMode Specifies the mode used to open each file,
> > > EFI_FILE_MODE_READ or
> > > + EFI_FILE_MODE_WRITE.
> > > + @param[in, out] FileList Points to the start of a list of files opened.
> > > +
> > > + @retval EFI_SUCCESS Create the file list successfully.
> > > + @return Can't create the file list.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
> > > + IN CHAR16 *Path,
> > > + IN UINT64 OpenMode,
> > > + IN OUT EFI_SHELL_FILE_INFO **FileList
> > > + );
> > > +
> > > +/**
> > > + Opens the root directory of a device.
> > > +
> > > + This function opens the root directory of a device and returns a file
> > handle
> > > to it.
> > > +
> > > + @param[in] DevicePath Points to the device path corresponding to
> > the
> > > device where the
> > > + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
> > > + @param[out] FileHandle On exit, points to the file handle
> > > corresponding to the root directory on the
> > > + device.
> > > +
> > > + @retval EFI_SUCCESS Root opened successfully.
> > > + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> > > found or the root directory
> > > + could not be opened.
> > > + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> > > were corrupted.
> > > + @retval EFI_DEVICE_ERROR The device had an error.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_OPEN_ROOT)(
> > > + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> > > + OUT SHELL_FILE_HANDLE *FileHandle
> > > + );
> > > +
> > > +/**
> > > + Opens the root directory of a device on a handle.
> > > +
> > > + This function opens the root directory of a device and returns a file
> > handle
> > > to it.
> > > +
> > > + @param[in] DeviceHandle The handle of the device that contains the
> > > volume.
> > > + @param[out] FileHandle On exit, points to the file handle
> > > corresponding to the root directory on the
> > > + device.
> > > +
> > > + @retval EFI_SUCCESS Root opened successfully.
> > > + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
> > > found or the root directory
> > > + could not be opened.
> > > + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
> > > were corrupted.
> > > + @retval EFI_DEVICE_ERROR The device had an error.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
> > > + IN EFI_HANDLE DeviceHandle,
> > > + OUT SHELL_FILE_HANDLE *FileHandle
> > > + );
> > > +
> > > +/**
> > > + Reads data from the file.
> > > +
> > > + If FileHandle is not a directory, the function reads the requested number
> > > of bytes
> > > + from the file at the file's current position and returns them in Buffer. If
> > the
> > > read goes
> > > + beyond the end of the file, the read length is truncated to the end of the
> > > file. The file's
> > > + current position is increased by the number of bytes returned.
> > > + If FileHandle is a directory, then an error is returned.
> > > +
> > > + @param[in] FileHandle The opened file handle for read.
> > > + @param[in] ReadSize On input, the size of Buffer, in bytes. On
> > > output, the amount of data read.
> > > + @param[in, out] Buffer The buffer in which data is read.
> > > +
> > > + @retval EFI_SUCCESS Data was read.
> > > + @retval EFI_NO_MEDIA The device has no media.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > + @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains
> > > required size.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_READ_FILE) (
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + IN OUT UINTN *ReadSize,
> > > + IN OUT VOID *Buffer
> > > + );
> > > +
> > > +/**
> > > + Register a GUID and a localized human readable name for it.
> > > +
> > > + If Guid is not assigned a name, then assign GuidName to Guid. This list of
> > > GUID
> > > + names must be used whenever a shell command outputs GUID
> > > information.
> > > +
> > > + This function is only available when the major and minor versions in the
> > > + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
> > > +
> > > + @param[in] Guid A pointer to the GUID being registered.
> > > + @param[in] GuidName A pointer to the localized name for the GUID
> > > being registered.
> > > +
> > > + @retval EFI_SUCCESS The operation was successful.
> > > + @retval EFI_INVALID_PARAMETER Guid was NULL.
> > > + @retval EFI_INVALID_PARAMETER GuidName was NULL.
> > > + @retval EFI_ACCESS_DENIED Guid already is assigned a name.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
> > > + IN CONST EFI_GUID *Guid,
> > > + IN CONST CHAR16 *GuidName
> > > + );
> > > +
> > > +/**
> > > + Deletes the duplicate file names files in the given file list.
> > > +
> > > + @param[in] FileList A pointer to the first entry in the file list.
> > > +
> > > + @retval EFI_SUCCESS Always success.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
> > > + IN EFI_SHELL_FILE_INFO **FileList
> > > + );
> > > +
> > > +/**
> > > + Changes a shell command alias.
> > > +
> > > + This function creates an alias for a shell command.
> > > +
> > > + @param[in] Command Points to the NULL-terminated shell
> > > command or existing alias.
> > > + @param[in] Alias Points to the NULL-terminated alias for the
> shell
> > > command. If this is NULL, and
> > > + Command refers to an alias, that alias will be
> deleted.
> > > + @param[in] Replace If TRUE and the alias already exists, then the
> > > existing alias will be replaced. If
> > > + FALSE and the alias already exists, then the
> existing alias is
> > > unchanged and
> > > + EFI_ACCESS_DENIED is returned.
> > > + @param[in] Volatile if TRUE the Alias being set will be stored in a
> > > volatile fashion. if FALSE the
> > > + Alias being set will be stored in a non-volatile
> fashion.
> > > +
> > > + @retval EFI_SUCCESS Alias created or deleted successfully.
> > > + @retval EFI_ACCESS_DENIED The alias is a built-in alias or already
> > existed
> > > and Replace was set to
> > > + FALSE.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_ALIAS)(
> > > + IN CONST CHAR16 *Command,
> > > + IN CONST CHAR16 *Alias,
> > > + IN BOOLEAN Replace,
> > > + IN BOOLEAN Volatile
> > > + );
> > > +
> > > +/**
> > > + This function returns the command associated with a alias or a list of all
> > > + alias'.
> > > +
> > > + @param[in] Alias Points to the NULL-terminated shell alias.
> > > + If this parameter is NULL, then all
> > > + aliases will be returned in ReturnedData.
> > > + @param[out] Volatile Upon return of a single command if TRUE
> > > indicates
> > > + this is stored in a volatile fashion. FALSE
> otherwise.
> > > + @return If Alias is not NULL, it will return a
> pointer to
> > > + the NULL-terminated command for that alias.
> > > + If Alias is NULL, ReturnedData points to a ';'
> > > + delimited list of alias (e.g.
> > > + ReturnedData = "dir;del;copy;mfp") that is NULL-
> > > terminated.
> > > + @retval NULL An error ocurred.
> > > + @retval NULL Alias was not a valid Alias.
> > > +**/
> > > +typedef
> > > +CONST CHAR16 *
> > > +(EFIAPI *EFI_SHELL_GET_ALIAS)(
> > > + IN CONST CHAR16 *Alias,
> > > + OUT BOOLEAN *Volatile OPTIONAL
> > > + );
> > > +
> > > +/**
> > > + Changes the current directory on the specified device.
> > > +
> > > + If the FileSystem is NULL, and the directory Dir does not contain a file
> > > system's
> > > + mapped name, this function changes the current working directory. If
> > > FileSystem is
> > > + NULL and the directory Dir contains a mapped name, then the current
> > file
> > > system and
> > > + the current directory on that file system are changed.
> > > +
> > > + If FileSystem is not NULL, and Dir is NULL, then this changes the current
> > > working file
> > > + system.
> > > +
> > > + If FileSystem is not NULL and Dir is not NULL, then this function changes
> > > the current
> > > + directory on the specified file system.
> > > +
> > > + If the current working directory or the current working file system is
> > > changed then the
> > > + %cwd% environment variable will be updated.
> > > +
> > > + @param[in] FileSystem A pointer to the file system's mapped name.
> > If
> > > NULL, then the current working
> > > + directory is changed.
> > > + @param[in] Dir Points to the NULL-terminated directory on the
> > > device specified by FileSystem.
> > > +
> > > + @retval NULL Current directory does not exist.
> > > + @return The current directory.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
> > > + IN CONST CHAR16 *FileSystem OPTIONAL,
> > > + IN CONST CHAR16 *Dir
> > > + );
> > > +
> > > +/**
> > > + Sets the environment variable.
> > > +
> > > + This function changes the current value of the specified environment
> > > variable. If the
> > > + environment variable exists and the Value is an empty string, then the
> > > environment
> > > + variable is deleted. If the environment variable exists and the Value is
> > not
> > > an empty
> > > + string, then the value of the environment variable is changed. If the
> > > environment
> > > + variable does not exist and the Value is an empty string, there is no
> > action.
> > > If the
> > > + environment variable does not exist and the Value is a non-empty string,
> > > then the
> > > + environment variable is created and assigned the specified value.
> > > +
> > > + For a description of volatile and non-volatile environment variables, see
> > > UEFI Shell
> > > + 2.0 specification section 3.6.1.
> > > +
> > > + @param[in] Name Points to the NULL-terminated environment
> > > variable name.
> > > + @param[in] Value Points to the NULL-terminated environment
> > > variable value. If the value is an
> > > + empty string then the environment variable is
> deleted.
> > > + @param[in] Volatile Indicates whether the variable is non-volatile
> > > (FALSE) or volatile (TRUE).
> > > +
> > > + @retval EFI_SUCCESS The environment variable was successfully
> > > updated.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_ENV) (
> > > + IN CONST CHAR16 *Name,
> > > + IN CONST CHAR16 *Value,
> > > + IN BOOLEAN Volatile
> > > + );
> > > +
> > > +/**
> > > + Sets the file information to an opened file handle.
> > > +
> > > + This function changes file information. All file information in the
> > > EFI_FILE_INFO
> > > + struct will be updated to the passed in data.
> > > +
> > > + @param[in] FileHandle A file handle.
> > > + @param[in] FileInfo Points to new file information.
> > > +
> > > + @retval EFI_SUCCESS The information was set.
> > > + @retval EFI_NO_MEDIA The device has no medium.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
> > > + @retval EFI_ACCESS_DENIED The file was opened read-only.
> > > + @retval EFI_VOLUME_FULL The volume is full.
> > > + @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of
> > > EFI_FILE_INFO.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + IN CONST EFI_FILE_INFO *FileInfo
> > > + );
> > > +
> > > +/**
> > > + Sets a file's current position.
> > > +
> > > + This function sets the current file position for the handle to the position
> > > supplied. With
> > > + the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute
> > > positioning is
> > > + supported, and seeking past the end of the file is allowed (a subsequent
> > > write would
> > > + grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the
> > current
> > > position
> > > + to be set to the end of the file.
> > > +
> > > + @param[in] FileHandle The file handle on which requested position
> > > will be set.
> > > + @param[in] Position Byte position from the start of the file.
> > > +
> > > + @retval EFI_SUCCESS Data was written.
> > > + @retval EFI_UNSUPPORTED The seek request for nonzero is not valid
> > > on open directories.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + IN UINT64 Position
> > > + );
> > > +
> > > +/**
> > > + This function creates a mapping for a device path.
> > > +
> > > + @param[in] DevicePath Points to the device path. If this is NULL and
> > > Mapping points to a valid mapping,
> > > + then the mapping will be deleted.
> > > + @param[in] Mapping Points to the NULL-terminated mapping for
> > the
> > > device path.
> > > +
> > > + @retval EFI_SUCCESS Mapping created or deleted successfully.
> > > + @retval EFI_NO_MAPPING There is no handle that corresponds
> > exactly
> > > to DevicePath. See the
> > > + boot service function LocateDevicePath().
> > > + @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_SET_MAP)(
> > > + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
> > > + IN CONST CHAR16 *Mapping
> > > + );
> > > +
> > > +/**
> > > + Writes data to the file.
> > > +
> > > + This function writes the specified number of bytes to the file at the
> > current
> > > file position.
> > > + The current file position is advanced the actual number of bytes written,
> > > which is
> > > + returned in BufferSize. Partial writes only occur when there has been a
> > > data error
> > > + during the write attempt (such as "volume space full"). The file
> > > automatically grows to
> > > + hold the data, if required.
> > > +
> > > + Direct writes to opened directories are not supported.
> > > +
> > > + @param[in] FileHandle The opened file handle for writing.
> > > + @param[in, out] BufferSize On input, size of Buffer.
> > > + @param[in] Buffer The buffer in which data to write.
> > > +
> > > + @retval EFI_SUCCESS Data was written.
> > > + @retval EFI_UNSUPPORTED Writes to open directory are not
> > > supported.
> > > + @retval EFI_NO_MEDIA The device has no media.
> > > + @retval EFI_DEVICE_ERROR The device reported an error.
> > > + @retval EFI_VOLUME_CORRUPTED The file system structures are
> > > corrupted.
> > > + @retval EFI_WRITE_PROTECTED The device is write-protected.
> > > + @retval EFI_ACCESS_DENIED The file was open for read only.
> > > + @retval EFI_VOLUME_FULL The volume is full.
> > > +**/
> > > +typedef
> > > +EFI_STATUS
> > > +(EFIAPI *EFI_SHELL_WRITE_FILE)(
> > > + IN SHELL_FILE_HANDLE FileHandle,
> > > + IN OUT UINTN *BufferSize,
> > > + IN VOID *Buffer
> > > + );
> > > +
> > > +//
> > > +// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
> > > +// Usage of this protocol will require version checking before attempting
> > > +// to use any new members. There is no need to check the version for
> > > +// members that existed in UEFI Shell Spec 2.0.
> > > +//
> > > +// Update below for any future UEFI Shell spec changes to this protocol.
> > > +//
> > > +// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
> > > +// if ((2 == gEfiShellProtocol->MajorVersion) &&
> > > +// (0 == gEfiShellProtocol->MinorVersion)) {
> > > +// //
> > > +// // Cannot call:
> > > +// // RegisterGuidName - UEFI Shell 2.1
> > > +// // GetGuidName - UEFI Shell 2.1
> > > +// // GetGuidFromName - UEFI Shell 2.1
> > > +// // GetEnvEx - UEFI Shell 2.1
> > > +// //
> > > +// } else {
> > > +// //
> > > +// // Can use all members
> > > +// //
> > > +// }
> > > +//
> > > +typedef struct _EFI_SHELL_PROTOCOL {
> > > + EFI_SHELL_EXECUTE Execute;
> > > + EFI_SHELL_GET_ENV GetEnv;
> > > + EFI_SHELL_SET_ENV SetEnv;
> > > + EFI_SHELL_GET_ALIAS GetAlias;
> > > + EFI_SHELL_SET_ALIAS SetAlias;
> > > + EFI_SHELL_GET_HELP_TEXT GetHelpText;
> > > + EFI_SHELL_GET_DEVICE_PATH_FROM_MAP
> > GetDevicePathFromMap;
> > > + EFI_SHELL_GET_MAP_FROM_DEVICE_PATH
> > GetMapFromDevicePath;
> > > + EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH
> > > GetDevicePathFromFilePath;
> > > + EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH
> > > GetFilePathFromDevicePath;
> > > + EFI_SHELL_SET_MAP SetMap;
> > > + EFI_SHELL_GET_CUR_DIR GetCurDir;
> > > + EFI_SHELL_SET_CUR_DIR SetCurDir;
> > > + EFI_SHELL_OPEN_FILE_LIST OpenFileList;
> > > + EFI_SHELL_FREE_FILE_LIST FreeFileList;
> > > + EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
> > > + EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
> > > + EFI_SHELL_IS_ROOT_SHELL IsRootShell;
> > > + EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
> > > + EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
> > > + EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
> > > + EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
> > > + EFI_SHELL_GET_FILE_INFO GetFileInfo;
> > > + EFI_SHELL_SET_FILE_INFO SetFileInfo;
> > > + EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
> > > + EFI_SHELL_CLOSE_FILE CloseFile;
> > > + EFI_SHELL_CREATE_FILE CreateFile;
> > > + EFI_SHELL_READ_FILE ReadFile;
> > > + EFI_SHELL_WRITE_FILE WriteFile;
> > > + EFI_SHELL_DELETE_FILE DeleteFile;
> > > + EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
> > > + EFI_SHELL_GET_FILE_POSITION GetFilePosition;
> > > + EFI_SHELL_SET_FILE_POSITION SetFilePosition;
> > > + EFI_SHELL_FLUSH_FILE FlushFile;
> > > + EFI_SHELL_FIND_FILES FindFiles;
> > > + EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
> > > + EFI_SHELL_GET_FILE_SIZE GetFileSize;
> > > + EFI_SHELL_OPEN_ROOT OpenRoot;
> > > + EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
> > > + EFI_EVENT ExecutionBreak;
> > > + UINT32 MajorVersion;
> > > + UINT32 MinorVersion;
> > > + // Added for Shell 2.1
> > > + EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
> > > + EFI_SHELL_GET_GUID_NAME GetGuidName;
> > > + EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
> > > + EFI_SHELL_GET_ENV_EX GetEnvEx;
> > > +} EFI_SHELL_PROTOCOL;
> > > +
> > > +extern EFI_GUID gEfiShellProtocolGuid;
> > > +
> > > +enum ShellVersion {
> > > + SHELL_MAJOR_VERSION = 2,
> > > + SHELL_MINOR_VERSION = 1
> > > +};
> > > +
> > > +#endif
> > > diff --git a/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > > b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > > new file mode 100644
> > > index 0000000..793b4fd
> > > --- /dev/null
> > > +++ b/MdePkg/Include/Protocol/ShellDynamicCommand.h
> > > @@ -0,0 +1,85 @@
> > > +/** @file
> > > + EFI Shell Dynamic Command registration protocol
> > > +
> > > + (C) Copyright 2012-2014 Hewlett-Packard Development Company,
> > > L.P.<BR>
> > > + Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
> > > + This program and the accompanying materials
> > > + are licensed and made available under the terms and conditions of the
> > BSD
> > > License
> > > + which accompanies this distribution. The full text of the license may be
> > > found at
> > > + http://opensource.org/licenses/bsd-license.php
> > > +
> > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > > BASIS,
> > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > > EXPRESS OR IMPLIED.
> > > +
> > > +**/
> > > +
> > > +#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> > > +#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
> > > +
> > > +#include <Protocol/Shell.h>
> > > +#include <Protocol/ShellParameters.h>
> > > +
> > > +// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
> > > +#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
> > > + { \
> > > + 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27,
> > 0xc3
> > > } \
> > > + }
> > > +
> > > +
> > > +//
> > > +// Define for forward reference.
> > > +//
> > > +typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
> > > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
> > > +
> > > +
> > > +/**
> > > + This is the shell command handler function pointer callback type. This
> > > + function handles the command when it is invoked in the shell.
> > > +
> > > + @param[in] This The instance of the
> > > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> > > + @param[in] SystemTable The pointer to the system table.
> > > + @param[in] ShellParameters The parameters associated with the
> > > command.
> > > + @param[in] Shell The instance of the shell protocol used in
> the
> > > context
> > > + of processing this command.
> > > +
> > > + @return EFI_SUCCESS the operation was sucessful
> > > + @return other the operation failed.
> > > +**/
> > > +typedef
> > > +SHELL_STATUS
> > > +(EFIAPI * SHELL_COMMAND_HANDLER)(
> > > + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> > > + IN EFI_SYSTEM_TABLE *SystemTable,
> > > + IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
> > > + IN EFI_SHELL_PROTOCOL *Shell
> > > + );
> > > +
> > > +/**
> > > + This is the command help handler function pointer callback type. This
> > > + function is responsible for displaying help information for the associated
> > > + command.
> > > +
> > > + @param[in] This The instance of the
> > > EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
> > > + @param[in] Language The pointer to the language string to use.
> > > +
> > > + @return string Pool allocated help string, must be freed by
> > caller
> > > +**/
> > > +typedef
> > > +CHAR16*
> > > +(EFIAPI * SHELL_COMMAND_GETHELP)(
> > > + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
> > > + IN CONST CHAR8 *Language
> > > + );
> > > +
> > > +/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
> > > +struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
> > > +
> > > + CONST CHAR16 *CommandName;
> > > + SHELL_COMMAND_HANDLER Handler;
> > > + SHELL_COMMAND_GETHELP GetHelp;
> > > +
> > > +};
> > > +
> > > +extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
> > > +
> > > +#endif
> > > diff --git a/MdePkg/Include/Protocol/ShellParameters.h
> > > b/MdePkg/Include/Protocol/ShellParameters.h
> > > new file mode 100644
> > > index 0000000..68ca9ed
> > > --- /dev/null
> > > +++ b/MdePkg/Include/Protocol/ShellParameters.h
> > > @@ -0,0 +1,60 @@
> > > +/** @file
> > > + EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
> > > +
> > > + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> > > + This program and the accompanying materials
> > > + are licensed and made available under the terms and conditions of the
> > BSD
> > > License
> > > + which accompanies this distribution. The full text of the license may be
> > > found at
> > > + http://opensource.org/licenses/bsd-license.php
> > > +
> > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > > BASIS,
> > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > > EXPRESS OR IMPLIED.
> > > +
> > > +**/
> > > +
> > > +#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
> > > +#define __EFI_SHELL_PARAMETERS_PROTOCOL__
> > > +
> > > +#include <Protocol/Shell.h>
> > > +
> > > +#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
> > > + { \
> > > + 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4,
> > 0xca
> > > } \
> > > + }
> > > +
> > > +typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
> > > + ///
> > > + /// Points to an Argc-element array of points to NULL-terminated strings
> > > containing
> > > + /// the command-line parameters. The first entry in the array is always
> > the
> > > full file
> > > + /// path of the executable. Any quotation marks that were used to
> > > preserve
> > > + /// whitespace have been removed.
> > > + ///
> > > + CHAR16 **Argv;
> > > +
> > > + ///
> > > + /// The number of elements in the Argv array.
> > > + ///
> > > + UINTN Argc;
> > > +
> > > + ///
> > > + /// The file handle for the standard input for this executable. This may be
> > > different
> > > + /// from the ConInHandle in EFI_SYSTEM_TABLE.
> > > + ///
> > > + SHELL_FILE_HANDLE StdIn;
> > > +
> > > + ///
> > > + /// The file handle for the standard output for this executable. This may
> > be
> > > different
> > > + /// from the ConOutHandle in EFI_SYSTEM_TABLE.
> > > + ///
> > > + SHELL_FILE_HANDLE StdOut;
> > > +
> > > + ///
> > > + /// The file handle for the standard error output for this executable. This
> > > may be
> > > + /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
> > > + ///
> > > + SHELL_FILE_HANDLE StdErr;
> > > +} EFI_SHELL_PARAMETERS_PROTOCOL;
> > > +
> > > +extern EFI_GUID gEfiShellParametersProtocolGuid;
> > > +
> > > +#endif
> > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > > index f1e5151..3e08bed 100644
> > > --- a/MdePkg/MdePkg.dec
> > > +++ b/MdePkg/MdePkg.dec
> > > @@ -1645,6 +1645,21 @@ [Protocols]
> > > ## Include/Protocol/EraseBlock.h
> > > gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa,
> > > 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}
> > >
> > > + #
> > > + # Protocols defined in Shell2.0
> > > + #
> > > + ## Include/Protocol/Shell.h
> > > + gEfiShellProtocolGuid = { 0x6302d008, 0x7f9b, 0x4f30, {0x87,
> 0xac,
> > > 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }}
> > > +
> > > + ## Include/Protocol/ShellParameters.h
> > > + gEfiShellParametersProtocolGuid = { 0x752f3136, 0x4e16, 0x4fdc, {0xa2,
> > > 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca }}
> > > +
> > > + #
> > > + # Protocols defined in Shell2.1
> > > + #
> > > + ## Include/Protocol/ShellDynamicCommand.h
> > > + gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4,
> > > {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
> > > +
> > > #
> > > # [Error.gEfiMdePkgTokenSpaceGuid]
> > > # 0x80000001 | Invalid value provided.
> > > --
> > > 2.9.0.windows.1
> > >
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions
2016-10-18 5:59 ` Kinney, Michael D
@ 2016-10-18 15:19 ` Brian J. Johnson
0 siblings, 0 replies; 19+ messages in thread
From: Brian J. Johnson @ 2016-10-18 15:19 UTC (permalink / raw)
To: Kinney, Michael D, Ni, Ruiyu, Carsey, Jaben,
edk2-devel@lists.01.org
Cc: Yao, Jiewen
Yes, git automatically detects copying and moving files, as long as both
halves of the action (remove + add) are in the same commit. There's a
nice explanation here:
https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_git_mv
Brian
On 10/18/2016 12:59 AM, Kinney, Michael D wrote:
> Use 'git mv' command.
>
> Mike
>
>> -----Original Message-----
>> From: Ni, Ruiyu
>> Sent: Tuesday, October 18, 2016 1:57 PM
>> To: Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
>> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen
>> <jiewen.yao@intel.com>
>> Subject: RE: [edk2] [PATCH 2/5] MdePkg: Include
>> Shell/ShellDynamicCommand/ShellParameters definitions
>>
>> I don't want to lose the file history either.
>> I thought git can auto-detect the copy/move of files. I will investigate further.
>>
>> Thanks/Ray
>>
>>> -----Original Message-----
>>> From: Carsey, Jaben
>>> Sent: Tuesday, October 18, 2016 2:02 AM
>>> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
>>> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen
>>> <jiewen.yao@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
>>> Subject: RE: [edk2] [PATCH 2/5] MdePkg: Include
>>> Shell/ShellDynamicCommand/ShellParameters definitions
>>>
>>> Can we do a GIT move operation and then merge the content from
>>> ShellBase.h please? I do not want to lose the file history information.
>>>
>>> When we move by "delete" then "add" we lose everything for no reason.
>>>
>>> -Jaben
>>>
>>>> -----Original Message-----
>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>>> Ruiyu Ni
>>>> Sent: Friday, October 14, 2016 2:44 AM
>>>> To: edk2-devel@lists.01.org
>>>> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Kinney, Michael D
>>>> <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
>>>> Subject: [edk2] [PATCH 2/5] MdePkg: Include
>>>> Shell/ShellDynamicCommand/ShellParameters definitions
>>>> Importance: High
>>>>
>>>> Copy Shell/ShellDynamicCommand/ShellParameters definitions from
>>>> ShellPkg to MdePkg.
>>>> Content of ShellBase.h is moved to Protocol/Shell.h.
>>>>
>>>> The following patches will update ShellPkg to reference all protocol
>>>> definition to MdePkg.
>>>>
>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
>>>> Cc: Jaben Carsey <jaben.carsey@intel.com>
>>>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>>>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>>>> ---
>>>> MdePkg/Include/Protocol/Shell.h | 1268
>>>> +++++++++++++++++++++++++
>>>> MdePkg/Include/Protocol/ShellDynamicCommand.h | 85 ++
>>>> MdePkg/Include/Protocol/ShellParameters.h | 60 ++
>>>> MdePkg/MdePkg.dec | 15 +
>>>> 4 files changed, 1428 insertions(+)
>>>> create mode 100644 MdePkg/Include/Protocol/Shell.h
>>>> create mode 100644 MdePkg/Include/Protocol/ShellDynamicCommand.h
>>>> create mode 100644 MdePkg/Include/Protocol/ShellParameters.h
>>>>
>>>> diff --git a/MdePkg/Include/Protocol/Shell.h
>>>> b/MdePkg/Include/Protocol/Shell.h
>>>> new file mode 100644
>>>> index 0000000..cc1fbdc
>>>> --- /dev/null
>>>> +++ b/MdePkg/Include/Protocol/Shell.h
>>>> @@ -0,0 +1,1268 @@
>>>> +/** @file
>>>> + EFI Shell protocol as defined in the UEFI Shell 2.0 specification including
>>>> errata.
>>>> +
>>>> + (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
>>>> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
>>>> + This program and the accompanying materials
>>>> + are licensed and made available under the terms and conditions of the
>>> BSD
>>>> License
>>>> + which accompanies this distribution. The full text of the license may be
>>>> found at
>>>> + http://opensource.org/licenses/bsd-license.php
>>>> +
>>>> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>>>> BASIS,
>>>> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>>>> EXPRESS OR IMPLIED.
>>>> +
>>>> +**/
>>>> +
>>>> +#ifndef __EFI_SHELL_PROTOCOL__
>>>> +#define __EFI_SHELL_PROTOCOL__
>>>> +
>>>> +#include <Guid/FileInfo.h>
>>>> +
>>>> +#define EFI_SHELL_PROTOCOL_GUID \
>>>> + { \
>>>> + 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda,
>>> 0x4e
>>>> } \
>>>> + }
>>>> +typedef VOID *SHELL_FILE_HANDLE;
>>>> +
>>>> +typedef enum {
>>>> + ///
>>>> + /// The operation completed successfully.
>>>> + ///
>>>> + SHELL_SUCCESS = 0,
>>>> +
>>>> + ///
>>>> + /// The image failed to load.
>>>> + ///
>>>> + SHELL_LOAD_ERROR = 1,
>>>> +
>>>> + ///
>>>> + /// The parameter was incorrect.
>>>> + ///
>>>> + SHELL_INVALID_PARAMETER = 2,
>>>> +
>>>> + ///
>>>> + /// The operation is not supported.
>>>> + ///
>>>> + SHELL_UNSUPPORTED = 3,
>>>> +
>>>> + ///
>>>> + /// The buffer was not the proper size for the request.
>>>> + ///
>>>> + SHELL_BAD_BUFFER_SIZE = 4,
>>>> +
>>>> + ///
>>>> + /// The buffer was not large enough to hold the requested data.
>>>> + /// The required buffer size is returned in the appropriate
>>>> + /// parameter when this error occurs.
>>>> + ///
>>>> + SHELL_BUFFER_TOO_SMALL = 5,
>>>> +
>>>> + ///
>>>> + /// There is no data pending upon return.
>>>> + ///
>>>> + SHELL_NOT_READY = 6,
>>>> +
>>>> + ///
>>>> + /// The physical device reported an error while attempting the
>>>> + /// operation.
>>>> + ///
>>>> + SHELL_DEVICE_ERROR = 7,
>>>> +
>>>> + ///
>>>> + /// The device cannot be written to.
>>>> + ///
>>>> + SHELL_WRITE_PROTECTED = 8,
>>>> +
>>>> + ///
>>>> + /// The resource has run out.
>>>> + ///
>>>> + SHELL_OUT_OF_RESOURCES = 9,
>>>> +
>>>> + ///
>>>> + /// An inconsistency was detected on the file system causing the
>>>> + /// operation to fail.
>>>> + ///
>>>> + SHELL_VOLUME_CORRUPTED = 10,
>>>> +
>>>> + ///
>>>> + /// There is no more space on the file system.
>>>> + ///
>>>> + SHELL_VOLUME_FULL = 11,
>>>> +
>>>> + ///
>>>> + /// The device does not contain any medium to perform the
>>>> + /// operation.
>>>> + ///
>>>> + SHELL_NO_MEDIA = 12,
>>>> +
>>>> + ///
>>>> + /// The medium in the device has changed since the last
>>>> + /// access.
>>>> + ///
>>>> + SHELL_MEDIA_CHANGED = 13,
>>>> +
>>>> + ///
>>>> + /// The item was not found.
>>>> + ///
>>>> + SHELL_NOT_FOUND = 14,
>>>> +
>>>> + ///
>>>> + /// Access was denied.
>>>> + ///
>>>> + SHELL_ACCESS_DENIED = 15,
>>>> +
>>>> + // note the skipping of 16 and 17
>>>> +
>>>> + ///
>>>> + /// A timeout time expired.
>>>> + ///
>>>> + SHELL_TIMEOUT = 18,
>>>> +
>>>> + ///
>>>> + /// The protocol has not been started.
>>>> + ///
>>>> + SHELL_NOT_STARTED = 19,
>>>> +
>>>> + ///
>>>> + /// The protocol has already been started.
>>>> + ///
>>>> + SHELL_ALREADY_STARTED = 20,
>>>> +
>>>> + ///
>>>> + /// The operation was aborted.
>>>> + ///
>>>> + SHELL_ABORTED = 21,
>>>> +
>>>> + // note the skipping of 22, 23, and 24
>>>> +
>>>> + ///
>>>> + /// A function encountered an internal version that was
>>>> + /// incompatible with a version requested by the caller.
>>>> + ///
>>>> + SHELL_INCOMPATIBLE_VERSION = 25,
>>>> +
>>>> + ///
>>>> + /// The function was not performed due to a security violation.
>>>> + ///
>>>> + SHELL_SECURITY_VIOLATION = 26,
>>>> +
>>>> + ///
>>>> + /// The function was performed and resulted in an unequal
>>>> + /// comparison..
>>>> + ///
>>>> + SHELL_NOT_EQUAL = 27
>>>> +} SHELL_STATUS;
>>>> +
>>>> +
>>>> +// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
>>>> +// they are identical outside of the name.
>>>> +typedef struct {
>>>> + LIST_ENTRY Link; ///< Linked list members.
>>>> + EFI_STATUS Status; ///< Status of opening the file. Valid only if
>>>> Handle != NULL.
>>>> + CONST CHAR16 *FullName; ///< Fully qualified filename.
>>>> + CONST CHAR16 *FileName; ///< name of this file.
>>>> + SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the
>>> opened
>>>> file or NULL if closed.
>>>> + EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this
>> file or
>>>> NULL.
>>>> +} EFI_SHELL_FILE_INFO;
>>>> +
>>>> +/**
>>>> + Returns whether any script files are currently being processed.
>>>> +
>>>> + @retval TRUE There is at least one script file active.
>>>> + @retval FALSE No script files are active now.
>>>> +
>>>> +**/
>>>> +typedef
>>>> +BOOLEAN
>>>> +(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
>>>> + VOID
>>>> + );
>>>> +
>>>> +/**
>>>> + Closes the file handle.
>>>> +
>>>> + This function closes a specified file handle. All 'dirty' cached file data is
>>>> + flushed to the device, and the file is closed. In all cases, the handle is
>>>> + closed.
>>>> +
>>>> + @param[in] FileHandle The file handle to be closed.
>>>> +
>>>> + @retval EFI_SUCCESS The file closed sucessfully.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_CLOSE_FILE)(
>>>> + IN SHELL_FILE_HANDLE FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Creates a file or directory by name.
>>>> +
>>>> + This function creates an empty new file or directory with the specified
>>>> attributes and
>>>> + returns the new file's handle. If the file already exists and is read-only,
>>>> then
>>>> + EFI_INVALID_PARAMETER will be returned.
>>>> +
>>>> + If the file already existed, it is truncated and its attributes updated. If
>> the
>>>> file is
>>>> + created successfully, the FileHandle is the file's handle, else, the
>>> FileHandle
>>>> is NULL.
>>>> +
>>>> + If the file name begins with >v, then the file handle which is returned
>>>> refers to the
>>>> + shell environment variable with the specified name. If the shell
>>>> environment variable
>>>> + already exists and is non-volatile then EFI_INVALID_PARAMETER is
>>>> returned.
>>>> +
>>>> + @param[in] FileName Pointer to NULL-terminated file path.
>>>> + @param[in] FileAttribs The new file's attrbiutes. The different
>>>> attributes are
>>>> + described in EFI_FILE_PROTOCOL.Open().
>>>> + @param[out] FileHandle On return, points to the created file handle
>>> or
>>>> directory's handle.
>>>> +
>>>> + @retval EFI_SUCCESS The file was opened. FileHandle points to the
>>>> new file's handle.
>>>> + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
>>>> value.
>>>> + @retval EFI_UNSUPPORTED The file path could not be opened.
>>>> + @retval EFI_NOT_FOUND The specified file could not be found on
>>> the
>>>> device, or could not
>>>> + file the file system on the device.
>>>> + @retval EFI_NO_MEDIA The device has no medium.
>>>> + @retval EFI_MEDIA_CHANGED The device has a different medium in it
>>>> or the medium is no
>>>> + longer supported.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error or can't get
>>>> the file path according
>>>> + the DirName.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
>>> or
>>>> open a file for write
>>>> + when the media is write-protected.
>>>> + @retval EFI_ACCESS_DENIED The service denied access to the file.
>>>> + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
>>>> to open the file.
>>>> + @retval EFI_VOLUME_FULL The volume is full.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_CREATE_FILE)(
>>>> + IN CONST CHAR16 *FileName,
>>>> + IN UINT64 FileAttribs,
>>>> + OUT SHELL_FILE_HANDLE *FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Deletes the file specified by the file handle.
>>>> +
>>>> + This function closes and deletes a file. In all cases, the file handle is
>> closed.
>>>> If the file
>>>> + cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
>>>> returned, but the
>>>> + handle is still closed.
>>>> +
>>>> + @param[in] FileHandle The file handle to delete.
>>>> +
>>>> + @retval EFI_SUCCESS The file was closed and deleted and the
>>> handle
>>>> was closed.
>>>> + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
>>>> was not deleted.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_DELETE_FILE)(
>>>> + IN SHELL_FILE_HANDLE FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Deletes the file specified by the file name.
>>>> +
>>>> + This function deletes a file.
>>>> +
>>>> + @param[in] FileName Points to the NULL-terminated file name.
>>>> +
>>>> + @retval EFI_SUCCESS The file was deleted.
>>>> + @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file
>>>> was not deleted.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
>>>> + IN CONST CHAR16 *FileName
>>>> + );
>>>> +
>>>> +/**
>>>> + Disables the page break output mode.
>>>> +**/
>>>> +typedef
>>>> +VOID
>>>> +(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
>>>> + VOID
>>>> + );
>>>> +
>>>> +/**
>>>> + Enables the page break output mode.
>>>> +**/
>>>> +typedef
>>>> +VOID
>>>> +(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
>>>> + VOID
>>>> + );
>>>> +
>>>> +/**
>>>> + Execute the command line.
>>>> +
>>>> + This function creates a nested instance of the shell and executes the
>>>> specified
>>>> + command (CommandLine) with the specified environment
>>> (Environment).
>>>> Upon return,
>>>> + the status code returned by the specified command is placed in
>>>> StatusCode.
>>>> +
>>>> + If Environment is NULL, then the current environment is used and all
>>>> changes made
>>>> + by the commands executed will be reflected in the current environment.
>>> If
>>>> the
>>>> + Environment is non-NULL, then the changes made will be discarded.
>>>> +
>>>> + The CommandLine is executed from the current working directory on the
>>>> current
>>>> + device.
>>>> +
>>>> + @param[in] ParentImageHandle A handle of the image that is executing
>>>> the specified
>>>> + command line.
>>>> + @param[in] CommandLine Points to the NULL-terminated UCS-2
>>>> encoded string
>>>> + containing the command line. If NULL then the
>> command-
>>>> + line will be empty.
>>>> + @param[in] Environment Points to a NULL-terminated array of
>>>> environment
>>>> + variables with the format 'x=y', where x is the
>>>> + environment variable name and y is the value. If
>> this
>>>> + is NULL, then the current shell environment is
>> used.
>>>> + @param[out] ErrorCode Points to the status code returned by the
>>>> command.
>>>> +
>>>> + @retval EFI_SUCCESS The command executed successfully. The
>>>> status code
>>>> + returned by the command is pointed to by
>> StatusCode.
>>>> + @retval EFI_INVALID_PARAMETER The parameters are invalid.
>>>> + @retval EFI_OUT_OF_RESOURCES Out of resources.
>>>> + @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_EXECUTE) (
>>>> + IN EFI_HANDLE *ParentImageHandle,
>>>> + IN CHAR16 *CommandLine OPTIONAL,
>>>> + IN CHAR16 **Environment OPTIONAL,
>>>> + OUT EFI_STATUS *StatusCode OPTIONAL
>>>> + );
>>>> +
>>>> +/**
>>>> + Find files that match a specified pattern.
>>>> +
>>>> + This function searches for all files and directories that match the specified
>>>> + FilePattern. The FilePattern can contain wild-card characters. The
>>> resulting
>>>> file
>>>> + information is placed in the file list FileList.
>>>> +
>>>> + The files in the file list are not opened. The OpenMode field is set to 0
>>> and
>>>> the FileInfo
>>>> + field is set to NULL.
>>>> +
>>>> + @param[in] FilePattern Points to a NULL-terminated shell file path,
>>>> including wildcards.
>>>> + @param[out] FileList On return, points to the start of a file list
>>>> containing the names
>>>> + of all matching files or else points to NULL if
>> no matching
>>>> files
>>>> + were found.
>>>> +
>>>> + @retval EFI_SUCCESS Files found.
>>>> + @retval EFI_NOT_FOUND No files found.
>>>> + @retval EFI_NO_MEDIA The device has no media.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_FIND_FILES)(
>>>> + IN CONST CHAR16 *FilePattern,
>>>> + OUT EFI_SHELL_FILE_INFO **FileList
>>>> + );
>>>> +
>>>> +/**
>>>> + Find all files in a specified directory.
>>>> +
>>>> + @param[in] FileDirHandle Handle of the directory to search.
>>>> + @param[out] FileList On return, points to the list of files in the
>>>> directory
>>>> + or NULL if there are no files in the directory.
>>>> +
>>>> + @retval EFI_SUCCESS File information was returned successfully.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures have
>>> been
>>>> corrupted.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_NO_MEDIA The device media is not present.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
>>>> +IN SHELL_FILE_HANDLE FileDirHandle,
>>>> +OUT EFI_SHELL_FILE_INFO **FileList
>>>> +);
>>>> +
>>>> +/**
>>>> + Flushes data back to a device.
>>>> +
>>>> + This function flushes all modified data associated with a file to a device.
>>>> +
>>>> + @param[in] FileHandle The handle of the file to flush.
>>>> +
>>>> + @retval EFI_SUCCESS The data was flushed.
>>>> + @retval EFI_NO_MEDIA The device has no medium.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
>>>> + @retval EFI_ACCESS_DENIED The file was opened read-only.
>>>> + @retval EFI_VOLUME_FULL The volume is full.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_FLUSH_FILE)(
>>>> + IN SHELL_FILE_HANDLE FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Frees the file list.
>>>> +
>>>> + This function cleans up the file list and any related data structures. It has
>>> no
>>>> + impact on the files themselves.
>>>> +
>>>> + @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO
>> is
>>>> + defined in OpenFileList().
>>>> +
>>>> + @retval EFI_SUCCESS Free the file list successfully.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
>>>> + IN EFI_SHELL_FILE_INFO **FileList
>>>> + );
>>>> +
>>>> +/**
>>>> + Returns the current directory on the specified device.
>>>> +
>>>> + If FileSystemMapping is NULL, it returns the current working directory. If
>>>> the
>>>> + FileSystemMapping is not NULL, it returns the current directory
>>> associated
>>>> with the
>>>> + FileSystemMapping. In both cases, the returned name includes the file
>>>> system
>>>> + mapping (i.e. fs0:\current-dir).
>>>> +
>>>> + Note that the current directory string should exclude the tailing backslash
>>>> character.
>>>> +
>>>> + @param[in] FileSystemMapping A pointer to the file system mapping. If
>>>> NULL,
>>>> + then the current working directory is returned.
>>>> +
>>>> + @retval !=NULL The current directory.
>>>> + @retval NULL Current directory does not exist.
>>>> +**/
>>>> +typedef
>>>> +CONST CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
>>>> + IN CONST CHAR16 *FileSystemMapping OPTIONAL
>>>> + );
>>>> +
>>>> +typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
>>>> +#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
>>>> +#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
>>>> +
>>>> +/**
>>>> + Gets the name of the device specified by the device handle.
>>>> +
>>>> + This function gets the user-readable name of the device specified by the
>>>> device
>>>> + handle. If no user-readable name could be generated, then
>>>> *BestDeviceName will be
>>>> + NULL and EFI_NOT_FOUND will be returned.
>>>> +
>>>> + If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the
>>> function
>>>> will return the
>>>> + device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if
>>> present
>>>> on
>>>> + DeviceHandle.
>>>> +
>>>> + If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will
>>>> return the
>>>> + device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on
>>>> DeviceHandle.
>>>> + If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
>>>> + EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
>>>> + EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
>>>> +
>>>> + @param[in] DeviceHandle The handle of the device.
>>>> + @param[in] Flags Determines the possible sources of component
>>>> names.
>>>> + @param[in] Language A pointer to the language specified for the
>>>> device
>>>> + name, in the same format as described in the
>> UEFI
>>>> + specification, Appendix M.
>>>> + @param[out] BestDeviceName On return, points to the callee-
>>> allocated
>>>> NULL-
>>>> + terminated name of the device. If no device name
>>>> + could be found, points to NULL. The name must be
>>>> + freed by the caller...
>>>> +
>>>> + @retval EFI_SUCCESS Get the name successfully.
>>>> + @retval EFI_NOT_FOUND Fail to get the device name.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
>>>> + IN EFI_HANDLE DeviceHandle,
>>>> + IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
>>>> + IN CHAR8 *Language,
>>>> + OUT CHAR16 **BestDeviceName
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the device path from the mapping.
>>>> +
>>>> + This function gets the device path associated with a mapping.
>>>> +
>>>> + @param[in] Mapping A pointer to the mapping
>>>> +
>>>> + @retval !=NULL Pointer to the device path that corresponds to
>>> the
>>>> + device mapping. The returned pointer does not
>> need
>>>> + to be freed.
>>>> + @retval NULL There is no device path associated with the
>>>> + specified mapping.
>>>> +**/
>>>> +typedef
>>>> +CONST EFI_DEVICE_PATH_PROTOCOL *
>>>> +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
>>>> + IN CONST CHAR16 *Mapping
>>>> + );
>>>> +
>>>> +/**
>>>> + Converts a file system style name to a device path.
>>>> +
>>>> + This function converts a file system style name to a device path, by
>>>> replacing any
>>>> + mapping references to the associated device path.
>>>> +
>>>> + @param[in] Path The pointer to the path.
>>>> +
>>>> + @return The pointer of the file path. The file path is
>> callee
>>>> + allocated and should be freed by the caller.
>>>> +**/
>>>> +typedef
>>>> +EFI_DEVICE_PATH_PROTOCOL *
>>>> +(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
>>>> + IN CONST CHAR16 *Path
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets either a single or list of environment variables.
>>>> +
>>>> + If name is not NULL then this function returns the current value of the
>>>> specified
>>>> + environment variable.
>>>> +
>>>> + If Name is NULL than a list of all environment variable names is returned.
>>>> Each a
>>>> + NULL terminated string with a double NULL terminating the list.
>>>> +
>>>> + @param[in] Name A pointer to the environment variable name.
>>> If
>>>> + Name is NULL, then the function will return all
>>>> + of the defined shell environment variables. In
>>>> + the case where multiple environment variables
>> are
>>>> + being returned, each variable will be terminated
>> by
>>>> + a NULL, and the list will be terminated by a
>> double
>>>> + NULL.
>>>> +
>>>> + @return A pointer to the returned string.
>>>> + The returned pointer does not need to be freed
>> by the
>>>> caller.
>>>> +
>>>> + @retval NULL The environment variable doesn't exist or there
>>> are
>>>> + no environment variables.
>>>> +**/
>>>> +typedef
>>>> +CONST CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_ENV) (
>>>> + IN CONST CHAR16 *Name OPTIONAL
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the environment variable and Attributes, or list of environment
>>>> variables. Can be
>>>> + used instead of GetEnv().
>>>> +
>>>> + This function returns the current value of the specified environment
>>>> variable and
>>>> + the Attributes. If no variable name was specified, then all of the known
>>>> + variables will be returned.
>>>> +
>>>> + @param[in] Name A pointer to the environment variable name. If
>>>> Name is NULL,
>>>> + then the function will return all of the defined
>> shell
>>>> + environment variables. In the case where
>> multiple
>>>> environment
>>>> + variables are being returned, each variable will
>> be
>>>> terminated
>>>> + by a NULL, and the list will be terminated by a
>> double
>>> NULL.
>>>> + @param[out] Attributes If not NULL, a pointer to the returned
>>>> attributes bitmask for
>>>> + the environment variable. In the case where Name
>> is
>>> NULL,
>>>> and
>>>> + multiple environment variables are being
>> returned,
>>>> Attributes
>>>> + is undefined.
>>>> +
>>>> + @retval NULL The environment variable doesn't exist.
>>>> + @return The environment variable's value. The returned
>>>> pointer does not
>>>> + need to be freed by the caller.
>>>> +**/
>>>> +typedef
>>>> +CONST CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_ENV_EX) (
>>>> + IN CONST CHAR16 *Name,
>>>> + OUT UINT32 *Attributes OPTIONAL
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the file information from an open file handle.
>>>> +
>>>> + This function allocates a buffer to store the file's information. It's the
>>>> caller's
>>>> + responsibility to free the buffer.
>>>> +
>>>> + @param[in] FileHandle A File Handle.
>>>> +
>>>> + @retval NULL Cannot get the file info.
>>>> + @return A pointer to a buffer with file information.
>>>> +**/
>>>> +typedef
>>>> +EFI_FILE_INFO *
>>>> +(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
>>>> + IN SHELL_FILE_HANDLE FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Converts a device path to a file system-style path.
>>>> +
>>>> + This function converts a device path to a file system path by replacing
>>> part,
>>>> or all, of
>>>> + the device path with the file-system mapping. If there are more than
>>> one
>>>> application
>>>> + file system mappings, the one that most closely matches Path will be
>>> used.
>>>> +
>>>> + @param[in] Path The pointer to the device path.
>>>> +
>>>> + @return The pointer of the NULL-terminated file path.
>> The
>>> path
>>>> + is callee-allocated and should be freed by the
>> caller.
>>>> +**/
>>>> +typedef
>>>> +CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
>>>> + IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets a file's current position.
>>>> +
>>>> + This function returns the current file position for the file handle. For
>>>> directories, the
>>>> + current file position has no meaning outside of the file system driver and
>>>> as such, the
>>>> + operation is not supported.
>>>> +
>>>> + @param[in] FileHandle The file handle on which to get the current
>>>> position.
>>>> + @param[out] Position Byte position from the start of the file.
>>>> +
>>>> + @retval EFI_SUCCESS Data was accessed.
>>>> + @retval EFI_UNSUPPORTED The request is not valid on open
>>>> directories.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + OUT UINT64 *Position
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the size of a file.
>>>> +
>>>> + This function returns the size of the file specified by FileHandle.
>>>> +
>>>> + @param[in] FileHandle The handle of the file.
>>>> + @param[out] Size The size of this file.
>>>> +
>>>> + @retval EFI_SUCCESS Get the file's size.
>>>> + @retval EFI_DEVICE_ERROR Can't access the file.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + OUT UINT64 *Size
>>>> + );
>>>> +
>>>> +/**
>>>> + Get the GUID value from a human readable name.
>>>> +
>>>> + If GuidName is a known GUID name, then update Guid to have the
>>> correct
>>>> value for
>>>> + that GUID.
>>>> +
>>>> + This function is only available when the major and minor versions in the
>>>> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
>>>> +
>>>> + @param[in] GuidName A pointer to the localized name for the GUID
>>>> being queried.
>>>> + @param[out] Guid A pointer to the GUID structure to be filled in.
>>>> +
>>>> + @retval EFI_SUCCESS The operation was successful.
>>>> + @retval EFI_INVALID_PARAMETER Guid was NULL.
>>>> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
>>>> + @retval EFI_NOT_FOUND GuidName is not a known GUID Name.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_GUID_FROM_NAME)(
>>>> + IN CONST CHAR16 *GuidName,
>>>> + OUT EFI_GUID *Guid
>>>> + );
>>>> +
>>>> +/**
>>>> + Get the human readable name for a GUID from the value.
>>>> +
>>>> + If Guid is assigned a name, then update *GuidName to point to the
>>> name.
>>>> The callee
>>>> + should not modify the value.
>>>> +
>>>> + This function is only available when the major and minor versions in the
>>>> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
>>>> +
>>>> + @param[in] Guid A pointer to the GUID being queried.
>>>> + @param[out] GuidName A pointer to a pointer the localized to name
>>> for
>>>> the GUID being requested
>>>> +
>>>> + @retval EFI_SUCCESS The operation was successful.
>>>> + @retval EFI_INVALID_PARAMETER Guid was NULL.
>>>> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
>>>> + @retval EFI_NOT_FOUND Guid is not assigned a name.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_GUID_NAME)(
>>>> + IN CONST EFI_GUID *Guid,
>>>> + OUT CONST CHAR16 **GuidName
>>>> + );
>>>> +
>>>> +/**
>>>> + Return help information about a specific command.
>>>> +
>>>> + This function returns the help information for the specified command.
>>> The
>>>> help text
>>>> + can be internal to the shell or can be from a UEFI Shell manual page.
>>>> +
>>>> + If Sections is specified, then each section name listed will be compared in
>>> a
>>>> casesensitive
>>>> + manner, to the section names described in Appendix B. If the section
>>>> exists,
>>>> + it will be appended to the returned help text. If the section does not
>>> exist,
>>>> no
>>>> + information will be returned. If Sections is NULL, then all help text
>>>> information
>>>> + available will be returned.
>>>> +
>>>> + @param[in] Command Points to the NULL-terminated UEFI Shell
>>>> command name.
>>>> + @param[in] Sections Points to the NULL-terminated comma-
>>>> delimited
>>>> + section names to return. If NULL, then all
>>>> + sections will be returned.
>>>> + @param[out] HelpText On return, points to a callee-allocated buffer
>>>> + containing all specified help text.
>>>> +
>>>> + @retval EFI_SUCCESS The help text was returned.
>>>> + @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be
>>>> allocated to hold the
>>>> + returned help text.
>>>> + @retval EFI_INVALID_PARAMETER HelpText is NULL.
>>>> + @retval EFI_NOT_FOUND There is no help text available for
>>>> Command.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
>>>> + IN CONST CHAR16 *Command,
>>>> + IN CONST CHAR16 *Sections OPTIONAL,
>>>> + OUT CHAR16 **HelpText
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the mapping(s) that most closely matches the device path.
>>>> +
>>>> + This function gets the mapping which corresponds to the device path
>>>> *DevicePath. If
>>>> + there is no exact match, then the mapping which most closely matches
>>>> *DevicePath
>>>> + is returned, and *DevicePath is updated to point to the remaining
>>> portion
>>>> of the
>>>> + device path. If there is an exact match, the mapping is returned and
>>>> *DevicePath
>>>> + points to the end-of-device-path node.
>>>> +
>>>> + If there are multiple map names they will be semi-colon seperated in the
>>>> + NULL-terminated string.
>>>> +
>>>> + @param[in, out] DevicePath On entry, points to a device path pointer.
>>>> On
>>>> + exit, updates the pointer to point to the
>>>> + portion of the device path after the mapping.
>>>> +
>>>> + @retval NULL No mapping was found.
>>>> + @retval !=NULL Pointer to NULL-terminated mapping. The buffer
>>>> + is callee allocated and should be freed by the
>> caller.
>>>> +**/
>>>> +typedef
>>>> +CONST CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
>>>> + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
>>>> + );
>>>> +
>>>> +/**
>>>> + Gets the enable status of the page break output mode.
>>>> +
>>>> + User can use this function to determine current page break mode.
>>>> +
>>>> + @retval TRUE The page break output mode is enabled.
>>>> + @retval FALSE The page break output mode is disabled.
>>>> +**/
>>>> +typedef
>>>> +BOOLEAN
>>>> +(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
>>>> + VOID
>>>> + );
>>>> +
>>>> +/**
>>>> + Judges whether the active shell is the root shell.
>>>> +
>>>> + This function makes the user to know that whether the active Shell is the
>>>> root shell.
>>>> +
>>>> + @retval TRUE The active Shell is the root Shell.
>>>> + @retval FALSE The active Shell is NOT the root Shell.
>>>> +**/
>>>> +typedef
>>>> +BOOLEAN
>>>> +(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
>>>> +VOID
>>>> +);
>>>> +
>>>> +/**
>>>> + Opens a file or a directory by file name.
>>>> +
>>>> + This function opens the specified file in the specified OpenMode and
>>>> returns a file
>>>> + handle.
>>>> + If the file name begins with '>v', then the file handle which is returned
>>>> refers to the
>>>> + shell environment variable with the specified name. If the shell
>>>> environment variable
>>>> + exists, is non-volatile and the OpenMode indicates
>>>> EFI_FILE_MODE_WRITE, then
>>>> + EFI_INVALID_PARAMETER is returned.
>>>> +
>>>> + If the file name is '>i', then the file handle which is returned refers to the
>>>> standard
>>>> + input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then
>>>> EFI_INVALID_PARAMETER
>>>> + is returned.
>>>> +
>>>> + If the file name is '>o', then the file handle which is returned refers to
>>> the
>>>> standard
>>>> + output. If the OpenMode indicates EFI_FILE_MODE_READ, then
>>>> EFI_INVALID_PARAMETER
>>>> + is returned.
>>>> +
>>>> + If the file name is '>e', then the file handle which is returned refers to
>>> the
>>>> standard
>>>> + error. If the OpenMode indicates EFI_FILE_MODE_READ, then
>>>> EFI_INVALID_PARAMETER
>>>> + is returned.
>>>> +
>>>> + If the file name is 'NUL', then the file handle that is returned refers to the
>>>> standard NUL
>>>> + file. If the OpenMode indicates EFI_FILE_MODE_READ, then
>>>> EFI_INVALID_PARAMETER is
>>>> + returned.
>>>> +
>>>> + If return EFI_SUCCESS, the FileHandle is the opened file's handle, else,
>>> the
>>>> + FileHandle is NULL.
>>>> +
>>>> + @param[in] FileName Points to the NULL-terminated UCS-2
>>> encoded
>>>> file name.
>>>> + @param[out] FileHandle On return, points to the file handle.
>>>> + @param[in] OpenMode File open mode. Either
>>>> EFI_FILE_MODE_READ or
>>>> + EFI_FILE_MODE_WRITE from section 12.4 of the
>> UEFI
>>>> + Specification.
>>>> + @retval EFI_SUCCESS The file was opened. FileHandle has the
>>>> opened file's handle.
>>>> + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid
>>>> value. FileHandle is NULL.
>>>> + @retval EFI_UNSUPPORTED Could not open the file path. FileHandle
>>> is
>>>> NULL.
>>>> + @retval EFI_NOT_FOUND The specified file could not be found on
>>> the
>>>> device or the file
>>>> + system could not be found on the device.
>> FileHandle is
>>>> NULL.
>>>> + @retval EFI_NO_MEDIA The device has no medium. FileHandle is
>>>> NULL.
>>>> + @retval EFI_MEDIA_CHANGED The device has a different medium in it
>>>> or the medium is no
>>>> + longer supported. FileHandle is NULL.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error or can't get
>>>> the file path according
>>>> + the FileName. FileHandle is NULL.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted. FileHandle is NULL.
>>>> + @retval EFI_WRITE_PROTECTED An attempt was made to create a file,
>>> or
>>>> open a file for write
>>>> + when the media is write-protected. FileHandle is
>> NULL.
>>>> + @retval EFI_ACCESS_DENIED The service denied access to the file.
>>>> FileHandle is NULL.
>>>> + @retval EFI_OUT_OF_RESOURCES Not enough resources were available
>>>> to open the file. FileHandle
>>>> + is NULL.
>>>> + @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
>>>> + IN CONST CHAR16 *FileName,
>>>> + OUT SHELL_FILE_HANDLE *FileHandle,
>>>> + IN UINT64 OpenMode
>>>> + );
>>>> +
>>>> +/**
>>>> + Opens the files that match the path specified.
>>>> +
>>>> + This function opens all of the files specified by Path. Wildcards are
>>>> processed
>>>> + according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
>>>> + matching file has an EFI_SHELL_FILE_INFO structure created in a linked
>>> list.
>>>> +
>>>> + @param[in] Path A pointer to the path string.
>>>> + @param[in] OpenMode Specifies the mode used to open each file,
>>>> EFI_FILE_MODE_READ or
>>>> + EFI_FILE_MODE_WRITE.
>>>> + @param[in, out] FileList Points to the start of a list of files opened.
>>>> +
>>>> + @retval EFI_SUCCESS Create the file list successfully.
>>>> + @return Can't create the file list.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
>>>> + IN CHAR16 *Path,
>>>> + IN UINT64 OpenMode,
>>>> + IN OUT EFI_SHELL_FILE_INFO **FileList
>>>> + );
>>>> +
>>>> +/**
>>>> + Opens the root directory of a device.
>>>> +
>>>> + This function opens the root directory of a device and returns a file
>>> handle
>>>> to it.
>>>> +
>>>> + @param[in] DevicePath Points to the device path corresponding to
>>> the
>>>> device where the
>>>> + EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
>>>> + @param[out] FileHandle On exit, points to the file handle
>>>> corresponding to the root directory on the
>>>> + device.
>>>> +
>>>> + @retval EFI_SUCCESS Root opened successfully.
>>>> + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
>>>> found or the root directory
>>>> + could not be opened.
>>>> + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
>>>> were corrupted.
>>>> + @retval EFI_DEVICE_ERROR The device had an error.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_OPEN_ROOT)(
>>>> + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
>>>> + OUT SHELL_FILE_HANDLE *FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Opens the root directory of a device on a handle.
>>>> +
>>>> + This function opens the root directory of a device and returns a file
>>> handle
>>>> to it.
>>>> +
>>>> + @param[in] DeviceHandle The handle of the device that contains the
>>>> volume.
>>>> + @param[out] FileHandle On exit, points to the file handle
>>>> corresponding to the root directory on the
>>>> + device.
>>>> +
>>>> + @retval EFI_SUCCESS Root opened successfully.
>>>> + @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be
>>>> found or the root directory
>>>> + could not be opened.
>>>> + @retval EFI_VOLUME_CORRUPTED The data structures in the volume
>>>> were corrupted.
>>>> + @retval EFI_DEVICE_ERROR The device had an error.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
>>>> + IN EFI_HANDLE DeviceHandle,
>>>> + OUT SHELL_FILE_HANDLE *FileHandle
>>>> + );
>>>> +
>>>> +/**
>>>> + Reads data from the file.
>>>> +
>>>> + If FileHandle is not a directory, the function reads the requested number
>>>> of bytes
>>>> + from the file at the file's current position and returns them in Buffer. If
>>> the
>>>> read goes
>>>> + beyond the end of the file, the read length is truncated to the end of the
>>>> file. The file's
>>>> + current position is increased by the number of bytes returned.
>>>> + If FileHandle is a directory, then an error is returned.
>>>> +
>>>> + @param[in] FileHandle The opened file handle for read.
>>>> + @param[in] ReadSize On input, the size of Buffer, in bytes. On
>>>> output, the amount of data read.
>>>> + @param[in, out] Buffer The buffer in which data is read.
>>>> +
>>>> + @retval EFI_SUCCESS Data was read.
>>>> + @retval EFI_NO_MEDIA The device has no media.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> + @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains
>>>> required size.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_READ_FILE) (
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + IN OUT UINTN *ReadSize,
>>>> + IN OUT VOID *Buffer
>>>> + );
>>>> +
>>>> +/**
>>>> + Register a GUID and a localized human readable name for it.
>>>> +
>>>> + If Guid is not assigned a name, then assign GuidName to Guid. This list of
>>>> GUID
>>>> + names must be used whenever a shell command outputs GUID
>>>> information.
>>>> +
>>>> + This function is only available when the major and minor versions in the
>>>> + EfiShellProtocol are greater than or equal to 2 and 1, respectively.
>>>> +
>>>> + @param[in] Guid A pointer to the GUID being registered.
>>>> + @param[in] GuidName A pointer to the localized name for the GUID
>>>> being registered.
>>>> +
>>>> + @retval EFI_SUCCESS The operation was successful.
>>>> + @retval EFI_INVALID_PARAMETER Guid was NULL.
>>>> + @retval EFI_INVALID_PARAMETER GuidName was NULL.
>>>> + @retval EFI_ACCESS_DENIED Guid already is assigned a name.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_REGISTER_GUID_NAME)(
>>>> + IN CONST EFI_GUID *Guid,
>>>> + IN CONST CHAR16 *GuidName
>>>> + );
>>>> +
>>>> +/**
>>>> + Deletes the duplicate file names files in the given file list.
>>>> +
>>>> + @param[in] FileList A pointer to the first entry in the file list.
>>>> +
>>>> + @retval EFI_SUCCESS Always success.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
>>>> + IN EFI_SHELL_FILE_INFO **FileList
>>>> + );
>>>> +
>>>> +/**
>>>> + Changes a shell command alias.
>>>> +
>>>> + This function creates an alias for a shell command.
>>>> +
>>>> + @param[in] Command Points to the NULL-terminated shell
>>>> command or existing alias.
>>>> + @param[in] Alias Points to the NULL-terminated alias for the
>> shell
>>>> command. If this is NULL, and
>>>> + Command refers to an alias, that alias will be
>> deleted.
>>>> + @param[in] Replace If TRUE and the alias already exists, then the
>>>> existing alias will be replaced. If
>>>> + FALSE and the alias already exists, then the
>> existing alias is
>>>> unchanged and
>>>> + EFI_ACCESS_DENIED is returned.
>>>> + @param[in] Volatile if TRUE the Alias being set will be stored in a
>>>> volatile fashion. if FALSE the
>>>> + Alias being set will be stored in a non-volatile
>> fashion.
>>>> +
>>>> + @retval EFI_SUCCESS Alias created or deleted successfully.
>>>> + @retval EFI_ACCESS_DENIED The alias is a built-in alias or already
>>> existed
>>>> and Replace was set to
>>>> + FALSE.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_ALIAS)(
>>>> + IN CONST CHAR16 *Command,
>>>> + IN CONST CHAR16 *Alias,
>>>> + IN BOOLEAN Replace,
>>>> + IN BOOLEAN Volatile
>>>> + );
>>>> +
>>>> +/**
>>>> + This function returns the command associated with a alias or a list of all
>>>> + alias'.
>>>> +
>>>> + @param[in] Alias Points to the NULL-terminated shell alias.
>>>> + If this parameter is NULL, then all
>>>> + aliases will be returned in ReturnedData.
>>>> + @param[out] Volatile Upon return of a single command if TRUE
>>>> indicates
>>>> + this is stored in a volatile fashion. FALSE
>> otherwise.
>>>> + @return If Alias is not NULL, it will return a
>> pointer to
>>>> + the NULL-terminated command for that alias.
>>>> + If Alias is NULL, ReturnedData points to a ';'
>>>> + delimited list of alias (e.g.
>>>> + ReturnedData = "dir;del;copy;mfp") that is NULL-
>>>> terminated.
>>>> + @retval NULL An error ocurred.
>>>> + @retval NULL Alias was not a valid Alias.
>>>> +**/
>>>> +typedef
>>>> +CONST CHAR16 *
>>>> +(EFIAPI *EFI_SHELL_GET_ALIAS)(
>>>> + IN CONST CHAR16 *Alias,
>>>> + OUT BOOLEAN *Volatile OPTIONAL
>>>> + );
>>>> +
>>>> +/**
>>>> + Changes the current directory on the specified device.
>>>> +
>>>> + If the FileSystem is NULL, and the directory Dir does not contain a file
>>>> system's
>>>> + mapped name, this function changes the current working directory. If
>>>> FileSystem is
>>>> + NULL and the directory Dir contains a mapped name, then the current
>>> file
>>>> system and
>>>> + the current directory on that file system are changed.
>>>> +
>>>> + If FileSystem is not NULL, and Dir is NULL, then this changes the current
>>>> working file
>>>> + system.
>>>> +
>>>> + If FileSystem is not NULL and Dir is not NULL, then this function changes
>>>> the current
>>>> + directory on the specified file system.
>>>> +
>>>> + If the current working directory or the current working file system is
>>>> changed then the
>>>> + %cwd% environment variable will be updated.
>>>> +
>>>> + @param[in] FileSystem A pointer to the file system's mapped name.
>>> If
>>>> NULL, then the current working
>>>> + directory is changed.
>>>> + @param[in] Dir Points to the NULL-terminated directory on the
>>>> device specified by FileSystem.
>>>> +
>>>> + @retval NULL Current directory does not exist.
>>>> + @return The current directory.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
>>>> + IN CONST CHAR16 *FileSystem OPTIONAL,
>>>> + IN CONST CHAR16 *Dir
>>>> + );
>>>> +
>>>> +/**
>>>> + Sets the environment variable.
>>>> +
>>>> + This function changes the current value of the specified environment
>>>> variable. If the
>>>> + environment variable exists and the Value is an empty string, then the
>>>> environment
>>>> + variable is deleted. If the environment variable exists and the Value is
>>> not
>>>> an empty
>>>> + string, then the value of the environment variable is changed. If the
>>>> environment
>>>> + variable does not exist and the Value is an empty string, there is no
>>> action.
>>>> If the
>>>> + environment variable does not exist and the Value is a non-empty string,
>>>> then the
>>>> + environment variable is created and assigned the specified value.
>>>> +
>>>> + For a description of volatile and non-volatile environment variables, see
>>>> UEFI Shell
>>>> + 2.0 specification section 3.6.1.
>>>> +
>>>> + @param[in] Name Points to the NULL-terminated environment
>>>> variable name.
>>>> + @param[in] Value Points to the NULL-terminated environment
>>>> variable value. If the value is an
>>>> + empty string then the environment variable is
>> deleted.
>>>> + @param[in] Volatile Indicates whether the variable is non-volatile
>>>> (FALSE) or volatile (TRUE).
>>>> +
>>>> + @retval EFI_SUCCESS The environment variable was successfully
>>>> updated.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_ENV) (
>>>> + IN CONST CHAR16 *Name,
>>>> + IN CONST CHAR16 *Value,
>>>> + IN BOOLEAN Volatile
>>>> + );
>>>> +
>>>> +/**
>>>> + Sets the file information to an opened file handle.
>>>> +
>>>> + This function changes file information. All file information in the
>>>> EFI_FILE_INFO
>>>> + struct will be updated to the passed in data.
>>>> +
>>>> + @param[in] FileHandle A file handle.
>>>> + @param[in] FileInfo Points to new file information.
>>>> +
>>>> + @retval EFI_SUCCESS The information was set.
>>>> + @retval EFI_NO_MEDIA The device has no medium.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> + @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
>>>> + @retval EFI_ACCESS_DENIED The file was opened read-only.
>>>> + @retval EFI_VOLUME_FULL The volume is full.
>>>> + @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of
>>>> EFI_FILE_INFO.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + IN CONST EFI_FILE_INFO *FileInfo
>>>> + );
>>>> +
>>>> +/**
>>>> + Sets a file's current position.
>>>> +
>>>> + This function sets the current file position for the handle to the position
>>>> supplied. With
>>>> + the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute
>>>> positioning is
>>>> + supported, and seeking past the end of the file is allowed (a subsequent
>>>> write would
>>>> + grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the
>>> current
>>>> position
>>>> + to be set to the end of the file.
>>>> +
>>>> + @param[in] FileHandle The file handle on which requested position
>>>> will be set.
>>>> + @param[in] Position Byte position from the start of the file.
>>>> +
>>>> + @retval EFI_SUCCESS Data was written.
>>>> + @retval EFI_UNSUPPORTED The seek request for nonzero is not valid
>>>> on open directories.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + IN UINT64 Position
>>>> + );
>>>> +
>>>> +/**
>>>> + This function creates a mapping for a device path.
>>>> +
>>>> + @param[in] DevicePath Points to the device path. If this is NULL and
>>>> Mapping points to a valid mapping,
>>>> + then the mapping will be deleted.
>>>> + @param[in] Mapping Points to the NULL-terminated mapping for
>>> the
>>>> device path.
>>>> +
>>>> + @retval EFI_SUCCESS Mapping created or deleted successfully.
>>>> + @retval EFI_NO_MAPPING There is no handle that corresponds
>>> exactly
>>>> to DevicePath. See the
>>>> + boot service function LocateDevicePath().
>>>> + @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_SET_MAP)(
>>>> + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
>>>> + IN CONST CHAR16 *Mapping
>>>> + );
>>>> +
>>>> +/**
>>>> + Writes data to the file.
>>>> +
>>>> + This function writes the specified number of bytes to the file at the
>>> current
>>>> file position.
>>>> + The current file position is advanced the actual number of bytes written,
>>>> which is
>>>> + returned in BufferSize. Partial writes only occur when there has been a
>>>> data error
>>>> + during the write attempt (such as "volume space full"). The file
>>>> automatically grows to
>>>> + hold the data, if required.
>>>> +
>>>> + Direct writes to opened directories are not supported.
>>>> +
>>>> + @param[in] FileHandle The opened file handle for writing.
>>>> + @param[in, out] BufferSize On input, size of Buffer.
>>>> + @param[in] Buffer The buffer in which data to write.
>>>> +
>>>> + @retval EFI_SUCCESS Data was written.
>>>> + @retval EFI_UNSUPPORTED Writes to open directory are not
>>>> supported.
>>>> + @retval EFI_NO_MEDIA The device has no media.
>>>> + @retval EFI_DEVICE_ERROR The device reported an error.
>>>> + @retval EFI_VOLUME_CORRUPTED The file system structures are
>>>> corrupted.
>>>> + @retval EFI_WRITE_PROTECTED The device is write-protected.
>>>> + @retval EFI_ACCESS_DENIED The file was open for read only.
>>>> + @retval EFI_VOLUME_FULL The volume is full.
>>>> +**/
>>>> +typedef
>>>> +EFI_STATUS
>>>> +(EFIAPI *EFI_SHELL_WRITE_FILE)(
>>>> + IN SHELL_FILE_HANDLE FileHandle,
>>>> + IN OUT UINTN *BufferSize,
>>>> + IN VOID *Buffer
>>>> + );
>>>> +
>>>> +//
>>>> +// EFI_SHELL_PROTOCOL has been updated since UEFI Shell Spec 2.0
>>>> +// Usage of this protocol will require version checking before attempting
>>>> +// to use any new members. There is no need to check the version for
>>>> +// members that existed in UEFI Shell Spec 2.0.
>>>> +//
>>>> +// Update below for any future UEFI Shell spec changes to this protocol.
>>>> +//
>>>> +// Check EFI_SHELL_PROTOCOL MajorVersion and MinorVersion:
>>>> +// if ((2 == gEfiShellProtocol->MajorVersion) &&
>>>> +// (0 == gEfiShellProtocol->MinorVersion)) {
>>>> +// //
>>>> +// // Cannot call:
>>>> +// // RegisterGuidName - UEFI Shell 2.1
>>>> +// // GetGuidName - UEFI Shell 2.1
>>>> +// // GetGuidFromName - UEFI Shell 2.1
>>>> +// // GetEnvEx - UEFI Shell 2.1
>>>> +// //
>>>> +// } else {
>>>> +// //
>>>> +// // Can use all members
>>>> +// //
>>>> +// }
>>>> +//
>>>> +typedef struct _EFI_SHELL_PROTOCOL {
>>>> + EFI_SHELL_EXECUTE Execute;
>>>> + EFI_SHELL_GET_ENV GetEnv;
>>>> + EFI_SHELL_SET_ENV SetEnv;
>>>> + EFI_SHELL_GET_ALIAS GetAlias;
>>>> + EFI_SHELL_SET_ALIAS SetAlias;
>>>> + EFI_SHELL_GET_HELP_TEXT GetHelpText;
>>>> + EFI_SHELL_GET_DEVICE_PATH_FROM_MAP
>>> GetDevicePathFromMap;
>>>> + EFI_SHELL_GET_MAP_FROM_DEVICE_PATH
>>> GetMapFromDevicePath;
>>>> + EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH
>>>> GetDevicePathFromFilePath;
>>>> + EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH
>>>> GetFilePathFromDevicePath;
>>>> + EFI_SHELL_SET_MAP SetMap;
>>>> + EFI_SHELL_GET_CUR_DIR GetCurDir;
>>>> + EFI_SHELL_SET_CUR_DIR SetCurDir;
>>>> + EFI_SHELL_OPEN_FILE_LIST OpenFileList;
>>>> + EFI_SHELL_FREE_FILE_LIST FreeFileList;
>>>> + EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
>>>> + EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
>>>> + EFI_SHELL_IS_ROOT_SHELL IsRootShell;
>>>> + EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
>>>> + EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
>>>> + EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
>>>> + EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
>>>> + EFI_SHELL_GET_FILE_INFO GetFileInfo;
>>>> + EFI_SHELL_SET_FILE_INFO SetFileInfo;
>>>> + EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
>>>> + EFI_SHELL_CLOSE_FILE CloseFile;
>>>> + EFI_SHELL_CREATE_FILE CreateFile;
>>>> + EFI_SHELL_READ_FILE ReadFile;
>>>> + EFI_SHELL_WRITE_FILE WriteFile;
>>>> + EFI_SHELL_DELETE_FILE DeleteFile;
>>>> + EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
>>>> + EFI_SHELL_GET_FILE_POSITION GetFilePosition;
>>>> + EFI_SHELL_SET_FILE_POSITION SetFilePosition;
>>>> + EFI_SHELL_FLUSH_FILE FlushFile;
>>>> + EFI_SHELL_FIND_FILES FindFiles;
>>>> + EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
>>>> + EFI_SHELL_GET_FILE_SIZE GetFileSize;
>>>> + EFI_SHELL_OPEN_ROOT OpenRoot;
>>>> + EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
>>>> + EFI_EVENT ExecutionBreak;
>>>> + UINT32 MajorVersion;
>>>> + UINT32 MinorVersion;
>>>> + // Added for Shell 2.1
>>>> + EFI_SHELL_REGISTER_GUID_NAME RegisterGuidName;
>>>> + EFI_SHELL_GET_GUID_NAME GetGuidName;
>>>> + EFI_SHELL_GET_GUID_FROM_NAME GetGuidFromName;
>>>> + EFI_SHELL_GET_ENV_EX GetEnvEx;
>>>> +} EFI_SHELL_PROTOCOL;
>>>> +
>>>> +extern EFI_GUID gEfiShellProtocolGuid;
>>>> +
>>>> +enum ShellVersion {
>>>> + SHELL_MAJOR_VERSION = 2,
>>>> + SHELL_MINOR_VERSION = 1
>>>> +};
>>>> +
>>>> +#endif
>>>> diff --git a/MdePkg/Include/Protocol/ShellDynamicCommand.h
>>>> b/MdePkg/Include/Protocol/ShellDynamicCommand.h
>>>> new file mode 100644
>>>> index 0000000..793b4fd
>>>> --- /dev/null
>>>> +++ b/MdePkg/Include/Protocol/ShellDynamicCommand.h
>>>> @@ -0,0 +1,85 @@
>>>> +/** @file
>>>> + EFI Shell Dynamic Command registration protocol
>>>> +
>>>> + (C) Copyright 2012-2014 Hewlett-Packard Development Company,
>>>> L.P.<BR>
>>>> + Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
>>>> + This program and the accompanying materials
>>>> + are licensed and made available under the terms and conditions of the
>>> BSD
>>>> License
>>>> + which accompanies this distribution. The full text of the license may be
>>>> found at
>>>> + http://opensource.org/licenses/bsd-license.php
>>>> +
>>>> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>>>> BASIS,
>>>> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>>>> EXPRESS OR IMPLIED.
>>>> +
>>>> +**/
>>>> +
>>>> +#ifndef __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
>>>> +#define __EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL__
>>>> +
>>>> +#include <Protocol/Shell.h>
>>>> +#include <Protocol/ShellParameters.h>
>>>> +
>>>> +// {3C7200E9-005F-4EA4-87DE-A3DFAC8A27C3}
>>>> +#define EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID \
>>>> + { \
>>>> + 0x3c7200e9, 0x005f, 0x4ea4, { 0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27,
>>> 0xc3
>>>> } \
>>>> + }
>>>> +
>>>> +
>>>> +//
>>>> +// Define for forward reference.
>>>> +//
>>>> +typedef struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
>>>> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL;
>>>> +
>>>> +
>>>> +/**
>>>> + This is the shell command handler function pointer callback type. This
>>>> + function handles the command when it is invoked in the shell.
>>>> +
>>>> + @param[in] This The instance of the
>>>> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
>>>> + @param[in] SystemTable The pointer to the system table.
>>>> + @param[in] ShellParameters The parameters associated with the
>>>> command.
>>>> + @param[in] Shell The instance of the shell protocol used in
>> the
>>>> context
>>>> + of processing this command.
>>>> +
>>>> + @return EFI_SUCCESS the operation was sucessful
>>>> + @return other the operation failed.
>>>> +**/
>>>> +typedef
>>>> +SHELL_STATUS
>>>> +(EFIAPI * SHELL_COMMAND_HANDLER)(
>>>> + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
>>>> + IN EFI_SYSTEM_TABLE *SystemTable,
>>>> + IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
>>>> + IN EFI_SHELL_PROTOCOL *Shell
>>>> + );
>>>> +
>>>> +/**
>>>> + This is the command help handler function pointer callback type. This
>>>> + function is responsible for displaying help information for the associated
>>>> + command.
>>>> +
>>>> + @param[in] This The instance of the
>>>> EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
>>>> + @param[in] Language The pointer to the language string to use.
>>>> +
>>>> + @return string Pool allocated help string, must be freed by
>>> caller
>>>> +**/
>>>> +typedef
>>>> +CHAR16*
>>>> +(EFIAPI * SHELL_COMMAND_GETHELP)(
>>>> + IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This,
>>>> + IN CONST CHAR8 *Language
>>>> + );
>>>> +
>>>> +/// EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.
>>>> +struct _EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL {
>>>> +
>>>> + CONST CHAR16 *CommandName;
>>>> + SHELL_COMMAND_HANDLER Handler;
>>>> + SHELL_COMMAND_GETHELP GetHelp;
>>>> +
>>>> +};
>>>> +
>>>> +extern EFI_GUID gEfiShellDynamicCommandProtocolGuid;
>>>> +
>>>> +#endif
>>>> diff --git a/MdePkg/Include/Protocol/ShellParameters.h
>>>> b/MdePkg/Include/Protocol/ShellParameters.h
>>>> new file mode 100644
>>>> index 0000000..68ca9ed
>>>> --- /dev/null
>>>> +++ b/MdePkg/Include/Protocol/ShellParameters.h
>>>> @@ -0,0 +1,60 @@
>>>> +/** @file
>>>> + EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
>>>> +
>>>> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
>>>> + This program and the accompanying materials
>>>> + are licensed and made available under the terms and conditions of the
>>> BSD
>>>> License
>>>> + which accompanies this distribution. The full text of the license may be
>>>> found at
>>>> + http://opensource.org/licenses/bsd-license.php
>>>> +
>>>> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>>>> BASIS,
>>>> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>>>> EXPRESS OR IMPLIED.
>>>> +
>>>> +**/
>>>> +
>>>> +#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
>>>> +#define __EFI_SHELL_PARAMETERS_PROTOCOL__
>>>> +
>>>> +#include <Protocol/Shell.h>
>>>> +
>>>> +#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
>>>> + { \
>>>> + 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4,
>>> 0xca
>>>> } \
>>>> + }
>>>> +
>>>> +typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
>>>> + ///
>>>> + /// Points to an Argc-element array of points to NULL-terminated strings
>>>> containing
>>>> + /// the command-line parameters. The first entry in the array is always
>>> the
>>>> full file
>>>> + /// path of the executable. Any quotation marks that were used to
>>>> preserve
>>>> + /// whitespace have been removed.
>>>> + ///
>>>> + CHAR16 **Argv;
>>>> +
>>>> + ///
>>>> + /// The number of elements in the Argv array.
>>>> + ///
>>>> + UINTN Argc;
>>>> +
>>>> + ///
>>>> + /// The file handle for the standard input for this executable. This may be
>>>> different
>>>> + /// from the ConInHandle in EFI_SYSTEM_TABLE.
>>>> + ///
>>>> + SHELL_FILE_HANDLE StdIn;
>>>> +
>>>> + ///
>>>> + /// The file handle for the standard output for this executable. This may
>>> be
>>>> different
>>>> + /// from the ConOutHandle in EFI_SYSTEM_TABLE.
>>>> + ///
>>>> + SHELL_FILE_HANDLE StdOut;
>>>> +
>>>> + ///
>>>> + /// The file handle for the standard error output for this executable. This
>>>> may be
>>>> + /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
>>>> + ///
>>>> + SHELL_FILE_HANDLE StdErr;
>>>> +} EFI_SHELL_PARAMETERS_PROTOCOL;
>>>> +
>>>> +extern EFI_GUID gEfiShellParametersProtocolGuid;
>>>> +
>>>> +#endif
>>>> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
>>>> index f1e5151..3e08bed 100644
>>>> --- a/MdePkg/MdePkg.dec
>>>> +++ b/MdePkg/MdePkg.dec
>>>> @@ -1645,6 +1645,21 @@ [Protocols]
>>>> ## Include/Protocol/EraseBlock.h
>>>> gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa,
>>>> 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}
>>>>
>>>> + #
>>>> + # Protocols defined in Shell2.0
>>>> + #
>>>> + ## Include/Protocol/Shell.h
>>>> + gEfiShellProtocolGuid = { 0x6302d008, 0x7f9b, 0x4f30, {0x87,
>> 0xac,
>>>> 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }}
>>>> +
>>>> + ## Include/Protocol/ShellParameters.h
>>>> + gEfiShellParametersProtocolGuid = { 0x752f3136, 0x4e16, 0x4fdc, {0xa2,
>>>> 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca }}
>>>> +
>>>> + #
>>>> + # Protocols defined in Shell2.1
>>>> + #
>>>> + ## Include/Protocol/ShellDynamicCommand.h
>>>> + gEfiShellDynamicCommandProtocolGuid = { 0x3c7200e9, 0x005f, 0x4ea4,
>>>> {0x87, 0xde, 0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3 }}
>>>> +
>>>> #
>>>> # [Error.gEfiMdePkgTokenSpaceGuid]
>>>> # 0x80000001 | Invalid value provided.
>>>> --
>>>> 2.9.0.windows.1
>>>>
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel@lists.01.org
>>>> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
--
My statements are my own, are not authorized by SGI, and do not
necessarily represent SGI’s positions.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2016-10-18 15:19 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 9:44 [PATCH 0/5] Move Shell protocol definitions to MdePkg Ruiyu Ni
2016-10-14 9:44 ` [PATCH 1/5] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h Ruiyu Ni
2016-10-14 16:22 ` Tim Lewis
2016-10-17 16:25 ` Carsey, Jaben
2016-10-14 9:44 ` [PATCH 2/5] MdePkg: Include Shell/ShellDynamicCommand/ShellParameters definitions Ruiyu Ni
2016-10-17 18:02 ` Carsey, Jaben
2016-10-18 5:56 ` Ni, Ruiyu
2016-10-18 5:59 ` Kinney, Michael D
2016-10-18 15:19 ` Brian J. Johnson
2016-10-14 9:44 ` [PATCH 3/5] ArmPkg/LinuxLoader: Reference Shell protocols in MdePkg Ruiyu Ni
2016-10-14 19:55 ` Leif Lindholm
2016-10-14 9:44 ` [PATCH 4/5] EmbeddedPkg/FdtPlatformDxe: " Ruiyu Ni
2016-10-14 19:55 ` Leif Lindholm
2016-10-14 9:44 ` [PATCH 5/5] ShellPkg: Remove Shell/ShellDynamicCommand/ShellParameter definitions Ruiyu Ni
2016-10-14 13:08 ` [PATCH 0/5] Move Shell protocol definitions to MdePkg Yao, Jiewen
2016-10-14 13:13 ` Yao, Jiewen
2016-10-14 16:21 ` Tim Lewis
2016-10-15 13:29 ` Yao, Jiewen
2016-10-17 16:30 ` Carsey, Jaben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox