\r
#include <Protocol/SimpleFileSystem.h>\r
\r
-EFI_STATUS\r
-BootMonFsDiscoverNextImage (\r
- IN BOOTMON_FS_INSTANCE *Flash,\r
- IN EFI_LBA *LbaStart,\r
- OUT HW_IMAGE_DESCRIPTION *Image\r
- );\r
-\r
EFI_STATUS\r
BootMonFsInitialize (\r
IN BOOTMON_FS_INSTANCE *Instance\r
IN EFI_FILE_PROTOCOL *This\r
);\r
\r
+/**\r
+ Flush all modified data associated with a file to a device.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the\r
+ file handle to flush.\r
+\r
+ @retval EFI_SUCCESS The data was flushed.\r
+ @retval EFI_ACCESS_DENIED The file was opened read-only.\r
+ @retval EFI_DEVICE_ERROR The device reported an error.\r
+ @retval EFI_VOLUME_FULL The volume is full.\r
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to flush the data.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsFlushFile (\r
IN EFI_FILE_PROTOCOL *This\r
);\r
\r
+/**\r
+ Close a specified file handle.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
+ handle to close.\r
+\r
+ @retval EFI_SUCCESS The file was closed.\r
+ @retval EFI_INVALID_PARAMETER The parameter "This" is NULL or is not an open\r
+ file handle.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsCloseFile (\r
IN EFI_FILE_PROTOCOL *This\r
);\r
\r
+/**\r
+ Open a file on the boot monitor file system.\r
+\r
+ The boot monitor file system does not allow for sub-directories. There is only\r
+ one directory, the root one. On any attempt to create a directory, the function\r
+ returns in error with the EFI_WRITE_PROTECTED error code.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is\r
+ the file handle to source location.\r
+ @param[out] NewHandle A pointer to the location to return the opened\r
+ handle for the new file.\r
+ @param[in] FileName The Null-terminated string of the name of the file\r
+ to be opened.\r
+ @param[in] OpenMode The mode to open the file : Read or Read/Write or\r
+ Read/Write/Create\r
+ @param[in] Attributes Attributes of the file in case of a file creation\r
+\r
+ @retval EFI_SUCCESS The file was open.\r
+ @retval EFI_NOT_FOUND The specified file could not be found or the specified\r
+ directory in which to create a file could not be found.\r
+ @retval EFI_DEVICE_ERROR The device reported an error.\r
+ @retval EFI_WRITE_PROTECTED Attempt to create a directory. This is not possible\r
+ with the Boot Monitor file system.\r
+ @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsOpenFile (\r
IN UINT64 Attributes\r
);\r
\r
+/**\r
+ Read data from an open file.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that\r
+ is the file handle to read data from.\r
+ @param[in out] BufferSize On input, the size of the Buffer. On output, the\r
+ amount of data returned in Buffer. In both cases,\r
+ the size is measured in bytes.\r
+ @param[out] Buffer The buffer into which the data is read.\r
\r
+ @retval EFI_SUCCESS The data was read.\r
+ @retval EFI_DEVICE_ERROR On entry, the current file position is\r
+ beyond the end of the file, or the device\r
+ reported an error while performing the read\r
+ operation.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsReadFile (\r
OUT UINT64 *Position\r
);\r
\r
+/**\r
+ Write data to an open file.\r
+\r
+ The data is not written to the flash yet. It will be written when the file\r
+ will be either read, closed or flushed.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that\r
+ is the file handle to write data to.\r
+ @param[in out] BufferSize On input, the size of the Buffer. On output, the\r
+ size of the data actually written. In both cases,\r
+ the size is measured in bytes.\r
+ @param[in] Buffer The buffer of data to write.\r
+\r
+ @retval EFI_SUCCESS The data was written.\r
+ @retval EFI_ACCESS_DENIED The file was opened read only.\r
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate the buffer to store the\r
+ data to write.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsWriteFile (\r
IN EFI_FILE_PROTOCOL *This\r
);\r
\r
+/**\r
+ Close and delete a file from the boot monitor file system.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
+ handle to delete.\r
+\r
+ @retval EFI_SUCCESS The file was closed and deleted.\r
+ @retval EFI_INVALID_PARAMETER The parameter "This" is NULL or is not an open\r
+ file handle.\r
+ @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsDelete (\r
IN EFI_FILE_PROTOCOL *This\r
);\r
\r
+/**\r
+ Set a file's current position.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is\r
+ the file handle to set the requested position on.\r
+ @param[in] Position The byte position from the start of the file to set.\r
+\r
+ @retval EFI_SUCCESS The position was set.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsSetPosition (\r
IN UINT64 Position\r
);\r
\r
+/**\r
+ Return a file's current position.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that is\r
+ the file handle to get the current position on.\r
+ @param[out] Position The address to return the file's current position value.\r
+\r
+ @retval EFI_SUCCESS The position was returned.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsGetPosition(\r
OUT UINT64 *Position\r
);\r
\r
+/**\r
+ Set information about a file or a volume.\r
+\r
+ @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that\r
+ is the file handle the information is for.\r
+ @param[in] InformationType The type identifier for the information being set :\r
+ EFI_FILE_INFO_ID or EFI_FILE_SYSTEM_INFO_ID or\r
+ EFI_FILE_SYSTEM_VOLUME_LABEL_ID\r
+ @param[in] BufferSize The size, in bytes, of Buffer.\r
+ @param[in] Buffer A pointer to the data buffer to write. The type of the\r
+ data inside the buffer is indicated by InformationType.\r
+\r
+ @retval EFI_SUCCESS The information was set.\r
+ @retval EFI_UNSUPPORTED The InformationType is not known.\r
+ @retval EFI_DEVICE_ERROR The last issued semi-hosting operation failed.\r
+ @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file\r
+ to a file that is already present.\r
+ @retval EFI_ACCESS_DENIED An attempt is being made to change the\r
+ EFI_FILE_DIRECTORY Attribute.\r
+ @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and\r
+ the file was opened in read-only mode and an\r
+ attempt is being made to modify a field other\r
+ than Attribute.\r
+ @retval EFI_WRITE_PROTECTED An attempt is being made to modify a read-only\r
+ attribute.\r
+ @retval EFI_BAD_BUFFER_SIZE The size of the buffer is lower than that indicated by\r
+ the data inside the buffer.\r
+ @retval EFI_OUT_OF_RESOURCES A allocation needed to process the request failed.\r
+ @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.\r
+\r
+**/\r
EFIAPI\r
EFI_STATUS\r
BootMonFsSetInfo (\r
//\r
// Internal API\r
//\r
+\r
+/**\r
+ Search for a file given its name coded in Ascii.\r
+\r
+ When searching through the files of the volume, if a file is currently not\r
+ open, its name was written on the media and is kept in RAM in the\r
+ "HwDescription.Footer.Filename[]" field of the file's description.\r
+\r
+ If a file is currently open, its name might not have been written on the\r
+ media yet, and as the "HwDescription" is a mirror in RAM of what is on the\r
+ media the "HwDescription.Footer.Filename[]" might be outdated. In that case,\r
+ the up to date name of the file is stored in the "Info" field of the file's\r
+ description.\r
+\r
+ @param[in] Instance Pointer to the description of the volume in which\r
+ the file has to be search for.\r
+ @param[in] AsciiFileName Name of the file.\r
+\r
+ @param[out] File Pointer to the description of the file if the\r
+ file was found.\r
+\r
+ @retval EFI_SUCCESS The file was found.\r
+ @retval EFI_NOT_FOUND The file was not found.\r
+\r
+**/\r
EFI_STATUS\r
BootMonGetFileFromAsciiFileName (\r
IN BOOTMON_FS_INSTANCE *Instance,\r