Commit ba91cd80d5a267c3a25770efc4590bf807c56376
1 parent
6f1f31c0
fixed very unlikely irq bug
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@749 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
16 additions
and
2 deletions
hw/i8259.c
@@ -46,8 +46,8 @@ typedef struct PicState { | @@ -46,8 +46,8 @@ typedef struct PicState { | ||
46 | } PicState; | 46 | } PicState; |
47 | 47 | ||
48 | /* 0 is master pic, 1 is slave pic */ | 48 | /* 0 is master pic, 1 is slave pic */ |
49 | -PicState pics[2]; | ||
50 | -int pic_irq_requested; | 49 | +static PicState pics[2]; |
50 | +static int pic_irq_requested; | ||
51 | 51 | ||
52 | /* set irq level. If an edge is detected, then the IRR is set to 1 */ | 52 | /* set irq level. If an edge is detected, then the IRR is set to 1 */ |
53 | static inline void pic_set_irq1(PicState *s, int irq, int level) | 53 | static inline void pic_set_irq1(PicState *s, int irq, int level) |
@@ -198,6 +198,7 @@ int cpu_get_pic_interrupt(CPUState *env) | @@ -198,6 +198,7 @@ int cpu_get_pic_interrupt(CPUState *env) | ||
198 | intno = pics[0].irq_base + irq; | 198 | intno = pics[0].irq_base + irq; |
199 | } | 199 | } |
200 | pic_intack(&pics[0], irq); | 200 | pic_intack(&pics[0], irq); |
201 | + pic_update_irq(); | ||
201 | return intno; | 202 | return intno; |
202 | } | 203 | } |
203 | 204 | ||
@@ -408,6 +409,19 @@ static void pic_init1(int io_addr, PicState *s) | @@ -408,6 +409,19 @@ static void pic_init1(int io_addr, PicState *s) | ||
408 | register_savevm("i8259", io_addr, 1, pic_save, pic_load, s); | 409 | register_savevm("i8259", io_addr, 1, pic_save, pic_load, s); |
409 | } | 410 | } |
410 | 411 | ||
412 | +void pic_info(void) | ||
413 | +{ | ||
414 | + int i; | ||
415 | + PicState *s; | ||
416 | + | ||
417 | + for(i=0;i<2;i++) { | ||
418 | + s = &pics[i]; | ||
419 | + term_printf("pic%d: irr=%02x imr=%02x isr=%02x hprio=%d irq_base=%02x rr_sel=%d\n", | ||
420 | + i, s->irr, s->imr, s->isr, s->priority_add, s->irq_base, s->read_reg_select); | ||
421 | + } | ||
422 | +} | ||
423 | + | ||
424 | + | ||
411 | void pic_init(void) | 425 | void pic_init(void) |
412 | { | 426 | { |
413 | pic_init1(0x20, &pics[0]); | 427 | pic_init1(0x20, &pics[0]); |