summaryrefslogtreecommitdiffstats
path: root/hw/cs4231a.c
diff options
context:
space:
mode:
authorJes Sorensen2009-08-14 11:36:15 +0200
committerAnthony Liguori2009-08-28 03:30:20 +0200
commit3a38d437ca60ce19ee92dbabbe6e672e9ba3c529 (patch)
tree809ea17e551a8e297c5377180cad61e063bb906d /hw/cs4231a.c
parentisa bus irq changes and fixes. (diff)
downloadqemu-3a38d437ca60ce19ee92dbabbe6e672e9ba3c529.tar.gz
qemu-3a38d437ca60ce19ee92dbabbe6e672e9ba3c529.tar.xz
qemu-3a38d437ca60ce19ee92dbabbe6e672e9ba3c529.zip
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.c12
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;