Commit 51bf9e7e1870996ae7f4741530e6134b485de321
1 parent
88715657
qemu: add qemu_free_irqs (Marcelo Tosatti)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6602 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
7 additions
and
0 deletions
hw/irq.c
@@ -56,6 +56,12 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) | @@ -56,6 +56,12 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) | ||
56 | return s; | 56 | return s; |
57 | } | 57 | } |
58 | 58 | ||
59 | +void qemu_free_irqs(qemu_irq *s) | ||
60 | +{ | ||
61 | + qemu_free(s[0]); | ||
62 | + qemu_free(s); | ||
63 | +} | ||
64 | + | ||
59 | static void qemu_notirq(void *opaque, int line, int level) | 65 | static void qemu_notirq(void *opaque, int line, int level) |
60 | { | 66 | { |
61 | struct IRQState *irq = opaque; | 67 | struct IRQState *irq = opaque; |
hw/irq.h
@@ -27,6 +27,7 @@ static inline void qemu_irq_pulse(qemu_irq irq) | @@ -27,6 +27,7 @@ static inline void qemu_irq_pulse(qemu_irq irq) | ||
27 | 27 | ||
28 | /* Returns an array of N IRQs. */ | 28 | /* Returns an array of N IRQs. */ |
29 | qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); | 29 | qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); |
30 | +void qemu_free_irqs(qemu_irq *s); | ||
30 | 31 | ||
31 | /* Returns a new IRQ with opposite polarity. */ | 32 | /* Returns a new IRQ with opposite polarity. */ |
32 | qemu_irq qemu_irq_invert(qemu_irq irq); | 33 | qemu_irq qemu_irq_invert(qemu_irq irq); |