TianoCore EDK2 master
Loading...
Searching...
No Matches
SimpleFileSystem.h
Go to the documentation of this file.
1
15#ifndef __SIMPLE_FILE_SYSTEM_H__
16#define __SIMPLE_FILE_SYSTEM_H__
17
18#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
19 { \
20 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
21 }
22
24
27
31#define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID
32
38
59typedef
64 );
65
66#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
67
71#define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
72
79 UINT64 Revision;
81};
82
113typedef
115(EFIAPI *EFI_FILE_OPEN)(
116 IN EFI_FILE_PROTOCOL *This,
117 OUT EFI_FILE_PROTOCOL **NewHandle,
118 IN CHAR16 *FileName,
119 IN UINT64 OpenMode,
120 IN UINT64 Attributes
121 );
122
123//
124// Open modes
125//
126#define EFI_FILE_MODE_READ 0x0000000000000001ULL
127#define EFI_FILE_MODE_WRITE 0x0000000000000002ULL
128#define EFI_FILE_MODE_CREATE 0x8000000000000000ULL
129
130//
131// File attributes
132//
133#define EFI_FILE_READ_ONLY 0x0000000000000001ULL
134#define EFI_FILE_HIDDEN 0x0000000000000002ULL
135#define EFI_FILE_SYSTEM 0x0000000000000004ULL
136#define EFI_FILE_RESERVED 0x0000000000000008ULL
137#define EFI_FILE_DIRECTORY 0x0000000000000010ULL
138#define EFI_FILE_ARCHIVE 0x0000000000000020ULL
139#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL
140
150typedef
152(EFIAPI *EFI_FILE_CLOSE)(
154 );
155
166typedef
168(EFIAPI *EFI_FILE_DELETE)(
170 );
171
192typedef
194(EFIAPI *EFI_FILE_READ)(
195 IN EFI_FILE_PROTOCOL *This,
196 IN OUT UINTN *BufferSize,
197 OUT VOID *Buffer
198 );
199
220typedef
222(EFIAPI *EFI_FILE_WRITE)(
223 IN EFI_FILE_PROTOCOL *This,
224 IN OUT UINTN *BufferSize,
225 IN VOID *Buffer
226 );
227
241typedef
243(EFIAPI *EFI_FILE_SET_POSITION)(
244 IN EFI_FILE_PROTOCOL *This,
245 IN UINT64 Position
246 );
247
260typedef
262(EFIAPI *EFI_FILE_GET_POSITION)(
263 IN EFI_FILE_PROTOCOL *This,
264 OUT UINT64 *Position
265 );
266
287typedef
289(EFIAPI *EFI_FILE_GET_INFO)(
290 IN EFI_FILE_PROTOCOL *This,
291 IN EFI_GUID *InformationType,
292 IN OUT UINTN *BufferSize,
293 OUT VOID *Buffer
294 );
295
330typedef
332(EFIAPI *EFI_FILE_SET_INFO)(
333 IN EFI_FILE_PROTOCOL *This,
334 IN EFI_GUID *InformationType,
335 IN UINTN BufferSize,
336 IN VOID *Buffer
337 );
338
354typedef
356(EFIAPI *EFI_FILE_FLUSH)(
358 );
359
360typedef struct {
361 //
362 // If Event is NULL, then blocking I/O is performed.
363 // If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed,
364 // and Event will be signaled when the read request is completed.
365 // The caller must be prepared to handle the case where the callback associated with Event
366 // occurs before the original asynchronous I/O request call returns.
367 //
368 EFI_EVENT Event;
369
370 //
371 // Defines whether or not the signaled event encountered an error.
372 //
373 EFI_STATUS Status;
374
375 //
376 // For OpenEx(): Not Used, ignored.
377 // For ReadEx(): On input, the size of the Buffer. On output, the amount of data returned in Buffer.
378 // In both cases, the size is measured in bytes.
379 // For WriteEx(): On input, the size of the Buffer. On output, the amount of data actually written.
380 // In both cases, the size is measured in bytes.
381 // For FlushEx(): Not used, ignored.
382 //
383 UINTN BufferSize;
384
385 //
386 // For OpenEx(): Not Used, ignored.
387 // For ReadEx(): The buffer into which the data is read.
388 // For WriteEx(): The buffer of data to write.
389 // For FlushEx(): Not Used, ignored.
390 //
391 VOID *Buffer;
393
426typedef
428(EFIAPI *EFI_FILE_OPEN_EX)(
429 IN EFI_FILE_PROTOCOL *This,
430 OUT EFI_FILE_PROTOCOL **NewHandle,
431 IN CHAR16 *FileName,
432 IN UINT64 OpenMode,
433 IN UINT64 Attributes,
435 );
436
453typedef
455(EFIAPI *EFI_FILE_READ_EX)(
456 IN EFI_FILE_PROTOCOL *This,
458 );
459
479typedef
481(EFIAPI *EFI_FILE_WRITE_EX)(
482 IN EFI_FILE_PROTOCOL *This,
484 );
485
505typedef
507(EFIAPI *EFI_FILE_FLUSH_EX)(
508 IN EFI_FILE_PROTOCOL *This,
510 );
511
512#define EFI_FILE_PROTOCOL_REVISION 0x00010000
513#define EFI_FILE_PROTOCOL_REVISION2 0x00020000
514#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2
515
516//
517// Revision defined in EFI1.1.
518//
519#define EFI_FILE_REVISION EFI_FILE_PROTOCOL_REVISION
520
534 UINT64 Revision;
535 EFI_FILE_OPEN Open;
536 EFI_FILE_CLOSE Close;
537 EFI_FILE_DELETE Delete;
538 EFI_FILE_READ Read;
539 EFI_FILE_WRITE Write;
540 EFI_FILE_GET_POSITION GetPosition;
541 EFI_FILE_SET_POSITION SetPosition;
542 EFI_FILE_GET_INFO GetInfo;
543 EFI_FILE_SET_INFO SetInfo;
544 EFI_FILE_FLUSH Flush;
545 EFI_FILE_OPEN_EX OpenEx;
546 EFI_FILE_READ_EX ReadEx;
547 EFI_FILE_WRITE_EX WriteEx;
548 EFI_FILE_FLUSH_EX FlushEx;
549};
550
551extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
552
553#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_FILE_FLUSH)(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS(EFIAPI * EFI_FILE_WRITE)(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_FILE_DELETE)(IN EFI_FILE_PROTOCOL *This)
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE
EFI_STATUS(EFIAPI * EFI_FILE_SET_INFO)(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_FILE_WRITE_EX)(IN EFI_FILE_PROTOCOL *This, IN OUT EFI_FILE_IO_TOKEN *Token)
EFI_STATUS(EFIAPI * EFI_FILE_OPEN)(IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_STATUS(EFIAPI * EFI_FILE_GET_INFO)(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_FILE_GET_POSITION)(IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
EFI_STATUS(EFIAPI * EFI_FILE_CLOSE)(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS(EFIAPI * EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **Root)
EFI_STATUS(EFIAPI * EFI_FILE_READ)(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_FILE_FLUSH_EX)(IN EFI_FILE_PROTOCOL *This, IN OUT EFI_FILE_IO_TOKEN *Token)
EFI_STATUS(EFIAPI * EFI_FILE_SET_POSITION)(IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)
EFI_STATUS(EFIAPI * EFI_FILE_READ_EX)(IN EFI_FILE_PROTOCOL *This, IN OUT EFI_FILE_IO_TOKEN *Token)
EFI_STATUS(EFIAPI * EFI_FILE_OPEN_EX)(IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes, IN OUT EFI_FILE_IO_TOKEN *Token)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
Definition: Base.h:213