TianoCore EDK2 master
Loading...
Searching...
No Matches
FvSimpleFileSystemInternal.h
Go to the documentation of this file.
1
11#ifndef __FVFS_INTERNAL_H__
12#define __FVFS_INTERNAL_H__
13
14#include <Uefi.h>
15#include <PiDxe.h>
16
17#include <Library/BaseLib.h>
19#include <Library/DebugLib.h>
22#include <Library/PrintLib.h>
24#include <Library/UefiLib.h>
25
30
31#include <Guid/FileSystemInfo.h>
32#include <Guid/FileInfo.h>
34
38
39//
40// Struct representing an instance of the "filesystem". There will be one of
41// these structs per FV.
42//
44 UINT32 Signature;
45 LIST_ENTRY FileInfoHead;
46 LIST_ENTRY FileHead;
47 EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
51 CHAR16 *VolumeLabel;
52};
53
54//
55// Struct representing a opening file. Each opening operation on file will
56// create such an instance except for the "root directory", which will only
57// be created once for each FV.
58//
60 UINT32 Signature;
61 LIST_ENTRY Link;
62 FV_FILESYSTEM_FILE_INFO *DirReadNext;
63 FV_FILESYSTEM_INSTANCE *Instance;
64 EFI_FILE_PROTOCOL FileProtocol;
65 FV_FILESYSTEM_FILE_INFO *FvFileInfo;
66 UINT64 Position;
67};
68
69//
70// Struct representing the info of a file.
71//
73 UINT32 Signature;
74 LIST_ENTRY Link;
75 EFI_GUID NameGuid;
76 EFI_FV_FILETYPE Type;
77 EFI_FILE_INFO FileInfo;
78};
79
80#define FVFS_FILE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 'i')
81#define FVFS_FILE_INFO_SIGNATURE SIGNATURE_32 ('f', 'v', 'i', 'n')
82#define FVFS_INSTANCE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 's')
83
84#define FVFS_INSTANCE_FROM_SIMPLE_FS_THIS(This) CR ( \
85 This, \
86 FV_FILESYSTEM_INSTANCE, \
87 SimpleFs, \
88 FVFS_INSTANCE_SIGNATURE \
89 )
90
91#define FVFS_FILE_FROM_FILE_THIS(This) CR ( \
92 This, \
93 FV_FILESYSTEM_FILE, \
94 FileProtocol, \
95 FVFS_FILE_SIGNATURE \
96 )
97
98#define FVFS_FILE_INFO_FROM_LINK(This) CR ( \
99 This, \
100 FV_FILESYSTEM_FILE_INFO, \
101 Link, \
102 FVFS_FILE_INFO_SIGNATURE \
103 )
104
105#define FVFS_FILE_FROM_LINK(FileLink) CR (FileLink, FV_FILESYSTEM_FILE, Link, FVFS_FILE_SIGNATURE)
106
107#define FVFS_GET_FIRST_FILE(Instance) FVFS_FILE_FROM_LINK (GetFirstNode (&Instance->FileHead))
108
109#define FVFS_GET_FIRST_FILE_INFO(Instance) FVFS_FILE_INFO_FROM_LINK (GetFirstNode (&Instance->FileInfoHead))
110
111#define FV_FILETYPE_IS_EXECUTABLE(Type) ((Type) == EFI_FV_FILETYPE_PEIM ||\
112 (Type) == EFI_FV_FILETYPE_DRIVER || \
113 (Type) == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER || \
114 (Type) == EFI_FV_FILETYPE_APPLICATION)
115
137EFIAPI
140 OUT EFI_FILE_PROTOCOL **RootFile
141 );
142
157EFIAPI
159 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
160 IN EFI_HANDLE ControllerHandle,
161 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
162 );
163
179EFIAPI
181 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
182 IN EFI_HANDLE ControllerHandle,
183 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
184 );
185
201EFIAPI
203 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
204 IN EFI_HANDLE ControllerHandle,
205 IN UINTN NumberOfChildren,
206 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
207 );
208
240EFIAPI
242 IN EFI_FILE_PROTOCOL *This,
243 OUT EFI_FILE_PROTOCOL **NewHandle,
244 IN CHAR16 *FileName,
245 IN UINT64 OpenMode,
246 IN UINT64 Attributes
247 );
248
259EFIAPI
262 );
263
285EFIAPI
287 IN EFI_FILE_PROTOCOL *This,
288 IN OUT UINTN *BufferSize,
289 OUT VOID *Buffer
290 );
291
313EFIAPI
315 IN EFI_FILE_PROTOCOL *This,
316 IN OUT UINTN *BufferSize,
317 IN VOID *Buffer
318 );
319
333EFIAPI
335 IN EFI_FILE_PROTOCOL *This,
336 OUT UINT64 *Position
337 );
338
353EFIAPI
355 IN EFI_FILE_PROTOCOL *This,
356 IN UINT64 Position
357 );
358
375EFIAPI
378 );
379
391EFIAPI
394 );
395
417EFIAPI
419 IN EFI_FILE_PROTOCOL *This,
420 IN EFI_GUID *InformationType,
421 IN OUT UINTN *BufferSize,
422 OUT VOID *Buffer
423 );
424
460EFIAPI
462 IN EFI_FILE_PROTOCOL *This,
463 IN EFI_GUID *InformationType,
464 IN UINTN BufferSize,
465 IN VOID *Buffer
466 );
467
482 IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo
483 );
484
525EFIAPI
528 IN CHAR8 *Language,
529 OUT CHAR16 **DriverName
530 );
531
601EFIAPI
604 IN EFI_HANDLE ControllerHandle,
605 IN EFI_HANDLE ChildHandle OPTIONAL,
606 IN CHAR8 *Language,
607 OUT CHAR16 **ControllerName
608 );
609
610extern EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation;
611extern EFI_FILE_PROTOCOL mFileSystemTemplate;
612extern EFI_COMPONENT_NAME_PROTOCOL gFvSimpleFileSystemComponentName;
613extern EFI_COMPONENT_NAME2_PROTOCOL gFvSimpleFileSystemComponentName2;
614
615#endif
UINT64 UINTN
EFI_STATUS EFIAPI FvSimpleFileSystemComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS EFIAPI FvSimpleFileSystemSetPosition(IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI FvSimpleFileSystemDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI FvSimpleFileSystemGetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemOpenVolume(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **RootFile)
EFI_STATUS EFIAPI FvSimpleFileSystemDelete(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS EFIAPI FvSimpleFileSystemOpen(IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_STATUS EFIAPI FvSimpleFileSystemDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI FvSimpleFileSystemRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemSetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemGetPosition(IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
EFI_STATUS EFIAPI FvSimpleFileSystemWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemFlush(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS FvFsGetFileSize(IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol, IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo)
EFI_STATUS EFIAPI FvSimpleFileSystemClose(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS EFIAPI FvSimpleFileSystemComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
Definition: ComponentName.c:87
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
Definition: Base.h:213