TianoCore EDK2 master
Loading...
Searching...
No Matches
VirtioFs.h File Reference

Go to the source code of this file.

Data Structures

struct  VIRTIO_FS_CONFIG
 
struct  VIRTIO_FS_FUSE_REQUEST
 
struct  VIRTIO_FS_FUSE_RESPONSE
 
struct  VIRTIO_FS_FUSE_NODE_RESPONSE
 
struct  VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE
 
struct  VIRTIO_FS_FUSE_FORGET_REQUEST
 
struct  VIRTIO_FS_FUSE_GETATTR_REQUEST
 
struct  VIRTIO_FS_FUSE_GETATTR_RESPONSE
 
struct  VIRTIO_FS_FUSE_SETATTR_REQUEST
 
struct  VIRTIO_FS_FUSE_MKDIR_REQUEST
 
struct  VIRTIO_FS_FUSE_OPEN_REQUEST
 
struct  VIRTIO_FS_FUSE_OPEN_RESPONSE
 
struct  VIRTIO_FS_FUSE_READ_REQUEST
 
struct  VIRTIO_FS_FUSE_WRITE_REQUEST
 
struct  VIRTIO_FS_FUSE_WRITE_RESPONSE
 
struct  VIRTIO_FS_FUSE_STATFS_RESPONSE
 
struct  VIRTIO_FS_FUSE_RELEASE_REQUEST
 
struct  VIRTIO_FS_FUSE_FSYNC_REQUEST
 
struct  VIRTIO_FS_FUSE_FLUSH_REQUEST
 
struct  VIRTIO_FS_FUSE_INIT_REQUEST
 
struct  VIRTIO_FS_FUSE_INIT_RESPONSE
 
struct  VIRTIO_FS_FUSE_CREATE_REQUEST
 
struct  VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE
 
struct  VIRTIO_FS_FUSE_RENAME2_REQUEST
 

Macros

#define VIRTIO_FS_REQUEST_QUEUE   1
 
#define VIRTIO_FS_TAG_BYTES   36
 
#define VIRTIO_FS_FUSE_MAJOR   7
 
#define VIRTIO_FS_FUSE_MINOR   31
 
#define VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID   1
 
#define VIRTIO_FS_FUSE_ERRNO_ENOENT   (-2)
 
#define VIRTIO_FS_FUSE_MODE_TYPE_MASK   0170000u
 
#define VIRTIO_FS_FUSE_MODE_TYPE_REG   0100000u
 
#define VIRTIO_FS_FUSE_MODE_TYPE_DIR   0040000u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXU   0000700u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RUSR   0000400u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WUSR   0000200u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XUSR   0000100u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXG   0000070u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RGRP   0000040u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WGRP   0000020u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XGRP   0000010u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXO   0000007u
 
#define VIRTIO_FS_FUSE_MODE_PERM_ROTH   0000004u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WOTH   0000002u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XOTH   0000001u
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MODE   BIT0
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_SIZE   BIT3
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_ATIME   BIT4
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MTIME   BIT5
 
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY   0
 
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR   2
 
#define VIRTIO_FS_FUSE_INIT_REQ_F_DO_READDIRPLUS   BIT13
 
#define VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE_SIZE(Namelen)
 
#define VIRTIO_FS_FUSE_RENAME2_REQ_F_NOREPLACE   BIT0
 

Enumerations

enum  VIRTIO_FS_FUSE_OPCODE {
  VirtioFsFuseOpLookup = 1 , VirtioFsFuseOpForget = 2 , VirtioFsFuseOpGetAttr = 3 , VirtioFsFuseOpSetAttr = 4 ,
  VirtioFsFuseOpMkDir = 9 , VirtioFsFuseOpUnlink = 10 , VirtioFsFuseOpRmDir = 11 , VirtioFsFuseOpOpen = 14 ,
  VirtioFsFuseOpRead = 15 , VirtioFsFuseOpWrite = 16 , VirtioFsFuseOpStatFs = 17 , VirtioFsFuseOpRelease = 18 ,
  VirtioFsFuseOpFsync = 20 , VirtioFsFuseOpFlush = 25 , VirtioFsFuseOpInit = 26 , VirtioFsFuseOpOpenDir = 27 ,
  VirtioFsFuseOpReleaseDir = 29 , VirtioFsFuseOpFsyncDir = 30 , VirtioFsFuseOpCreate = 35 , VirtioFsFuseOpReadDirPlus = 44 ,
  VirtioFsFuseOpRename2 = 45
}
 

Detailed Description

Type and macro definitions specific to the Virtio Filesystem device.

At the time of this writing, the latest released Virtio specification (v1.1) does not include the virtio-fs device. The development version of the specification defines it however; see the latest version at https://github.com/oasis-tcs/virtio-spec/blob/87fa6b5d8155/virtio-fs.tex.

This header file is minimal, and only defines the types and macros that are necessary for the OvmfPkg implementation.

Copyright (C) 2020, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file VirtioFs.h.

