mirror of https://gitee.com/openkylin/qemu.git
i8259: PREP: Replace pic_intack_read with pic_read_irq
There is nothing in the i8259 spec that justifies the special pic_intack_read. At least the Linux PREP kernels configure the PICs properly so that pic_read_irq returns identical values, and setting read_reg_select in PIC0 cannot be derived from any special i8259 mode. So switch ppc_prep to pic_read_irq and drop the now unused PIC code. CC: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
fc1a5e0a24
commit
6e5580ca2b
39
hw/i8259.c
39
hw/i8259.c
|
@ -361,30 +361,6 @@ static void pic_ioport_write(void *opaque, target_phys_addr_t addr64,
|
|||
}
|
||||
}
|
||||
|
||||
static uint32_t pic_poll_read(PicState *s)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = pic_get_irq(s);
|
||||
if (ret >= 0) {
|
||||
bool slave = (s == &isa_pic->pics[1]);
|
||||
|
||||
if (slave) {
|
||||
s->pics_state->pics[0].isr &= ~(1 << 2);
|
||||
s->pics_state->pics[0].irr &= ~(1 << 2);
|
||||
}
|
||||
s->irr &= ~(1 << ret);
|
||||
s->isr &= ~(1 << ret);
|
||||
if (slave || ret != 2) {
|
||||
pic_update_irq(s);
|
||||
}
|
||||
} else {
|
||||
ret = 0x07;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr,
|
||||
unsigned size)
|
||||
{
|
||||
|
@ -414,21 +390,6 @@ static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* memory mapped interrupt status */
|
||||
/* XXX: may be the same than pic_read_irq() */
|
||||
uint32_t pic_intack_read(PicState2 *s)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = pic_poll_read(&s->pics[0]);
|
||||
if (ret == 2)
|
||||
ret = pic_poll_read(&s->pics[1]) + 8;
|
||||
/* Prepare for ISR read */
|
||||
s->pics[0].read_reg_select = 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int pic_get_output(PicState2 *s)
|
||||
{
|
||||
return (pic_get_irq(&s->pics[0]) >= 0);
|
||||
|
|
1
hw/pc.h
1
hw/pc.h
|
@ -65,7 +65,6 @@ extern PicState2 *isa_pic;
|
|||
qemu_irq *i8259_init(qemu_irq parent_irq);
|
||||
int pic_read_irq(PicState2 *s);
|
||||
int pic_get_output(PicState2 *s);
|
||||
uint32_t pic_intack_read(PicState2 *s);
|
||||
void pic_info(Monitor *mon);
|
||||
void irq_info(Monitor *mon);
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ static inline uint32_t _PPC_intack_read(target_phys_addr_t addr)
|
|||
uint32_t retval = 0;
|
||||
|
||||
if ((addr & 0xf) == 0)
|
||||
retval = pic_intack_read(isa_pic);
|
||||
retval = pic_read_irq(isa_pic);
|
||||
#if 0
|
||||
printf("%s: 0x" TARGET_FMT_plx " <= %08" PRIx32 "\n", __func__, addr,
|
||||
retval);
|
||||
|
|
Loading…
Reference in New Issue