diff options
author | Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> | 2012-07-31 12:24:06 +1000 |
---|---|---|
committer | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2012-10-10 11:13:32 +1000 |
commit | 1e5b31e6bd4fa8a9c679a18388d2219feece275a (patch) | |
tree | 0e4147af61781320e776c1400ee116e3f5314660 /hw/irq.h | |
parent | 74687e40b0406a0863234ca011c3cba7720864b0 (diff) |
qdev: allow multiple qdev_init_gpio_in() calls
Allow multiple qdev_init_gpio_in() calls for the one device. The first call will
define GPIOs 0-N-1, the next GPIOs N- ... . Allows different GPIOs to be handled
with different handlers. Needed when two levels of the QOM class heirachy both
define GPIO functionality, as a single GPIO handler with an index selecter is
not possible.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/irq.h')
-rw-r--r-- | hw/irq.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -23,8 +23,17 @@ static inline void qemu_irq_pulse(qemu_irq irq) qemu_set_irq(irq, 0); } -/* Returns an array of N IRQs. */ +/* Returns an array of N IRQs. Each IRQ is assigned the argument handler and + * opaque data. + */ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); + +/* Extends an Array of IRQs. Old IRQs have their handlers and opaque data + * preserved. New IRQs are assigned the argument handler and opaque data. + */ +qemu_irq *qemu_extend_irqs(qemu_irq *old, int n_old, qemu_irq_handler handler, + void *opaque, int n); + void qemu_free_irqs(qemu_irq *s); /* Returns a new IRQ with opposite polarity. */ |