X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=ShellPkg%2FInclude%2FProtocol%2FEfiShell.h;h=64483c01c2a7bf1e867948f31c2703050b18fca8;hb=e26d7b59756b8995473345713178e1b35473a7a2;hp=967bdc5ca88a71de0a008c729543d4292142f486;hpb=b1f95a06ca1a66ad15b3d8843fb4c7563c5350d2;p=mirror_edk2.git
diff --git a/ShellPkg/Include/Protocol/EfiShell.h b/ShellPkg/Include/Protocol/EfiShell.h
index 967bdc5ca8..64483c01c2 100644
--- a/ShellPkg/Include/Protocol/EfiShell.h
+++ b/ShellPkg/Include/Protocol/EfiShell.h
@@ -1,21 +1,21 @@
/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
-
- Copyright (c) 2006 - 2009, 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
- http://opensource.org/licenses/bsd-license.php
+ EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ Copyright (c) 2006 - 2010, 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
+ 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
+#include
#include
#define EFI_SHELL_PROTOCOL_GUID \
@@ -26,13 +26,14 @@
// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
// they are identical outside of the name.
typedef struct {
- LIST_ENTRY Link;
- EFI_STATUS Status;
- CONST CHAR16 *FullName;
- CONST CHAR16 *FileName;
- EFI_FILE_HANDLE Handle;
- EFI_FILE_INFO *Info;
+ 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.
@@ -49,18 +50,18 @@ BOOLEAN
/**
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
+ 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 FileHandle The file handle to be closed
+ @param[in] FileHandle The file handle to be closed.
- @retval EFI_SUCCESS the file closed sucessfully
+ @retval EFI_SUCCESS The file closed sucessfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_CLOSE_FILE)(
- IN EFI_FILE_HANDLE FileHandle
+ IN SHELL_FILE_HANDLE FileHandle
);
/**
@@ -69,42 +70,42 @@ EFI_STATUS
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 FileName Pointer to null-terminated file path
- @param FileAttribs The new file's attrbiutes. the different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param FileHandle On return, points to the created file handle or directory's handle
+ @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_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 could not open the file path
- @retval EFI_NOT_FOUND the specified file could not be found on the devide, 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.
+ @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 EFI_FILE_HANDLE *FileHandle
+ IN CONST CHAR16 *FileName,
+ IN UINT64 FileAttribs,
+ OUT SHELL_FILE_HANDLE *FileHandle
);
/**
@@ -114,15 +115,15 @@ EFI_STATUS
cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
handle is still closed.
- @param FileHandle The file handle to delete.
+ @param[in] FileHandle The file handle to delete.
- @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
+ @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 EFI_FILE_HANDLE FileHandle
+ IN SHELL_FILE_HANDLE FileHandle
);
/**
@@ -130,9 +131,9 @@ EFI_STATUS
This function deletes a file.
- @param FileName Points to the null-terminated file name.
+ @param[in] FileName Points to the NULL-terminated file name.
- @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
+ @retval EFI_SUCCESS The file was deleted.
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
**/
typedef
@@ -147,8 +148,8 @@ EFI_STATUS
typedef
VOID
(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
-VOID
-);
+ VOID
+ );
/**
Enables the page break output mode.
@@ -156,8 +157,8 @@ VOID
typedef
VOID
(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
-VOID
-);
+ VOID
+ );
/**
Execute the command line.
@@ -165,38 +166,38 @@ VOID
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 ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param CommandLine Points to the null-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param 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 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.
+ @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.
+ @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
+ IN EFI_HANDLE *ParentImageHandle,
+ IN CHAR16 *CommandLine OPTIONAL,
+ IN CHAR16 **Environment OPTIONAL,
+ OUT EFI_STATUS *StatusCode OPTIONAL
);
/**
@@ -209,49 +210,49 @@ EFI_STATUS
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 FilePattern Points to a null-terminated shell file path, including wildcards.
- @param 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.
+ @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
+ @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
+ IN CONST CHAR16 *FilePattern,
+ OUT EFI_SHELL_FILE_INFO **FileList
);
/**
Find all files in a specified directory.
- @param FileDirHandle Handle of the directory to search.
- @param FileList On return, points to the list of files in the directory
- or NULL if there are no files in the 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.
+ @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 EFI_FILE_HANDLE FileDirHandle,
-OUT EFI_SHELL_FILE_INFO **FileList
+IN SHELL_FILE_HANDLE FileDirHandle,
+OUT EFI_SHELL_FILE_INFO **FileList
);
/**
- Flushes data back to a device
-
+ Flushes data back to a device.
+
This function flushes all modified data associated with a file to a device.
- @param FileHandle The handle of the file to flush
+ @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.
@@ -264,17 +265,17 @@ OUT EFI_SHELL_FILE_INFO **FileList
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_FLUSH_FILE)(
- IN EFI_FILE_HANDLE FileHandle
+ 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 FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList()
+ @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.
**/
@@ -292,9 +293,9 @@ EFI_STATUS
FileSystemMapping. In both cases, the returned name includes the file system
mapping (i.e. fs0:\current-dir).
- @param FileSystemMapping A pointer to the file system mapping. If NULL,
+ @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.
**/
@@ -307,6 +308,7 @@ CONST CHAR16 *
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.
@@ -324,14 +326,14 @@ typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
- @param DeviceHandle The handle of the device.
- @param Flags Determines the possible sources of component names.
- @param Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M
- @param 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
+ @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.
@@ -339,11 +341,11 @@ typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
**/
typedef
EFI_STATUS
-(*EFI_SHELL_GET_DEVICE_NAME) (
- IN EFI_HANDLE DeviceHandle,
- IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
- IN CHAR8 *Language,
- OUT CHAR16 **BestDeviceName
+(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
+ IN CHAR8 *Language,
+ OUT CHAR16 **BestDeviceName
);
/**
@@ -351,12 +353,12 @@ EFI_STATUS
This function gets the device path associated with a mapping.
- @param Mapping A pointer to the 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
+ @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
+ @retval NULL There is no device path associated with the
specified mapping.
**/
typedef
@@ -371,9 +373,9 @@ CONST EFI_DEVICE_PATH_PROTOCOL *
This function converts a file system style name to a device path, by replacing any
mapping references to the associated device path.
- @param Path the pointer to the path
+ @param[in] Path The pointer to the path.
- @return all The pointer of the file path. The file path is callee
+ @return The pointer of the file path. The file path is callee
allocated and should be freed by the caller.
**/
typedef
@@ -383,20 +385,32 @@ EFI_DEVICE_PATH_PROTOCOL *
);
/**
- Gets the environment variable.
+ Gets either a single or list of environment variables.
- This function returns the current value of the specified environment variable.
+ If name is not NULL then this function returns the current value of the specified
+ environment variable.
- @param Name A pointer to the environment variable name
+ 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.
- @return !=NULL The environment variable's value. The returned
- pointer does not need to be freed by the caller.
- @retval NULL The environment variable doesn't exist.
+ @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
+ IN CONST CHAR16 *Name OPTIONAL
);
/**
@@ -405,15 +419,15 @@ CONST CHAR16 *
This function allocates a buffer to store the file's information. It's the caller's
responsibility to free the buffer.
- @param FileHandle A File Handle
+ @param[in] FileHandle A File Handle.
- @return !=NULL Cannot get the file info.
- @return NULL A pointer to a buffer with file information.
+ @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 EFI_FILE_HANDLE FileHandle
+ IN SHELL_FILE_HANDLE FileHandle
);
/**
@@ -423,9 +437,9 @@ EFI_FILE_INFO *
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 Path The pointer to the device path
+ @param[in] Path The pointer to the device path.
- @return all The pointer of the null-terminated file path. The path
+ @return The pointer of the NULL-terminated file path. The path
is callee-allocated and should be freed by the caller.
**/
typedef
@@ -435,14 +449,14 @@ CHAR16 *
);
/**
- Gets a file's current position
+ 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 FileHandle The file handle on which to get the current position.
- @param Position Byte position from the start of the file
+ @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.
@@ -450,7 +464,7 @@ CHAR16 *
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
- IN EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
OUT UINT64 *Position
);
@@ -459,8 +473,8 @@ EFI_STATUS
This function returns the size of the file specified by FileHandle.
- @param FileHandle The handle of the file.
- @param Size The size of this file.
+ @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.
@@ -468,7 +482,7 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
- IN EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
OUT UINT64 *Size
);
@@ -477,24 +491,24 @@ EFI_STATUS
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 Command Points to the null-terminated UEFI Shell command name.
- @param Sections Points to the null-terminated comma-delimited
- section names to return. If NULL, then all
+ @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 HelpText On return, points to a callee-allocated buffer
+ @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
+ @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_INVALID_PARAMETER HelpText is NULL.
@retval EFI_NOT_FOUND There is no help text available for Command.
**/
typedef
@@ -506,7 +520,7 @@ EFI_STATUS
);
/**
- Gets the mapping that most closely matches the device path.
+ 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
@@ -514,12 +528,15 @@ EFI_STATUS
device path. If there is an exact match, the mapping is returned and *DevicePath
points to the end-of-device-path node.
- @param DevicePath On entry, points to a device path pointer. On
- exit, updates the pointer to point to the
+ 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.
- @return !=NULL Pointer to null-terminated mapping. The buffer
+ @retval !=NULL Pointer to NULL-terminated mapping. The buffer
is callee allocated and should be freed by the caller.
**/
typedef
@@ -533,8 +550,8 @@ CONST CHAR16 *
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
+ @retval TRUE The page break output mode is enabled.
+ @retval FALSE The page break output mode is disabled.
**/
typedef
BOOLEAN
@@ -561,34 +578,34 @@ VOID
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
+ 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
+ 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
+ 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
+ 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
+ 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 FileName Points to the null-terminated UCS-2 encoded file name.
- @param FileHandle On return, points to the file handle.
- @param OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
+ @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.
@@ -612,7 +629,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
IN CONST CHAR16 *FileName,
- OUT EFI_FILE_HANDLE *FileHandle,
+ OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode
);
@@ -620,16 +637,16 @@ EFI_STATUS
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
+ 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 Path A pointer to the path string.
- @param OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
+ @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 FileList Points to the start of a list of files opened.
+ @param[in,out] FileList Points to the start of a list of files opened.
@retval EFI_SUCCESS Create the file list successfully.
- @return Others Can't create the file list.
+ @return Can't create the file list.
**/
typedef
EFI_STATUS
@@ -644,44 +661,44 @@ EFI_STATUS
This function opens the root directory of a device and returns a file handle to it.
- @param DevicePath Points to the device path corresponding to the device where the
+ @param[in] DevicePath Points to the device path corresponding to the device where the
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
+ @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
+ @retval EFI_DEVICE_ERROR The device had an error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_OPEN_ROOT)(
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT EFI_FILE_HANDLE *FileHandle
+ OUT SHELL_FILE_HANDLE *FileHandle
);
/**
- Opens the root directory of a device on a handle
+ 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 DeviceHandle The handle of the device that contains the volume.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
+ @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
+ @retval EFI_DEVICE_ERROR The device had an error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
IN EFI_HANDLE DeviceHandle,
- OUT EFI_FILE_HANDLE *FileHandle
+ OUT SHELL_FILE_HANDLE *FileHandle
);
/**
@@ -693,30 +710,28 @@ EFI_STATUS
current position is increased by the number of bytes returned.
If FileHandle is a directory, then an error is returned.
- @param FileHandle The opened file handle for read
- @param ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
- @param Buffer The buffer in which data is read.
+ @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
+ @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 EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
+ IN OUT VOID *Buffer
);
/**
Deletes the duplicate file names files in the given file list.
- This function deletes the reduplicate files in the given file list.
-
- @param FileList A pointer to the first entry in the file list.
+ @param[in] FileList A pointer to the first entry in the file list.
@retval EFI_SUCCESS Always success.
**/
@@ -731,12 +746,14 @@ EFI_STATUS
This function creates an alias for a shell command.
- @param Command Points to the null-terminated shell command or existing alias.
- @param Alias Points to the null-terminated alias for the shell command. If this is NULL, and
+ @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 Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
+ @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
@@ -747,7 +764,32 @@ EFI_STATUS
(EFIAPI *EFI_SHELL_SET_ALIAS)(
IN CONST CHAR16 *Command,
IN CONST CHAR16 *Alias,
- IN BOOLEAN Replace
+ 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
);
/**
@@ -765,14 +807,14 @@ EFI_STATUS
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
+ %cwd% environment variable will be updated.
- @param FileSystem A pointer to the file system's mapped name. If NULL, then the current working
+ @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
directory is changed.
- @param Dir Points to the null-terminated directory on the device specified by FileSystem.
+ @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
- @return !=NULL The current directory.
@retval NULL Current directory does not exist.
+ @return The current directory.
**/
typedef
EFI_STATUS
@@ -791,14 +833,14 @@ EFI_STATUS
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
+
+ For a description of volatile and non-volatile environment variables, see UEFI Shell
2.0 specification section 3.6.1.
- @param Name Points to the null-terminated environment variable name.
- @param Value Points to the null-terminated environment variable value. If the value is an
+ @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 Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
+ @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
@retval EFI_SUCCESS The environment variable was successfully updated.
**/
@@ -813,10 +855,11 @@ EFI_STATUS
/**
Sets the file information to an opened file handle.
- This function changes file information.
+ This function changes file information. All file information in the EFI_FILE_INFO
+ struct will be updated to the passed in data.
- @param FileHandle A file handle
- @param FileInfo Points to new file information.
+ @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.
@@ -830,12 +873,12 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
- IN EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
IN CONST EFI_FILE_INFO *FileInfo
);
/**
- Sets a file's current position
+ 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
@@ -843,8 +886,8 @@ EFI_STATUS
grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
to be set to the end of the file.
- @param FileHandle The file handle on which requested position will be set.
- @param Position Byte position from the start 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.
@@ -852,16 +895,16 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
- IN EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
IN UINT64 Position
);
/**
This function creates a mapping for a device path.
- @param DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
+ @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 Mapping Points to the null-terminated mapping for the device path.
+ @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
@@ -886,23 +929,23 @@ EFI_STATUS
Direct writes to opened directories are not supported.
- @param FileHandle The opened file handle for writing.
- @param BufferSize On input, size of Buffer.
- @param Buffer The buffer in which data to write.
+ @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
+ @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 EFI_FILE_HANDLE FileHandle,
+ IN SHELL_FILE_HANDLE FileHandle,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
);
@@ -911,6 +954,7 @@ 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;