Macro Definition Documentation

◆ VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE_SIZE

#define VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE_SIZE (   Namelen)
Value:
((Namelen) == 0 || (Namelen) > SIZE_4KB ? \
(UINTN)0 : \
sizeof (VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE) + (UINTN)(Namelen), \
sizeof (UINT64) \
) \
)
UINT64 UINTN
#define ALIGN_VALUE(Value, Alignment)
Definition: Base.h:948

Macro for calculating the size of a directory stream entry.

The macro may evaluate Namelen multiple times.

The macro evaluates to a UINTN value that is safe to cast to UINT32.

Parameters
[in]NamelenThe size of the filename byte array that follows VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE in the directory stream, as reported by VIRTIO_FS_FUSE_STATFS_RESPONSE.Namelen or VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE.Namelen. The filename byte array is not NUL-terminated.
Return values
0Namelen was zero or greater than SIZE_4KB.
Returns
The number of bytes in the directory entry, including the VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE header.

Definition at line 147 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_ERRNO_ENOENT

#define VIRTIO_FS_FUSE_ERRNO_ENOENT   (-2)

Definition at line 87 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_INIT_REQ_F_DO_READDIRPLUS

#define VIRTIO_FS_FUSE_INIT_REQ_F_DO_READDIRPLUS   BIT13

Definition at line 126 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MAJOR

#define VIRTIO_FS_FUSE_MAJOR   7

Definition at line 76 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MINOR

#define VIRTIO_FS_FUSE_MINOR   31

Definition at line 77 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_RGRP

#define VIRTIO_FS_FUSE_MODE_PERM_RGRP   0000040u

Definition at line 100 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_ROTH

#define VIRTIO_FS_FUSE_MODE_PERM_ROTH   0000004u

Definition at line 104 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_RUSR

#define VIRTIO_FS_FUSE_MODE_PERM_RUSR   0000400u

Definition at line 96 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_RWXG

#define VIRTIO_FS_FUSE_MODE_PERM_RWXG   0000070u

Definition at line 99 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_RWXO

#define VIRTIO_FS_FUSE_MODE_PERM_RWXO   0000007u

Definition at line 103 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_RWXU

#define VIRTIO_FS_FUSE_MODE_PERM_RWXU   0000700u

Definition at line 95 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_WGRP

#define VIRTIO_FS_FUSE_MODE_PERM_WGRP   0000020u

Definition at line 101 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_WOTH

#define VIRTIO_FS_FUSE_MODE_PERM_WOTH   0000002u

Definition at line 105 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_WUSR

#define VIRTIO_FS_FUSE_MODE_PERM_WUSR   0000200u

Definition at line 97 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_XGRP

#define VIRTIO_FS_FUSE_MODE_PERM_XGRP   0000010u

Definition at line 102 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_XOTH

#define VIRTIO_FS_FUSE_MODE_PERM_XOTH   0000001u

Definition at line 106 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_PERM_XUSR

#define VIRTIO_FS_FUSE_MODE_PERM_XUSR   0000100u

Definition at line 98 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_TYPE_DIR

#define VIRTIO_FS_FUSE_MODE_TYPE_DIR   0040000u

Definition at line 94 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_TYPE_MASK

#define VIRTIO_FS_FUSE_MODE_TYPE_MASK   0170000u

Definition at line 92 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_MODE_TYPE_REG

#define VIRTIO_FS_FUSE_MODE_TYPE_REG   0100000u

Definition at line 93 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY

#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY   0

Definition at line 120 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR

#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR   2

Definition at line 121 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_RENAME2_REQ_F_NOREPLACE

#define VIRTIO_FS_FUSE_RENAME2_REQ_F_NOREPLACE   BIT0

Definition at line 159 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID

#define VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID   1

Definition at line 82 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_SETATTR_REQ_F_ATIME

#define VIRTIO_FS_FUSE_SETATTR_REQ_F_ATIME   BIT4

Definition at line 114 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_SETATTR_REQ_F_MODE

#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MODE   BIT0

Definition at line 112 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_SETATTR_REQ_F_MTIME

#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MTIME   BIT5

Definition at line 115 of file VirtioFs.h.

◆ VIRTIO_FS_FUSE_SETATTR_REQ_F_SIZE

#define VIRTIO_FS_FUSE_SETATTR_REQ_F_SIZE   BIT3

Definition at line 113 of file VirtioFs.h.

◆ VIRTIO_FS_REQUEST_QUEUE

#define VIRTIO_FS_REQUEST_QUEUE   1

Definition at line 25 of file VirtioFs.h.

◆ VIRTIO_FS_TAG_BYTES

#define VIRTIO_FS_TAG_BYTES   36

Definition at line 30 of file VirtioFs.h.

Enumeration Type Documentation

◆ VIRTIO_FS_FUSE_OPCODE

enum VIRTIO_FS_FUSE_OPCODE

Definition at line 164 of file VirtioFs.h.