~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/irqbypass.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * IRQ offload/bypass manager
  4  *
  5  * Copyright (C) 2015 Red Hat, Inc.
  6  * Copyright (c) 2015 Linaro Ltd.
  7  */
  8 #ifndef IRQBYPASS_H
  9 #define IRQBYPASS_H
 10 
 11 #include <linux/list.h>
 12 
 13 struct irq_bypass_consumer;
 14 
 15 /*
 16  * Theory of operation
 17  *
 18  * The IRQ bypass manager is a simple set of lists and callbacks that allows
 19  * IRQ producers (ex. physical interrupt sources) to be matched to IRQ
 20  * consumers (ex. virtualization hardware that allows IRQ bypass or offload)
 21  * via a shared token (ex. eventfd_ctx).  Producers and consumers register
 22  * independently.  When a token match is found, the optional @stop callback
 23  * will be called for each participant.  The pair will then be connected via
 24  * the @add_* callbacks, and finally the optional @start callback will allow
 25  * any final coordination.  When either participant is unregistered, the
 26  * process is repeated using the @del_* callbacks in place of the @add_*
 27  * callbacks.  Match tokens must be unique per producer/consumer, 1:N pairings
 28  * are not supported.
 29  */
 30 
 31 /**
 32  * struct irq_bypass_producer - IRQ bypass producer definition
 33  * @node: IRQ bypass manager private list management
 34  * @token: opaque token to match between producer and consumer (non-NULL)
 35  * @irq: Linux IRQ number for the producer device
 36  * @add_consumer: Connect the IRQ producer to an IRQ consumer (optional)
 37  * @del_consumer: Disconnect the IRQ producer from an IRQ consumer (optional)
 38  * @stop: Perform any quiesce operations necessary prior to add/del (optional)
 39  * @start: Perform any startup operations necessary after add/del (optional)
 40  *
 41  * The IRQ bypass producer structure represents an interrupt source for
 42  * participation in possible host bypass, for instance an interrupt vector
 43  * for a physical device assigned to a VM.
 44  */
 45 struct irq_bypass_producer {
 46         struct list_head node;
 47         void *token;
 48         int irq;
 49         int (*add_consumer)(struct irq_bypass_producer *,
 50                             struct irq_bypass_consumer *);
 51         void (*del_consumer)(struct irq_bypass_producer *,
 52                              struct irq_bypass_consumer *);
 53         void (*stop)(struct irq_bypass_producer *);
 54         void (*start)(struct irq_bypass_producer *);
 55 };
 56 
 57 /**
 58  * struct irq_bypass_consumer - IRQ bypass consumer definition
 59  * @node: IRQ bypass manager private list management
 60  * @token: opaque token to match between producer and consumer (non-NULL)
 61  * @add_producer: Connect the IRQ consumer to an IRQ producer
 62  * @del_producer: Disconnect the IRQ consumer from an IRQ producer
 63  * @stop: Perform any quiesce operations necessary prior to add/del (optional)
 64  * @start: Perform any startup operations necessary after add/del (optional)
 65  *
 66  * The IRQ bypass consumer structure represents an interrupt sink for
 67  * participation in possible host bypass, for instance a hypervisor may
 68  * support offloads to allow bypassing the host entirely or offload
 69  * portions of the interrupt handling to the VM.
 70  */
 71 struct irq_bypass_consumer {
 72         struct list_head node;
 73         void *token;
 74         int (*add_producer)(struct irq_bypass_consumer *,
 75                             struct irq_bypass_producer *);
 76         void (*del_producer)(struct irq_bypass_consumer *,
 77                              struct irq_bypass_producer *);
 78         void (*stop)(struct irq_bypass_consumer *);
 79         void (*start)(struct irq_bypass_consumer *);
 80 };
 81 
 82 int irq_bypass_register_producer(struct irq_bypass_producer *);
 83 void irq_bypass_unregister_producer(struct irq_bypass_producer *);
 84 int irq_bypass_register_consumer(struct irq_bypass_consumer *);
 85 void irq_bypass_unregister_consumer(struct irq_bypass_consumer *);
 86 
 87 #endif /* IRQBYPASS_H */
 88 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php