root / hw / irq.h @ 4487fd34
History | View | Annotate | Download (766 Bytes)
1 |
#ifndef QEMU_IRQ_H
|
---|---|
2 |
#define QEMU_IRQ_H
|
3 |
|
4 |
/* Generic IRQ/GPIO pin infrastructure. */
|
5 |
|
6 |
/* FIXME: Rmove one of these. */
|
7 |
typedef void (*qemu_irq_handler)(void *opaque, int n, int level); |
8 |
typedef void SetIRQFunc(void *opaque, int irq_num, int level); |
9 |
|
10 |
void qemu_set_irq(qemu_irq irq, int level); |
11 |
|
12 |
static inline void qemu_irq_raise(qemu_irq irq) |
13 |
{ |
14 |
qemu_set_irq(irq, 1);
|
15 |
} |
16 |
|
17 |
static inline void qemu_irq_lower(qemu_irq irq) |
18 |
{ |
19 |
qemu_set_irq(irq, 0);
|
20 |
} |
21 |
|
22 |
static inline void qemu_irq_pulse(qemu_irq irq) |
23 |
{ |
24 |
qemu_set_irq(irq, 1);
|
25 |
qemu_set_irq(irq, 0);
|
26 |
} |
27 |
|
28 |
/* Returns an array of N IRQs. */
|
29 |
qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); |
30 |
|
31 |
/* Returns a new IRQ with opposite polarity. */
|
32 |
qemu_irq qemu_irq_invert(qemu_irq irq); |
33 |
|
34 |
#endif
|