]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Include/Library/EfiFileLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / EmbeddedPkg / Include / Library / EfiFileLib.h
index 8fc7d71b4e2abf2db28bbe5f603d2add04528fc6..bae19ec78a734fb40f53b1d7accb34d4fb89f82c 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   Library functions that perform file IO. Memory buffer, file system, and\r
-  fimrware volume operations are supproted.\r
+  firmware volume operations are supported.\r
 \r
   Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
@@ -12,7 +12,7 @@
   current mounted device concept of current working directory concept implement\r
   by this library.\r
 \r
-  Device names are case insensative and only check the leading characters for\r
+  Device names are case insensitive and only check the leading characters for\r
   unique matches. Thus the following are all the same:\r
     LoadFile0:\r
     l0:\r
@@ -24,7 +24,7 @@
   l1:          - EFI LoadFile device one.\r
   B0:          - EFI BlockIo zero.\r
   fs3:         - EFI Simple File System device 3\r
-  Fv2:         - EFI Firmware VOlume device 2\r
+  Fv2:         - EFI Firmware Volume device 2\r
   1.2.3.4:name - TFTP IP and file name\r
 \r
 **/\r
@@ -42,7 +42,7 @@
 #include <Guid/FileInfo.h>\r
 #include <Guid/FileSystemInfo.h>\r
 \r
