1 #ifndef _LINUX_IRQ_SIM_H
2 #define _LINUX_IRQ_SIM_H
4 * Copyright (C) 2017 Bartosz Golaszewski <brgl@bgdev.pl>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include <linux/irq_work.h>
13 #include <linux/device.h>
16 * Provides a framework for allocating simulated interrupts which can be
17 * requested like normal irqs and enqueued from process context.
20 struct irq_sim_work_ctx
{
25 struct irq_sim_irq_ctx
{
31 struct irq_sim_work_ctx work_ctx
;
33 unsigned int irq_count
;
34 struct irq_sim_irq_ctx
*irqs
;
37 int irq_sim_init(struct irq_sim
*sim
, unsigned int num_irqs
);
38 int devm_irq_sim_init(struct device
*dev
, struct irq_sim
*sim
,
39 unsigned int num_irqs
);
40 void irq_sim_fini(struct irq_sim
*sim
);
41 void irq_sim_fire(struct irq_sim
*sim
, unsigned int offset
);
42 int irq_sim_irqnum(struct irq_sim
*sim
, unsigned int offset
);
44 #endif /* _LINUX_IRQ_SIM_H */