diff options
author | Jes Sorensen <jes@sgi.com> | 2009-08-14 11:36:15 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-27 20:30:20 -0500 |
commit | 3a38d437ca60ce19ee92dbabbe6e672e9ba3c529 (patch) | |
tree | 809ea17e551a8e297c5377180cad61e063bb906d /hw/cs4231a.c | |
parent | 2091ba23e838c3a8773c246238d7381333789852 (diff) |
Add isa_reserve_irq().
Introduce isa_reserve_irq() which marks an irq reserved and returns
the appropriate qemu_irq entry from the i8259 table.
isa_reserve_irq() is a temporary interface to be used to allocate ISA
IRQs for devices which have not yet been converted to qdev, and for
special cases which are not suited for qdev conversions, such as the
'ferr'.
This patch goes on top of Gerd Hoffmann's which makes isa-bus.c own
the ISA irq table.
[ added isa-bus.o to some targets to fix build failures -- kraxel ]
Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/cs4231a.c')
-rw-r--r-- | hw/cs4231a.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/cs4231a.c b/hw/cs4231a.c index 5516867ab7..d482e04ac9 100644 --- a/hw/cs4231a.c +++ b/hw/cs4231a.c @@ -60,10 +60,9 @@ static struct { typedef struct CSState { QEMUSoundCard card; - qemu_irq *pic; + qemu_irq pic; uint32_t regs[CS_REGS]; uint8_t dregs[CS_DREGS]; - int irq; int dma; int port; int shift; @@ -483,7 +482,7 @@ IO_WRITE_PROTO (cs_write) case Alternate_Feature_Status: if ((s->dregs[iaddr] & PI) && !(val & PI)) { /* XXX: TI CI */ - qemu_irq_lower (s->pic[s->irq]); + qemu_irq_lower (s->pic); s->regs[Status] &= ~INT; } s->dregs[iaddr] = val; @@ -503,7 +502,7 @@ IO_WRITE_PROTO (cs_write) case Status: if (s->regs[Status] & INT) { - qemu_irq_lower (s->pic[s->irq]); + qemu_irq_lower (s->pic); } s->regs[Status] &= ~INT; s->dregs[Alternate_Feature_Status] &= ~(PI | CI | TI); @@ -588,7 +587,7 @@ static int cs_dma_read (void *opaque, int nchan, int dma_pos, int dma_len) s->regs[Status] |= INT; s->dregs[Alternate_Feature_Status] |= PI; s->transferred = 0; - qemu_irq_raise (s->pic[s->irq]); + qemu_irq_raise (s->pic); } else { s->transferred += written; @@ -643,8 +642,7 @@ int cs4231a_init (qemu_irq *pic) s = qemu_mallocz (sizeof (*s)); - s->pic = pic; - s->irq = conf.irq; + s->pic = isa_reserve_irq(conf.irq); s->dma = conf.dma; s->port = conf.port; |