]> git.ipfire.org Git - thirdparty/qemu.git/blame - include/hw/irq.h
Include hw/irq.h a lot less
[thirdparty/qemu.git] / include / hw / irq.h
CommitLineData
87ecb68b
PB
1#ifndef QEMU_IRQ_H
2#define QEMU_IRQ_H
3
d537cf6c
PB
4/* Generic IRQ/GPIO pin infrastructure. */
5
615c4895
AF
6#define TYPE_IRQ "irq"
7
d537cf6c
PB
8void qemu_set_irq(qemu_irq irq, int level);
9
10static inline void qemu_irq_raise(qemu_irq irq)
11{
12 qemu_set_irq(irq, 1);
13}
14
15static inline void qemu_irq_lower(qemu_irq irq)
16{
17 qemu_set_irq(irq, 0);
18}
19
106627d0
AZ
20static inline void qemu_irq_pulse(qemu_irq irq)
21{
22 qemu_set_irq(irq, 1);
23 qemu_set_irq(irq, 0);
24}
25
1e5b31e6
PC
26/* Returns an array of N IRQs. Each IRQ is assigned the argument handler and
27 * opaque data.
28 */
d537cf6c 29qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
1e5b31e6 30
a8a9d30b
MA
31/*
32 * Allocates a single IRQ. The irq is assigned with a handler, an opaque
33 * data and the interrupt number.
34 */
35qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque, int n);
36
1e5b31e6
PC
37/* Extends an Array of IRQs. Old IRQs have their handlers and opaque data
38 * preserved. New IRQs are assigned the argument handler and opaque data.
39 */
40qemu_irq *qemu_extend_irqs(qemu_irq *old, int n_old, qemu_irq_handler handler,
41 void *opaque, int n);
42
f173d57a 43void qemu_free_irqs(qemu_irq *s, int n);
a8a9d30b 44void qemu_free_irq(qemu_irq irq);
d537cf6c 45
b50a6563
AZ
46/* Returns a new IRQ with opposite polarity. */
47qemu_irq qemu_irq_invert(qemu_irq irq);
87ecb68b 48
5edb1b3f
PM
49/* Returns a new IRQ which feeds into both the passed IRQs.
50 * It's probably better to use the TYPE_SPLIT_IRQ device instead.
51 */
9793212b
PM
52qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2);
53
22ec3283
AK
54/* Returns a new IRQ set which connects 1:1 to another IRQ set, which
55 * may be set later.
56 */
57qemu_irq *qemu_irq_proxy(qemu_irq **target, int n);
58
20288345
PB
59/* For internal use in qtest. Similar to qemu_irq_split, but operating
60 on an existing vector of qemu_irq. */
61void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);
20288345 62
87ecb68b 63#endif