mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
2091ba23e8
commit
3a38d437ca
7 changed files with 60 additions and 34 deletions
12
hw/cs4231a.c
12
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue