MODULE EFIFileProtocol;
IMPORT
EFI, SYSTEM;
CONST
Revision* = 00010000H;
ModeRead* = 1H;
ModeWrite* = 2H;
ModeCreate* = LONG(8000000000000000H);
ReadOnly* = 1H;
Hidden *= 2H;
System *= 4H;
Reserved *= 8H;
Directory *= 10H;
FileArchive *= 20H;
ValidAttr *= 37H;
VAR
FileInfoGUID- : EFI.GUID;
FileSystemInfoGUID- : EFI.GUID;
FileSystemVolumeInfoGUID- : EFI.GUID;
TYPE Protocol*= POINTER TO ProtocolDescription;
TYPE FileOpen* = PROCEDURE{C}(This : Protocol; VAR NewHandle : Protocol; CONST FileName : ARRAY OF EFI.Char16; OpenMode : EFI.Int64; Attributes : EFI.Int64) : EFI.Status;
TYPE FileClose* = PROCEDURE{C}(This : Protocol) : EFI.Status;
TYPE FileDelete* = PROCEDURE{C}(This : Protocol) : EFI.Status;
TYPE FileRead* = PROCEDURE{C}(This : Protocol; VAR BufferSize : EFI.Int; Buffer : SYSTEM.ADDRESS) : EFI.Status;
TYPE FileWrite* = PROCEDURE{C}(This : Protocol; VAR BufferSize : EFI.Int; CONST Buffer : ARRAY OF SYSTEM.BYTE) : EFI.Status;
TYPE FileGetPosition* = PROCEDURE{C}(This : Protocol; VAR Position : EFI.Int64) : EFI.Status;
TYPE FileSetPosition* = PROCEDURE{C}(This : Protocol; Position : EFI.Int64) : EFI.Status;
TYPE FileGetInfo* = PROCEDURE{C}(This : Protocol; CONST InformationType : EFI.GUID; VAR BufferSize : EFI.Int; VAR Buffer : ARRAY OF SYSTEM.BYTE) : EFI.Status;
TYPE FileSetInfo* = PROCEDURE{C}(This : Protocol; CONST InformationType : EFI.GUID; BufferSize : EFI.Int; CONST Buffer : ARRAY OF SYSTEM.BYTE) : EFI.Status;
TYPE FileFlush* = PROCEDURE{C}(This : Protocol) : EFI.Status;
TYPE ProtocolDescription*= RECORD(EFI.ProtocolDescription)
Revision-: EFI.Int64;
Open- : FileOpen;
Close-: FileClose;
Delete-: FileDelete;
Read-: FileRead;
Write-: FileWrite;
GetPosition-: FileGetPosition;
SetPosition-: FileSetPosition;
GetInfo-: FileGetInfo;
SetInfo-: FileSetInfo;
Flush-: FileFlush;
END;
CONST MaxFileNameLength = 128;
TYPE FileInfo* = RECORD
Size-: EFI.Int64;
FileSize-: EFI.Int64;
PhysicalSize-: EFI.Int64;
CreateTime-: EFI.Time;
LastAccessTime-: EFI.Time;
ModificationTime-: EFI.Time;
Attribute-: EFI.Int64;
FileName-: ARRAY MaxFileNameLength OF EFI.Char16;
END;
TYPE FileSystemInfo* = RECORD
Size-: EFI.Int64;
ReadOnly-: EFI.Boolean;
VolumeSize-: EFI.Int64;
FreeSpace-: EFI.Int64;
BlockSize-: EFI.Int32;
VolumeLabel-: ARRAY MaxFileNameLength OF EFI.Char16;
END;
TYPE FileSystemVolumeInfo* = RECORD
VolumeLabel-: ARRAY MaxFileNameLength OF EFI.Char16;
END;
BEGIN
FileInfoGUID.Data1 := 09576E92H;
FileInfoGUID.Data2 := 6D3FH;
FileInfoGUID.Data3 := 11D2H;
FileInfoGUID.Data4[0] := -72H;
FileInfoGUID.Data4[1] := 39H;
FileInfoGUID.Data4[2] := 00H;
FileInfoGUID.Data4[3] := -60H;
FileInfoGUID.Data4[4] := -37H;
FileInfoGUID.Data4[5] := 69H;
FileInfoGUID.Data4[6] := 72H;
FileInfoGUID.Data4[7] := 3BH;
FileSystemInfoGUID.Data1 := 09576E93H;
FileSystemInfoGUID.Data2 := 6D3FH;
FileSystemInfoGUID.Data3 := 11D2H;
FileSystemInfoGUID.Data4[0] := -72H;
FileSystemInfoGUID.Data4[1] := 39H;
FileSystemInfoGUID.Data4[2] := 00H;
FileSystemInfoGUID.Data4[3] := -60H;
FileSystemInfoGUID.Data4[4] := -37H;
FileSystemInfoGUID.Data4[5] := 69H;
FileSystemInfoGUID.Data4[6] := 72H;
FileSystemInfoGUID.Data4[7] := 3BH;
FileSystemVolumeInfoGUID.Data1 := -24B8282DH;
FileSystemVolumeInfoGUID.Data2 := -17FH;
FileSystemVolumeInfoGUID.Data3 := 11D3H;
FileSystemVolumeInfoGUID.Data4[0] := -66H;
FileSystemVolumeInfoGUID.Data4[1] := 35H;
FileSystemVolumeInfoGUID.Data4[2] := 00H;
FileSystemVolumeInfoGUID.Data4[3] := -70H;
FileSystemVolumeInfoGUID.Data4[4] := 27H;
FileSystemVolumeInfoGUID.Data4[5] := 3FH;
FileSystemVolumeInfoGUID.Data4[6] := -3FH;
FileSystemVolumeInfoGUID.Data4[7] := 4DH;
END EFIFileProtocol.