include/uapi/linux/vduse.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/vduse.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/vduse.h- Extension
.h- Size
- 11987 bytes
- Lines
- 429
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct vduse_dev_configstruct vduse_iotlb_entrystruct vduse_config_datastruct vduse_vq_configstruct vduse_vq_state_splitstruct vduse_vq_state_packedstruct vduse_vq_group_asidstruct vduse_vq_infostruct vduse_vq_eventfdstruct vduse_iova_umemstruct vduse_iova_infostruct vduse_iotlb_entry_v2struct vduse_vq_statestruct vduse_dev_statusstruct vduse_iova_rangestruct vduse_iova_range_v2struct vduse_dev_requeststruct vduse_dev_responseenum vduse_req_type
Annotated Snippet
struct vduse_dev_config {
#define VDUSE_NAME_MAX 256
char name[VDUSE_NAME_MAX];
__u32 vendor_id;
__u32 device_id;
__u64 features;
__u32 vq_num;
__u32 vq_align;
__u32 ngroups; /* if VDUSE_API_VERSION >= 1 */
__u32 nas; /* if VDUSE_API_VERSION >= 1 */
__u32 reserved[11];
__u32 config_size;
__u8 config[];
};
/* Create a VDUSE device which is represented by a char device (/dev/vduse/$NAME) */
#define VDUSE_CREATE_DEV _IOW(VDUSE_BASE, 0x02, struct vduse_dev_config)
/*
* Destroy a VDUSE device. Make sure there are no more references
* to the char device (/dev/vduse/$NAME).
*/
#define VDUSE_DESTROY_DEV _IOW(VDUSE_BASE, 0x03, char[VDUSE_NAME_MAX])
/* The ioctls for VDUSE device (/dev/vduse/$NAME) */
/**
* struct vduse_iotlb_entry - entry of IOTLB to describe one IOVA region [start, last]
* @offset: the mmap offset on returned file descriptor
* @start: start of the IOVA region
* @last: last of the IOVA region
* @perm: access permission of the IOVA region
*
* Structure used by VDUSE_IOTLB_GET_FD ioctl to find an overlapped IOVA region.
*/
struct vduse_iotlb_entry {
__u64 offset;
__u64 start;
__u64 last;
#define VDUSE_ACCESS_RO 0x1
#define VDUSE_ACCESS_WO 0x2
#define VDUSE_ACCESS_RW 0x3
__u8 perm;
};
/*
* Find the first IOVA region that overlaps with the range [start, last]
* and return the corresponding file descriptor. Return -EINVAL means the
* IOVA region doesn't exist. Caller should set start and last fields.
*/
#define VDUSE_IOTLB_GET_FD _IOWR(VDUSE_BASE, 0x10, struct vduse_iotlb_entry)
/*
* Get the negotiated virtio features. It's a subset of the features in
* struct vduse_dev_config which can be accepted by virtio driver. It's
* only valid after FEATURES_OK status bit is set.
*/
#define VDUSE_DEV_GET_FEATURES _IOR(VDUSE_BASE, 0x11, __u64)
/**
* struct vduse_config_data - data used to update configuration space
* @offset: the offset from the beginning of configuration space
* @length: the length to write to configuration space
* @buffer: the buffer used to write from
*
* Structure used by VDUSE_DEV_SET_CONFIG ioctl to update device
* configuration space.
*/
struct vduse_config_data {
__u32 offset;
__u32 length;
__u8 buffer[];
};
/* Set device configuration space */
#define VDUSE_DEV_SET_CONFIG _IOW(VDUSE_BASE, 0x12, struct vduse_config_data)
/*
* Inject a config interrupt. It's usually used to notify virtio driver
* that device configuration space has changed.
*/
#define VDUSE_DEV_INJECT_CONFIG_IRQ _IO(VDUSE_BASE, 0x13)
/**
* struct vduse_vq_config - basic configuration of a virtqueue
* @index: virtqueue index
* @max_size: the max size of virtqueue
* @reserved1: for future use, needs to be initialized to zero
* @group: virtqueue group
* @reserved2: for future use, needs to be initialized to zero
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct vduse_dev_config`, `struct vduse_iotlb_entry`, `struct vduse_config_data`, `struct vduse_vq_config`, `struct vduse_vq_state_split`, `struct vduse_vq_state_packed`, `struct vduse_vq_group_asid`, `struct vduse_vq_info`, `struct vduse_vq_eventfd`, `struct vduse_iova_umem`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.