3 * Copyright (c) 2012-2014, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __BOOTMON_FS_API_H
16 #define __BOOTMON_FS_API_H
18 #include <Protocol/SimpleFileSystem.h>
22 IN BOOTMON_FS_INSTANCE
*Instance
32 BootMonFsComputeFooterChecksum (
33 IN OUT HW_IMAGE_DESCRIPTION
*Footer
38 OpenBootMonFsOpenVolume (
39 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
*This
,
40 OUT EFI_FILE_PROTOCOL
**Root
44 BootMonFsGetImageLength (
45 IN BOOTMON_FS_FILE
*File
49 BootMonFsGetPhysicalSize (
50 IN BOOTMON_FS_FILE
* File
55 IN BOOTMON_FS_INSTANCE
*Instance
,
56 OUT BOOTMON_FS_FILE
**File
62 IN EFI_FILE_PROTOCOL
*This
,
63 IN EFI_GUID
*InformationType
,
64 IN OUT UINTN
*BufferSize
,
70 BootMonFsReadDirectory (
71 IN EFI_FILE_PROTOCOL
*This
,
72 IN OUT UINTN
*BufferSize
,
78 BootMonFsFlushDirectory (
79 IN EFI_FILE_PROTOCOL
*This
85 IN EFI_FILE_PROTOCOL
*This
91 IN EFI_FILE_PROTOCOL
*This
95 Open a file on the boot monitor file system.
97 @param[in] This The EFI_FILE_PROTOCOL parent handle.
98 @param[out] NewHandle A pointer to the location to return the opened
99 handle for the new file.
100 @param[in] FileName The Null-terminated string of the name of the file
102 @param[in] OpenMode The mode to open the file : Read or Read/Write or
104 @param[in] Attributes Attributes of the file in case of a file creation
106 @retval EFI_SUCCESS The file was open.
107 @retval EFI_NOT_FOUND The specified file could not be found or the specified
108 directory in which to create a file could not be found.
109 @retval EFI_DEVICE_ERROR The device reported an error.
110 @retval EFI_WRITE_PROTECTED Attempt to create a directory. This is not possible
111 with the BootMon file system.
112 @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
113 @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.
119 IN EFI_FILE_PROTOCOL
*This
,
120 OUT EFI_FILE_PROTOCOL
**NewHandle
,
127 Read data from an open file.
129 @param[in] This A pointer to the EFI_FILE_PROTOCOL instance that
130 is the file handle to read data from.
131 @param[in out] BufferSize On input, the size of the Buffer. On output, the
132 amount of data returned in Buffer. In both cases,
133 the size is measured in bytes.
134 @param[out] Buffer The buffer into which the data is read.
136 @retval EFI_SUCCESS The data was read.
137 @retval EFI_DEVICE_ERROR On entry, the current file position is
138 beyond the end of the file, or the device
139 reported an error while performing the read
141 @retval EFI_INVALID_PARAMETER At least one of the parameters is invalid.
146 IN EFI_FILE_PROTOCOL
*This
,
147 IN OUT UINTN
*BufferSize
,
153 BootMonFsSetDirPosition (
154 IN EFI_FILE_PROTOCOL
*This
,
160 BootMonFsGetPosition (
161 IN EFI_FILE_PROTOCOL
*This
,
168 IN EFI_FILE_PROTOCOL
*This
,
169 IN OUT UINTN
*BufferSize
,
175 BootMonFsDeleteFail (
176 IN EFI_FILE_PROTOCOL
*This
182 IN EFI_FILE_PROTOCOL
*This
187 BootMonFsSetPosition (
188 IN EFI_FILE_PROTOCOL
*This
,
194 BootMonFsGetPosition(
195 IN EFI_FILE_PROTOCOL
*This
,
200 // UNSUPPORTED OPERATIONS
205 BootMonFsGetPositionUnsupported (
206 IN EFI_FILE_PROTOCOL
*This
,
213 IN EFI_FILE_PROTOCOL
*This
,
214 IN EFI_GUID
*InformationType
,
224 BootMonFsOpenDirectory (
225 OUT EFI_FILE_PROTOCOL
**NewHandle
,
227 IN BOOTMON_FS_INSTANCE
*Volume
234 BootMonGetFileFromAsciiFileName (
235 IN BOOTMON_FS_INSTANCE
*Instance
,
236 IN CHAR8
* AsciiFileName
,
237 OUT BOOTMON_FS_FILE
**File
241 BootMonGetFileFromPosition (
242 IN BOOTMON_FS_INSTANCE
*Instance
,
244 OUT BOOTMON_FS_FILE
**File