10#ifndef VIRTIO_FS_DXE_H_
11#define VIRTIO_FS_DXE_H_
21#define VIRTIO_FS_SIG SIGNATURE_64 ('V', 'I', 'R', 'T', 'I', 'O', 'F', 'S')
23#define VIRTIO_FS_FILE_SIG \
24 SIGNATURE_64 ('V', 'I', 'O', 'F', 'S', 'F', 'I', 'L')
48#define VIRTIO_FS_MAX_PATHNAME_LENGTH ((UINTN)65535)
53#define VIRTIO_FS_FILE_MAX_FILE_INFO 256
60typedef CHAR16 VIRTIO_FS_LABEL[VIRTIO_FS_TAG_BYTES + 1];
76 VIRTIO_FS_LABEL Label;
87#define VIRTIO_FS_FROM_SIMPLE_FS(SimpleFsReference) \
88 CR (SimpleFsReference, VIRTIO_FS, SimpleFs, VIRTIO_FS_SIG);
144 BOOLEAN IsOpenForWriting;
147 CHAR8 *CanonicalPathname;
173 UINT8 *FileInfoArray;
174 UINTN SingleFileInfoSize;
179#define VIRTIO_FS_FILE_FROM_SIMPLE_FILE(SimpleFileReference) \
180 CR (SimpleFileReference, VIRTIO_FS_FILE, SimpleFile, VIRTIO_FS_FILE_SIG);
182#define VIRTIO_FS_FILE_FROM_OPEN_FILES_ENTRY(OpenFilesEntryReference) \
183 CR (OpenFilesEntryReference, VIRTIO_FS_FILE, OpenFilesEntry, \
204 IN VOID *VirtioFsAsVoid
225 IN UINT32 RequestSize,
226 IN VIRTIO_FS_FUSE_OPCODE Opcode,
245 IN CHAR16 *RhsPath16,
246 OUT CHAR8 **ResultPath8,
247 OUT BOOLEAN *RootEscape
254 OUT UINT64 *DirNodeId,
255 OUT CHAR8 **LastComponent
261 OUT CHAR16 *Basename OPTIONAL,
268 IN CHAR16 *RhsPath16,
269 OUT CHAR8 **ResultPath8,
270 OUT BOOLEAN *RootEscape
297 OUT BOOLEAN *UpdateAtime,
298 OUT BOOLEAN *UpdateMtime,
341 IN UINT64 *Size OPTIONAL,
342 IN UINT64 *Atime OPTIONAL,
343 IN UINT64 *Mtime OPTIONAL,
344 IN UINT32 *Mode OPTIONAL
350 IN UINT64 ParentNodeId,
358 IN UINT64 ParentNodeId,
367 IN BOOLEAN ReadWrite,
368 OUT UINT64 *FuseHandle
375 IN UINT64 FuseHandle,
386 IN UINT64 FuseHandle,
403 IN UINT64 FuseHandle,
411 IN UINT64 FuseHandle,
431 OUT UINT64 *FuseHandle
437 IN UINT64 ParentNodeId,
440 OUT UINT64 *FuseHandle
446 IN UINT64 OldParentNodeId,
448 IN UINT64 NewParentNodeId,
470VirtioFsSimpleFileClose (
476VirtioFsSimpleFileDelete (
482VirtioFsSimpleFileFlush (
488VirtioFsSimpleFileGetInfo (
497VirtioFsSimpleFileGetPosition (
504VirtioFsSimpleFileOpen (
514VirtioFsSimpleFileRead (
522VirtioFsSimpleFileSetInfo (
531VirtioFsSimpleFileSetPosition (
538VirtioFsSimpleFileWrite (
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_STATUS VirtioFsFuseOpen(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN BOOLEAN ReadWrite, OUT UINT64 *FuseHandle)
EFI_STATUS VirtioFsFuseForget(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId)
EFI_STATUS VirtioFsFuseDirentPlusToEfiFileInfo(IN VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE *FuseDirent, IN OUT EFI_FILE_INFO *FileInfo)
EFI_STATUS VirtioFsFuseStatFs(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, OUT VIRTIO_FS_FUSE_STATFS_RESPONSE *FilesysAttr)
EFI_STATUS VirtioFsGetFuseModeUpdate(IN EFI_FILE_INFO *Info, IN EFI_FILE_INFO *NewInfo, OUT BOOLEAN *Update, OUT UINT32 *Mode)
VOID EFIAPI VirtioFsExitBoot(IN EFI_EVENT ExitBootEvent, IN VOID *VirtioFsAsVoid)
EFI_STATUS VirtioFsFuseOpenDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, OUT UINT64 *FuseHandle)
VOID VirtioFsGetFuseSizeUpdate(IN EFI_FILE_INFO *Info, IN EFI_FILE_INFO *NewInfo, OUT BOOLEAN *Update, OUT UINT64 *Size)
EFI_STATUS VirtioFsFuseReadFileOrDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 FuseHandle, IN BOOLEAN IsDir, IN UINT64 Offset, IN OUT UINT32 *Size, OUT VOID *Data)
EFI_STATUS VirtioFsGetBasename(IN CHAR8 *Path, OUT CHAR16 *Basename OPTIONAL, IN OUT UINTN *BasenameSize)
EFI_STATUS VirtioFsFuseCheckResponse(IN VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList, IN UINT64 RequestId, OUT UINTN *TailBufferFill)
EFI_STATUS VirtioFsFuseWrite(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 FuseHandle, IN UINT64 Offset, IN OUT UINT32 *Size, IN VOID *Data)
EFI_STATUS VirtioFsFuseInitSession(IN OUT VIRTIO_FS *VirtioFs)
EFI_STATUS EFIAPI VirtioFsOpenVolume(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **Root)
EFI_STATUS VirtioFsFuseFlush(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 FuseHandle)
VOID VirtioFsUninit(IN OUT VIRTIO_FS *VirtioFs)
EFI_STATUS VirtioFsLookupMostSpecificParentDir(IN OUT VIRTIO_FS *VirtioFs, IN OUT CHAR8 *Path, OUT UINT64 *DirNodeId, OUT CHAR8 **LastComponent)
EFI_STATUS VirtioFsFuseSetAttr(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 *Size OPTIONAL, IN UINT64 *Atime OPTIONAL, IN UINT64 *Mtime OPTIONAL, IN UINT32 *Mode OPTIONAL)
EFI_STATUS VirtioFsFuseNewRequest(IN OUT VIRTIO_FS *VirtioFs, OUT VIRTIO_FS_FUSE_REQUEST *Request, IN UINT32 RequestSize, IN VIRTIO_FS_FUSE_OPCODE Opcode, IN UINT64 NodeId)
EFI_STATUS VirtioFsInit(IN OUT VIRTIO_FS *VirtioFs)
EFI_STATUS VirtioFsAppendPath(IN CHAR8 *LhsPath8, IN CHAR16 *RhsPath16, OUT CHAR8 **ResultPath8, OUT BOOLEAN *RootEscape)
EFI_STATUS VirtioFsSgListsSubmit(IN OUT VIRTIO_FS *VirtioFs, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL)
EFI_STATUS VirtioFsFuseReleaseFileOrDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 FuseHandle, IN BOOLEAN IsDir)
EFI_STATUS VirtioFsGetFuseTimeUpdates(IN EFI_FILE_INFO *Info, IN EFI_FILE_INFO *NewInfo, OUT BOOLEAN *UpdateAtime, OUT BOOLEAN *UpdateMtime, OUT UINT64 *Atime, OUT UINT64 *Mtime)
EFI_STATUS VirtioFsFuseAttrToEfiFileInfo(IN VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr, OUT EFI_FILE_INFO *FileInfo)
EFI_STATUS VirtioFsFuseRename(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 OldParentNodeId, IN CHAR8 *OldName, IN UINT64 NewParentNodeId, IN CHAR8 *NewName)
EFI_STATUS VirtioFsErrnoToEfiStatus(IN INT32 Errno)
EFI_STATUS VirtioFsFuseGetAttr(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, OUT VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr)
EFI_STATUS VirtioFsSgListsValidate(IN VIRTIO_FS *VirtioFs, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *RequestSgList, IN OUT VIRTIO_FS_SCATTER_GATHER_LIST *ResponseSgList OPTIONAL)
EFI_STATUS VirtioFsFuseRemoveFileOrDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 ParentNodeId, IN CHAR8 *Name, IN BOOLEAN IsDir)
EFI_STATUS VirtioFsComposeRenameDestination(IN CHAR8 *LhsPath8, IN CHAR16 *RhsPath16, OUT CHAR8 **ResultPath8, OUT BOOLEAN *RootEscape)
EFI_STATUS VirtioFsFuseFsyncFileOrDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, IN UINT64 FuseHandle, IN BOOLEAN IsDir)
EFI_STATUS VirtioFsFuseMkDir(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 ParentNodeId, IN CHAR8 *Name, OUT UINT64 *NodeId)
EFI_STATUS VirtioFsFuseLookup(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 DirNodeId, IN CHAR8 *Name, OUT UINT64 *NodeId, OUT VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr)
EFI_STATUS VirtioFsFuseOpenOrCreate(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 ParentNodeId, IN CHAR8 *Name, OUT UINT64 *NodeId, OUT UINT64 *FuseHandle)