diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-04-25 18:03:53 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-04-25 18:03:53 +0000 |
commit | ba91cd80d5a267c3a25770efc4590bf807c56376 (patch) | |
tree | de6d37ee48d9bb27b037d5244d92116776280209 /hw/i8259.c | |
parent | 6f1f31c069b20611f8df768bd4cc484a49624d62 (diff) |
fixed very unlikely irq bug
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@749 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/i8259.c')
-rw-r--r-- | hw/i8259.c | 18 |
1 files changed, 16 insertions, 2 deletions
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]); |