fix for arm_gic
PATCH 1/1 fix for arm_gic
Hi,
the priority array of the gic_state structure contains 96 elements but gic_set_running_irq is also called with irq == 1023 so that without the fix some random value is used for s->running_priority.
The printf patch is necessary to make the DPRINTFs work.
Index: arm_gic.c
===================================================================
RCS file: /sources/qemu/qemu/hw/arm_gic.c,v
retrieving revision 1.2
arm_gic.c +2 -2
@@ -17,7 +17,7 @@#ifdef DEBUG_GIC #define DPRINTF(fmt, args...) \ -do { printf("arm_gic: " fmt , (int)s->base, ##args); } while (0) +do { printf("arm_gic(%x): " fmt , (int)s->base, ##args); } while (0)#else #define DPRINTF(fmt, args...) do {} while(0)#endif
@@ -135,7 +135,7 @@static void gic_set_running_irq (gic_state *s,int irq) { s->running_irq = irq; - s->running_priority = s->priority[irq]; + s->running_priority = (irq ==1023 ) ?0x100 : s->priority[irq];gic_update (s); }
Thanks,
Adam
Signature · 2 lines
Adam [email protected] Lackorzynski http://os.inf.tu-dresden.de/~adam/