iPXE
SimpleFileSystem.h
Go to the documentation of this file.
00001 /** @file
00002   SimpleFileSystem protocol as defined in the UEFI 2.0 specification.
00003 
00004   The SimpleFileSystem protocol is the programmatic access to the FAT (12,16,32)
00005   file system specified in UEFI 2.0. It can also be used to abstract a file
00006   system other than FAT.
00007 
00008   UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
00009 
00010 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
00011 This program and the accompanying materials are licensed and made available under
00012 the terms and conditions of the BSD License that accompanies this distribution.
00013 The full text of the license may be found at
00014 http://opensource.org/licenses/bsd-license.php.
00015 
00016 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00017 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00018 
00019 **/
00020 
00021 #ifndef __SIMPLE_FILE_SYSTEM_H__
00022 #define __SIMPLE_FILE_SYSTEM_H__
00023 
00024 FILE_LICENCE ( BSD3 );
00025 
00026 #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
00027   { \
00028     0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
00029   }
00030 
00031 typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
00032 
00033 typedef struct _EFI_FILE_PROTOCOL         EFI_FILE_PROTOCOL;
00034 typedef struct _EFI_FILE_PROTOCOL         *EFI_FILE_HANDLE;
00035 
00036 ///
00037 /// Protocol GUID name defined in EFI1.1.
00038 ///
00039 #define SIMPLE_FILE_SYSTEM_PROTOCOL       EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID
00040 
00041 ///
00042 /// Protocol name defined in EFI1.1.
00043 ///
00044 typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL   EFI_FILE_IO_INTERFACE;
00045 typedef EFI_FILE_PROTOCOL                 EFI_FILE;
00046 
00047 /**
00048   Open the root directory on a volume.
00049 
00050   @param  This A pointer to the volume to open the root directory.
00051   @param  Root A pointer to the location to return the opened file handle for the
00052                root directory.
00053 
00054   @retval EFI_SUCCESS          The device was opened.
00055   @retval EFI_UNSUPPORTED      This volume does not support the requested file system type.
00056   @retval EFI_NO_MEDIA         The device has no medium.
00057   @retval EFI_DEVICE_ERROR     The device reported an error.
00058   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00059   @retval EFI_ACCESS_DENIED    The service denied access to the file.
00060   @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
00061   @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the medium is no
00062                                longer supported. Any existing file handles for this volume are
00063                                no longer valid. To access the files on the new medium, the
00064                                volume must be reopened with OpenVolume().
00065 
00066 **/
00067 typedef
00068 EFI_STATUS
00069 (EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(
00070   IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL    *This,
00071   OUT EFI_FILE_PROTOCOL                 **Root
00072   );
00073 
00074 #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION  0x00010000
00075 
00076 ///
00077 /// Revision defined in EFI1.1
00078 ///
00079 #define EFI_FILE_IO_INTERFACE_REVISION  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
00080 
00081 struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
00082   ///
00083   /// The version of the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. The version
00084   /// specified by this specification is 0x00010000. All future revisions
00085   /// must be backwards compatible.
00086   ///
00087   UINT64                                      Revision;
00088   EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
00089 };
00090 
00091 /**
00092   Opens a new file relative to the source file's location.
00093 
00094   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file
00095                      handle to the source location. This would typically be an open
00096                      handle to a directory.
00097   @param  NewHandle  A pointer to the location to return the opened handle for the new
00098                      file.
00099   @param  FileName   The Null-terminated string of the name of the file to be opened.
00100                      The file name may contain the following path modifiers: "\", ".",
00101                      and "..".
00102   @param  OpenMode   The mode to open the file. The only valid combinations that the
00103                      file may be opened with are: Read, Read/Write, or Create/Read/Write.
00104   @param  Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the
00105                      attribute bits for the newly created file.
00106 
00107   @retval EFI_SUCCESS          The file was opened.
00108   @retval EFI_NOT_FOUND        The specified file could not be found on the device.
00109   @retval EFI_NO_MEDIA         The device has no medium.
00110   @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the medium is no
00111                                longer supported.
00112   @retval EFI_DEVICE_ERROR     The device reported an error.
00113   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00114   @retval EFI_WRITE_PROTECTED  An attempt was made to create a file, or open a file for write
00115                                when the media is write-protected.
00116   @retval EFI_ACCESS_DENIED    The service denied access to the file.
00117   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
00118   @retval EFI_VOLUME_FULL      The volume is full.
00119 
00120 **/
00121 typedef
00122 EFI_STATUS
00123 (EFIAPI *EFI_FILE_OPEN)(
00124   IN EFI_FILE_PROTOCOL        *This,
00125   OUT EFI_FILE_PROTOCOL       **NewHandle,
00126   IN CHAR16                   *FileName,
00127   IN UINT64                   OpenMode,
00128   IN UINT64                   Attributes
00129   );
00130 
00131 //
00132 // Open modes
00133 //
00134 #define EFI_FILE_MODE_READ    0x0000000000000001ULL
00135 #define EFI_FILE_MODE_WRITE   0x0000000000000002ULL
00136 #define EFI_FILE_MODE_CREATE  0x8000000000000000ULL
00137 
00138 //
00139 // File attributes
00140 //
00141 #define EFI_FILE_READ_ONLY  0x0000000000000001ULL
00142 #define EFI_FILE_HIDDEN     0x0000000000000002ULL
00143 #define EFI_FILE_SYSTEM     0x0000000000000004ULL
00144 #define EFI_FILE_RESERVED   0x0000000000000008ULL
00145 #define EFI_FILE_DIRECTORY  0x0000000000000010ULL
00146 #define EFI_FILE_ARCHIVE    0x0000000000000020ULL
00147 #define EFI_FILE_VALID_ATTR 0x0000000000000037ULL
00148 
00149 /**
00150   Closes a specified file handle.
00151 
00152   @param  This          A pointer to the EFI_FILE_PROTOCOL instance that is the file
00153                         handle to close.
00154 
00155   @retval EFI_SUCCESS   The file was closed.
00156 
00157 **/
00158 typedef
00159 EFI_STATUS
00160 (EFIAPI *EFI_FILE_CLOSE)(
00161   IN EFI_FILE_PROTOCOL  *This
00162   );
00163 
00164 /**
00165   Close and delete the file handle.
00166 
00167   @param  This                     A pointer to the EFI_FILE_PROTOCOL instance that is the
00168                                    handle to the file to delete.
00169 
00170   @retval EFI_SUCCESS              The file was closed and deleted, and the handle was closed.
00171   @retval EFI_WARN_DELETE_FAILURE  The handle was closed, but the file was not deleted.
00172 
00173 **/
00174 typedef
00175 EFI_STATUS
00176 (EFIAPI *EFI_FILE_DELETE)(
00177   IN EFI_FILE_PROTOCOL  *This
00178   );
00179 
00180 /**
00181   Reads data from a file.
00182 
00183   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file
00184                      handle to read data from.
00185   @param  BufferSize On input, the size of the Buffer. On output, the amount of data
00186                      returned in Buffer. In both cases, the size is measured in bytes.
00187   @param  Buffer     The buffer into which the data is read.
00188 
00189   @retval EFI_SUCCESS          Data was read.
00190   @retval EFI_NO_MEDIA         The device has no medium.
00191   @retval EFI_DEVICE_ERROR     The device reported an error.
00192   @retval EFI_DEVICE_ERROR     An attempt was made to read from a deleted file.
00193   @retval EFI_DEVICE_ERROR     On entry, the current file position is beyond the end of the file.
00194   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00195   @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory
00196                                entry. BufferSize has been updated with the size
00197                                needed to complete the request.
00198 
00199 **/
00200 typedef
00201 EFI_STATUS
00202 (EFIAPI *EFI_FILE_READ)(
00203   IN EFI_FILE_PROTOCOL        *This,
00204   IN OUT UINTN                *BufferSize,
00205   OUT VOID                    *Buffer
00206   );
00207 
00208 /**
00209   Writes data to a file.
00210 
00211   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file
00212                      handle to write data to.
00213   @param  BufferSize On input, the size of the Buffer. On output, the amount of data
00214                      actually written. In both cases, the size is measured in bytes.
00215   @param  Buffer     The buffer of data to write.
00216 
00217   @retval EFI_SUCCESS          Data was written.
00218   @retval EFI_UNSUPPORTED      Writes to open directory files are not supported.
00219   @retval EFI_NO_MEDIA         The device has no medium.
00220   @retval EFI_DEVICE_ERROR     The device reported an error.
00221   @retval EFI_DEVICE_ERROR     An attempt was made to write to a deleted file.
00222   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00223   @retval EFI_WRITE_PROTECTED  The file or medium is write-protected.
00224   @retval EFI_ACCESS_DENIED    The file was opened read only.
00225   @retval EFI_VOLUME_FULL      The volume is full.
00226 
00227 **/
00228 typedef
00229 EFI_STATUS
00230 (EFIAPI *EFI_FILE_WRITE)(
00231   IN EFI_FILE_PROTOCOL        *This,
00232   IN OUT UINTN                *BufferSize,
00233   IN VOID                     *Buffer
00234   );
00235 
00236 /**
00237   Sets a file's current position.
00238 
00239   @param  This            A pointer to the EFI_FILE_PROTOCOL instance that is the
00240                           file handle to set the requested position on.
00241   @param  Position        The byte position from the start of the file to set.
00242 
00243   @retval EFI_SUCCESS      The position was set.
00244   @retval EFI_UNSUPPORTED  The seek request for nonzero is not valid on open
00245                            directories.
00246   @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file.
00247 
00248 **/
00249 typedef
00250 EFI_STATUS
00251 (EFIAPI *EFI_FILE_SET_POSITION)(
00252   IN EFI_FILE_PROTOCOL        *This,
00253   IN UINT64                   Position
00254   );
00255 
00256 /**
00257   Returns a file's current position.
00258 
00259   @param  This            A pointer to the EFI_FILE_PROTOCOL instance that is the file
00260                           handle to get the current position on.
00261   @param  Position        The address to return the file's current position value.
00262 
00263   @retval EFI_SUCCESS      The position was returned.
00264   @retval EFI_UNSUPPORTED  The request is not valid on open directories.
00265   @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file.
00266 
00267 **/
00268 typedef
00269 EFI_STATUS
00270 (EFIAPI *EFI_FILE_GET_POSITION)(
00271   IN EFI_FILE_PROTOCOL        *This,
00272   OUT UINT64                  *Position
00273   );
00274 
00275 /**
00276   Returns information about a file.
00277 
00278   @param  This            A pointer to the EFI_FILE_PROTOCOL instance that is the file
00279                           handle the requested information is for.
00280   @param  InformationType The type identifier for the information being requested.
00281   @param  BufferSize      On input, the size of Buffer. On output, the amount of data
00282                           returned in Buffer. In both cases, the size is measured in bytes.
00283   @param  Buffer          A pointer to the data buffer to return. The buffer's type is
00284                           indicated by InformationType.
00285 
00286   @retval EFI_SUCCESS          The information was returned.
00287   @retval EFI_UNSUPPORTED      The InformationType is not known.
00288   @retval EFI_NO_MEDIA         The device has no medium.
00289   @retval EFI_DEVICE_ERROR     The device reported an error.
00290   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00291   @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
00292                                BufferSize has been updated with the size needed to complete
00293                                the request.
00294 **/
00295 typedef
00296 EFI_STATUS
00297 (EFIAPI *EFI_FILE_GET_INFO)(
00298   IN EFI_FILE_PROTOCOL        *This,
00299   IN EFI_GUID                 *InformationType,
00300   IN OUT UINTN                *BufferSize,
00301   OUT VOID                    *Buffer
00302   );
00303 
00304 /**
00305   Sets information about a file.
00306 
00307   @param  File            A pointer to the EFI_FILE_PROTOCOL instance that is the file
00308                           handle the information is for.
00309   @param  InformationType The type identifier for the information being set.
00310   @param  BufferSize      The size, in bytes, of Buffer.
00311   @param  Buffer          A pointer to the data buffer to write. The buffer's type is
00312                           indicated by InformationType.
00313 
00314   @retval EFI_SUCCESS          The information was set.
00315   @retval EFI_UNSUPPORTED      The InformationType is not known.
00316   @retval EFI_NO_MEDIA         The device has no medium.
00317   @retval EFI_DEVICE_ERROR     The device reported an error.
00318   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00319   @retval EFI_WRITE_PROTECTED  InformationType is EFI_FILE_INFO_ID and the media is
00320                                read-only.
00321   @retval EFI_WRITE_PROTECTED  InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID
00322                                and the media is read only.
00323   @retval EFI_WRITE_PROTECTED  InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID
00324                                and the media is read-only.
00325   @retval EFI_ACCESS_DENIED    An attempt is made to change the name of a file to a
00326                                file that is already present.
00327   @retval EFI_ACCESS_DENIED    An attempt is being made to change the EFI_FILE_DIRECTORY
00328                                Attribute.
00329   @retval EFI_ACCESS_DENIED    An attempt is being made to change the size of a directory.
00330   @retval EFI_ACCESS_DENIED    InformationType is EFI_FILE_INFO_ID and the file was opened
00331                                read-only and an attempt is being made to modify a field
00332                                other than Attribute.
00333   @retval EFI_VOLUME_FULL      The volume is full.
00334   @retval EFI_BAD_BUFFER_SIZE  BufferSize is smaller than the size of the type indicated
00335                                by InformationType.
00336 
00337 **/
00338 typedef
00339 EFI_STATUS
00340 (EFIAPI *EFI_FILE_SET_INFO)(
00341   IN EFI_FILE_PROTOCOL        *This,
00342   IN EFI_GUID                 *InformationType,
00343   IN UINTN                    BufferSize,
00344   IN VOID                     *Buffer
00345   );
00346 
00347 /**
00348   Flushes all modified data associated with a file to a device.
00349 
00350   @param  This A pointer to the EFI_FILE_PROTOCOL instance that is the file
00351                handle to flush.
00352 
00353   @retval EFI_SUCCESS          The data was flushed.
00354   @retval EFI_NO_MEDIA         The device has no medium.
00355   @retval EFI_DEVICE_ERROR     The device reported an error.
00356   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00357   @retval EFI_WRITE_PROTECTED  The file or medium is write-protected.
00358   @retval EFI_ACCESS_DENIED    The file was opened read-only.
00359   @retval EFI_VOLUME_FULL      The volume is full.
00360 
00361 **/
00362 typedef
00363 EFI_STATUS
00364 (EFIAPI *EFI_FILE_FLUSH)(
00365   IN EFI_FILE_PROTOCOL  *This
00366   );
00367 
00368 typedef struct {
00369   //
00370   // If Event is NULL, then blocking I/O is performed.
00371   // If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed,
00372   // and Event will be signaled when the read request is completed.
00373   // The caller must be prepared to handle the case where the callback associated with Event
00374   // occurs before the original asynchronous I/O request call returns.
00375   //
00376   EFI_EVENT                   Event;
00377 
00378   //
00379   // Defines whether or not the signaled event encountered an error.
00380   //
00381   EFI_STATUS                  Status;
00382 
00383   //
00384   // For OpenEx():  Not Used, ignored.
00385   // For ReadEx():  On input, the size of the Buffer. On output, the amount of data returned in Buffer.
00386   //                In both cases, the size is measured in bytes.
00387   // For WriteEx(): On input, the size of the Buffer. On output, the amount of data actually written.
00388   //                In both cases, the size is measured in bytes.
00389   // For FlushEx(): Not used, ignored.
00390   //
00391   UINTN                       BufferSize;
00392 
00393   //
00394   // For OpenEx():  Not Used, ignored.
00395   // For ReadEx():  The buffer into which the data is read.
00396   // For WriteEx(): The buffer of data to write.
00397   // For FlushEx(): Not Used, ignored.
00398   //
00399   VOID                        *Buffer;
00400 } EFI_FILE_IO_TOKEN;
00401 
00402 /**
00403   Opens a new file relative to the source directory's location.
00404 
00405   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file
00406                      handle to the source location.
00407   @param  NewHandle  A pointer to the location to return the opened handle for the new
00408                      file.
00409   @param  FileName   The Null-terminated string of the name of the file to be opened.
00410                      The file name may contain the following path modifiers: "\", ".",
00411                      and "..".
00412   @param  OpenMode   The mode to open the file. The only valid combinations that the
00413                      file may be opened with are: Read, Read/Write, or Create/Read/Write.
00414   @param  Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the
00415                      attribute bits for the newly created file.
00416   @param  Token      A pointer to the token associated with the transaction.
00417 
00418   @retval EFI_SUCCESS          If Event is NULL (blocking I/O): The data was read successfully.
00419                                If Event is not NULL (asynchronous I/O): The request was successfully
00420                                                                         queued for processing.
00421   @retval EFI_NOT_FOUND        The specified file could not be found on the device.
00422   @retval EFI_NO_MEDIA         The device has no medium.
00423   @retval EFI_MEDIA_CHANGED    The device has a different medium in it or the medium is no
00424                                longer supported.
00425   @retval EFI_DEVICE_ERROR     The device reported an error.
00426   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00427   @retval EFI_WRITE_PROTECTED  An attempt was made to create a file, or open a file for write
00428                                when the media is write-protected.
00429   @retval EFI_ACCESS_DENIED    The service denied access to the file.
00430   @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
00431   @retval EFI_VOLUME_FULL      The volume is full.
00432 
00433 **/
00434 typedef
00435 EFI_STATUS
00436 (EFIAPI *EFI_FILE_OPEN_EX)(
00437   IN EFI_FILE_PROTOCOL        *This,
00438   OUT EFI_FILE_PROTOCOL       **NewHandle,
00439   IN CHAR16                   *FileName,
00440   IN UINT64                   OpenMode,
00441   IN UINT64                   Attributes,
00442   IN OUT EFI_FILE_IO_TOKEN    *Token
00443   );
00444 
00445 
00446 /**
00447   Reads data from a file.
00448 
00449   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to read data from.
00450   @param  Token      A pointer to the token associated with the transaction.
00451 
00452   @retval EFI_SUCCESS          If Event is NULL (blocking I/O): The data was read successfully.
00453                                If Event is not NULL (asynchronous I/O): The request was successfully
00454                                                                         queued for processing.
00455   @retval EFI_NO_MEDIA         The device has no medium.
00456   @retval EFI_DEVICE_ERROR     The device reported an error.
00457   @retval EFI_DEVICE_ERROR     An attempt was made to read from a deleted file.
00458   @retval EFI_DEVICE_ERROR     On entry, the current file position is beyond the end of the file.
00459   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00460   @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
00461 **/
00462 typedef
00463 EFI_STATUS
00464 (EFIAPI *EFI_FILE_READ_EX) (
00465   IN EFI_FILE_PROTOCOL        *This,
00466   IN OUT EFI_FILE_IO_TOKEN    *Token
00467 );
00468 
00469 
00470 /**
00471   Writes data to a file.
00472 
00473   @param  This       A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to write data to.
00474   @param  Token      A pointer to the token associated with the transaction.
00475 
00476   @retval EFI_SUCCESS          If Event is NULL (blocking I/O): The data was read successfully.
00477                                If Event is not NULL (asynchronous I/O): The request was successfully
00478                                                                         queued for processing.
00479   @retval EFI_UNSUPPORTED      Writes to open directory files are not supported.
00480   @retval EFI_NO_MEDIA         The device has no medium.
00481   @retval EFI_DEVICE_ERROR     The device reported an error.
00482   @retval EFI_DEVICE_ERROR     An attempt was made to write to a deleted file.
00483   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00484   @retval EFI_WRITE_PROTECTED  The file or medium is write-protected.
00485   @retval EFI_ACCESS_DENIED    The file was opened read only.
00486   @retval EFI_VOLUME_FULL      The volume is full.
00487   @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
00488 **/
00489 typedef
00490 EFI_STATUS
00491 (EFIAPI *EFI_FILE_WRITE_EX) (
00492   IN EFI_FILE_PROTOCOL        *This,
00493   IN OUT EFI_FILE_IO_TOKEN    *Token
00494 );
00495 
00496 /**
00497   Flushes all modified data associated with a file to a device.
00498 
00499   @param  This  A pointer to the EFI_FILE_PROTOCOL instance that is the file
00500                 handle to flush.
00501   @param  Token A pointer to the token associated with the transaction.
00502 
00503   @retval EFI_SUCCESS          If Event is NULL (blocking I/O): The data was read successfully.
00504                                If Event is not NULL (asynchronous I/O): The request was successfully
00505                                                                         queued for processing.
00506   @retval EFI_NO_MEDIA         The device has no medium.
00507   @retval EFI_DEVICE_ERROR     The device reported an error.
00508   @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
00509   @retval EFI_WRITE_PROTECTED  The file or medium is write-protected.
00510   @retval EFI_ACCESS_DENIED    The file was opened read-only.
00511   @retval EFI_VOLUME_FULL      The volume is full.
00512   @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
00513 
00514 **/
00515 typedef
00516 EFI_STATUS
00517 (EFIAPI *EFI_FILE_FLUSH_EX) (
00518   IN EFI_FILE_PROTOCOL        *This,
00519   IN OUT EFI_FILE_IO_TOKEN    *Token
00520   );
00521 
00522 #define EFI_FILE_PROTOCOL_REVISION        0x00010000
00523 #define EFI_FILE_PROTOCOL_REVISION2       0x00020000
00524 #define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2
00525 
00526 //
00527 // Revision defined in EFI1.1.
00528 //
00529 #define EFI_FILE_REVISION   EFI_FILE_PROTOCOL_REVISION
00530 
00531 ///
00532 /// The EFI_FILE_PROTOCOL provides file IO access to supported file systems.
00533 /// An EFI_FILE_PROTOCOL provides access to a file's or directory's contents,
00534 /// and is also a reference to a location in the directory tree of the file system
00535 /// in which the file resides. With any given file handle, other files may be opened
00536 /// relative to this file's location, yielding new file handles.
00537 ///
00538 struct _EFI_FILE_PROTOCOL {
00539   ///
00540   /// The version of the EFI_FILE_PROTOCOL interface. The version specified
00541   /// by this specification is EFI_FILE_PROTOCOL_LATEST_REVISION.
00542   /// Future versions are required to be backward compatible to version 1.0.
00543   ///
00544   UINT64                Revision;
00545   EFI_FILE_OPEN         Open;
00546   EFI_FILE_CLOSE        Close;
00547   EFI_FILE_DELETE       Delete;
00548   EFI_FILE_READ         Read;
00549   EFI_FILE_WRITE        Write;
00550   EFI_FILE_GET_POSITION GetPosition;
00551   EFI_FILE_SET_POSITION SetPosition;
00552   EFI_FILE_GET_INFO     GetInfo;
00553   EFI_FILE_SET_INFO     SetInfo;
00554   EFI_FILE_FLUSH        Flush;
00555   EFI_FILE_OPEN_EX      OpenEx;
00556   EFI_FILE_READ_EX      ReadEx;
00557   EFI_FILE_WRITE_EX     WriteEx;
00558   EFI_FILE_FLUSH_EX     FlushEx;
00559 };
00560 
00561 
00562 extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
00563 
00564 #endif