Struct vfio_bindings::bindings::vfio::vfio_irq_set[][src]

#[repr(C)]
pub struct vfio_irq_set { pub argsz: __u32, pub flags: __u32, pub index: __u32, pub start: __u32, pub count: __u32, pub data: __IncompleteArrayField<__u8>, }
Expand description

VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)

Set signaling, masking, and unmasking of interrupts. Caller provides struct vfio_irq_set with all fields set. ‘start’ and ‘count’ indicate the range of subindexes being specified.

The DATA flags specify the type of data provided. If DATA_NONE, the operation performs the specified action immediately on the specified interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]: flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.

DATA_BOOL allows sparse support for the same on arrays of interrupts. For example, to mask interrupts [0,1] and [0,3] (but not [0,2]): flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3, data = {1,0,1}

DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd. A value of -1 can be used to either de-assign interrupts if already assigned or skip un-assigned interrupts. For example, to set an eventfd to be trigger for interrupts [0,0] and [0,2]: flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3, data = {fd1, -1, fd2} If index [0,1] is previously set, two count = 1 ioctls calls would be required to set [0,0] and [0,2] without changing [0,1].

Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER to perform kernel level interrupt loopback testing from userspace (ie. simulate hardware triggering).

Setting of an event triggering mechanism to userspace for ACTION_TRIGGER enables the interrupt index for the device. Individual subindex interrupts can be disabled using the -1 value for DATA_EVENTFD or the index can be disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.

Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while ACTION_TRIGGER specifies kernel->user signaling.

Fields

argsz: __u32flags: __u32index: __u32start: __u32count: __u32data: __IncompleteArrayField<__u8>

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.