From ba91cd80d5a267c3a25770efc4590bf807c56376 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 25 Apr 2004 18:03:53 +0000 Subject: fixed very unlikely irq bug git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@749 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/i8259.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'hw/i8259.c') diff --git a/hw/i8259.c b/hw/i8259.c index adc9cedff0..5d20e04dbb 100644 --- a/hw/i8259.c +++ b/hw/i8259.c @@ -46,8 +46,8 @@ typedef struct PicState { } PicState; /* 0 is master pic, 1 is slave pic */ -PicState pics[2]; -int pic_irq_requested; +static PicState pics[2]; +static int pic_irq_requested; /* set irq level. If an edge is detected, then the IRR is set to 1 */ static inline void pic_set_irq1(PicState *s, int irq, int level) @@ -198,6 +198,7 @@ int cpu_get_pic_interrupt(CPUState *env) intno = pics[0].irq_base + irq; } pic_intack(&pics[0], irq); + pic_update_irq(); return intno; } @@ -408,6 +409,19 @@ static void pic_init1(int io_addr, PicState *s) register_savevm("i8259", io_addr, 1, pic_save, pic_load, s); } +void pic_info(void) +{ + int i; + PicState *s; + + for(i=0;i<2;i++) { + s = &pics[i]; + term_printf("pic%d: irr=%02x imr=%02x isr=%02x hprio=%d irq_base=%02x rr_sel=%d\n", + i, s->irr, s->imr, s->isr, s->priority_add, s->irq_base, s->read_reg_select); + } +} + + void pic_init(void) { pic_init1(0x20, &pics[0]); -- cgit v1.2.3-55-g7522