-#define MAX_PATHNAME    0x200\r
+#define MAX_PATHNAME  0x200\r
 \r
 /// Type of the file that has been opened\r
 typedef enum {\r
@@ -55,52 +55,49 @@ typedef enum {
   EfiOpenMaxValue\r
 } EFI_OPEN_FILE_TYPE;\r
 \r
-\r
 /// Public information about the open file\r
 typedef struct {\r
-  UINTN                         Version;          // Common information\r
-  EFI_OPEN_FILE_TYPE            Type;\r
-  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
-  EFI_STATUS                    LastError;\r
-  EFI_HANDLE                    EfiHandle;\r
-  CHAR8                         *DeviceName;\r
-  CHAR8                         *FileName;\r
-\r
-  UINT64                        CurrentPosition;  // Information for Seek\r
-  UINT64                        MaxPosition;\r
+  UINTN                            Version;       // Common information\r
+  EFI_OPEN_FILE_TYPE               Type;\r
+  EFI_DEVICE_PATH_PROTOCOL         *DevicePath;\r
+  EFI_STATUS                       LastError;\r
+  EFI_HANDLE                       EfiHandle;\r
+  CHAR8                            *DeviceName;\r
+  CHAR8                            *FileName;\r
 \r
-  UINTN                         BaseOffset;       // Base offset for hexdump command\r
+  UINT64                           CurrentPosition; // Information for Seek\r
+  UINT64                           MaxPosition;\r
 \r
-  UINTN                         Size;             // Valid for all types other than l#:\r
-  UINT8                         *Buffer;          // Information valid for A#:\r
+  UINTN                            BaseOffset;    // Base offset for hexdump command\r
 \r
-  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;              // Information valid for Fv#:\r
-  EFI_GUID                      FvNameGuid;\r
-  EFI_SECTION_TYPE              FvSectionType;\r
-  EFI_FV_FILETYPE               FvType;\r
-  EFI_FV_FILE_ATTRIBUTES        FvAttributes;\r
+  UINTN                            Size;          // Valid for all types other than l#:\r
+  UINT8                            *Buffer;       // Information valid for A#:\r
 \r
-  EFI_PHYSICAL_ADDRESS          FvStart;\r
-  UINTN                         FvSize;\r
-  UINTN                         FvHeaderSize;\r
+  EFI_FIRMWARE_VOLUME2_PROTOCOL    *Fv;           // Information valid for Fv#:\r
+  EFI_GUID                         FvNameGuid;\r
+  EFI_SECTION_TYPE                 FvSectionType;\r
+  EFI_FV_FILETYPE                  FvType;\r
+  EFI_FV_FILE_ATTRIBUTES           FvAttributes;\r
 \r
-  EFI_FILE                      *FsFileHandle;    // Information valid for Fs#:\r
-  EFI_FILE_SYSTEM_INFO          *FsInfo;\r
-  EFI_FILE_INFO                 *FsFileInfo;\r
-  EFI_BLOCK_IO_MEDIA            *FsBlockIoMedia;  // Information valid for Fs#: or B#:\r
-  EFI_BLOCK_IO_PROTOCOL         *FsBlockIo;       // Information valid for Fs#: or B#:\r
+  EFI_PHYSICAL_ADDRESS             FvStart;\r
+  UINTN                            FvSize;\r
+  UINTN                            FvHeaderSize;\r
 \r
-  UINTN                         DiskOffset;       // Information valid for B#:\r
+  EFI_FILE                         *FsFileHandle; // Information valid for Fs#:\r
+  EFI_FILE_SYSTEM_INFO             *FsInfo;\r
+  EFI_FILE_INFO                    *FsFileInfo;\r
+  EFI_BLOCK_IO_MEDIA               *FsBlockIoMedia; // Information valid for Fs#: or B#:\r
+  EFI_BLOCK_IO_PROTOCOL            *FsBlockIo;      // Information valid for Fs#: or B#:\r
 \r
-  EFI_LOAD_FILE_PROTOCOL        *LoadFile;        // Information valid for l#:\r
+  UINTN                            DiskOffset;    // Information valid for B#:\r
 \r
-  EFI_IP_ADDRESS                ServerIp;         // Information valid for t:\r
-  BOOLEAN                       IsDirty;\r
-  BOOLEAN                       IsBufferValid;\r
+  EFI_LOAD_FILE_PROTOCOL           *LoadFile;     // Information valid for l#:\r
 \r
+  EFI_IP_ADDRESS                   ServerIp;      // Information valid for t:\r
+  BOOLEAN                          IsDirty;\r
+  BOOLEAN                          IsBufferValid;\r
 } EFI_OPEN_FILE;\r
 \r
-\r
 /// Type of Seek to perform\r
 typedef enum {\r
   EfiSeekStart,\r
@@ -109,7 +106,6 @@ typedef enum {
   EfiSeekMax\r
 } EFI_SEEK_TYPE;\r
 \r
-\r
 /**\r
   Open a device named by PathName. The PathName includes a device name and\r
   path separated by a :. See file header for more details on the PathName\r
@@ -131,15 +127,15 @@ typedef enum {
 **/\r
 EFI_OPEN_FILE *\r
 EfiOpen (\r
-  IN        CHAR8               *PathName,\r
-  IN  CONST UINT64              OpenMode,\r
-  IN  CONST EFI_SECTION_TYPE    SectionType\r
+  IN        CHAR8             *PathName,\r
+  IN  CONST UINT64            OpenMode,\r
+  IN  CONST EFI_SECTION_TYPE  SectionType\r
   );\r
 \r
 EFI_STATUS\r
 EfiCopyFile (\r
-  IN        CHAR8               *DestinationFile,\r
-  IN        CHAR8               *SourceFile\r
+  IN        CHAR8  *DestinationFile,\r
+  IN        CHAR8  *SourceFile\r
   );\r
 \r
 /**\r
@@ -154,11 +150,10 @@ EfiCopyFile (
 **/\r
 EFI_OPEN_FILE  *\r
 EfiDeviceOpenByType (\r
-  IN  EFI_OPEN_FILE_TYPE    DeviceType,\r
-  IN  UINTN                 Index\r
+  IN  EFI_OPEN_FILE_TYPE  DeviceType,\r
+  IN  UINTN               Index\r
   );\r
 \r
-\r
 /**\r
   Close a file handle opened by EfiOpen() and free all resources allocated by\r
   EfiOpen().\r
@@ -171,10 +166,9 @@ EfiDeviceOpenByType (
 **/\r
 EFI_STATUS\r
 EfiClose (\r
-  IN  EFI_OPEN_FILE     *Stream\r
+  IN  EFI_OPEN_FILE  *Stream\r
   );\r
 \r
-\r
 /**\r
   Return the size of the file represented by Stream. Also return the current\r
   Seek position. Opening a file will enable a valid file size to be returned.\r
@@ -187,11 +181,10 @@ EfiClose (
 **/\r
 UINTN\r
 EfiTell (\r
-  IN  EFI_OPEN_FILE     *Stream,\r
-  OUT UINT64            *CurrentPosition   OPTIONAL\r
+  IN  EFI_OPEN_FILE  *Stream,\r
+  OUT UINT64         *CurrentPosition   OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   Seek to the Offset location in the file. LoadFile and FV device types do\r
   not support EfiSeek(). It is not possible to grow the file size using\r
@@ -215,12 +208,11 @@ EfiTell (
 **/\r
 EFI_STATUS\r
 EfiSeek (\r
-  IN  EFI_OPEN_FILE     *Stream,\r
-  IN  EFI_LBA           Offset,\r
-  IN  EFI_SEEK_TYPE     SeekType\r
+  IN  EFI_OPEN_FILE  *Stream,\r
+  IN  EFI_LBA        Offset,\r
+  IN  EFI_SEEK_TYPE  SeekType\r
   );\r
 \r
-\r
 /**\r
   Read BufferSize bytes from the current location in the file. For load file\r
   and FV case you must read the entire file.\r
@@ -239,12 +231,11 @@ EfiSeek (
 **/\r
 EFI_STATUS\r
 EfiRead (\r
-  IN  EFI_OPEN_FILE     *Stream,\r
-  OUT VOID              *Buffer,\r
-  OUT UINTN             *BufferSize\r
+  IN  EFI_OPEN_FILE  *Stream,\r
+  OUT VOID           *Buffer,\r
+  OUT UINTN          *BufferSize\r
   );\r
 \r
-\r
 /**\r
   Read the entire file into a buffer. This routine allocates the buffer and\r
   returns it to the user full of the read data.\r
@@ -266,12 +257,11 @@ EfiRead (
 **/\r
 EFI_STATUS\r
 EfiReadAllocatePool (\r
-  IN  EFI_OPEN_FILE     *Stream,\r
-  OUT VOID              **Buffer,\r
-  OUT UINTN             *BufferSize\r
+  IN  EFI_OPEN_FILE  *Stream,\r
+  OUT VOID           **Buffer,\r
+  OUT UINTN          *BufferSize\r
   );\r
 \r
-\r
 /**\r
   Write data back to the file.\r
 \r
@@ -289,12 +279,11 @@ EfiReadAllocatePool (
 **/\r
 EFI_STATUS\r
 EfiWrite (\r
-  IN  EFI_OPEN_FILE   *Stream,\r
-  OUT VOID            *Buffer,\r
-  OUT UINTN           *BufferSize\r
+  IN  EFI_OPEN_FILE  *Stream,\r
+  OUT VOID           *Buffer,\r
+  OUT UINTN          *BufferSize\r
   );\r
 \r
-\r
 /**\r
   Return the number of devices of the current type active in the system\r
 \r
@@ -305,10 +294,9 @@ EfiWrite (
 **/\r
 UINTN\r
 EfiGetDeviceCounts (\r
-  IN  EFI_OPEN_FILE_TYPE     Type\r
+  IN  EFI_OPEN_FILE_TYPE  Type\r
   );\r
 \r
-\r
 /**\r
   Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
   the path does not contain a device name, The CWD is prepended to the path.\r
@@ -322,7 +310,7 @@ EfiGetDeviceCounts (
 **/\r
 EFI_STATUS\r
 EfiSetCwd (\r
-  IN  CHAR8   *Cwd\r
+  IN  CHAR8  *Cwd\r
   );\r
 \r
 /**\r