ppc4xx: Mask 'vec' with 0x1f in uic_interrupt() for bit set/clear
authorStefan Roese <sr@denx.de>
Thu, 27 Mar 2008 07:47:26 +0000 (08:47 +0100)
committerStefan Roese <sr@denx.de>
Thu, 27 Mar 2008 08:54:03 +0000 (09:54 +0100)
Signed-off-by: Stefan Roese <sr@denx.de>
cpu/ppc4xx/interrupts.c

index 698bcb57d7ce9ae5ba9929dafb5ecd3c250672ad..8620e2b48476da48b2ad97f905f1ef9cd562f2a7 100644 (file)
@@ -218,15 +218,16 @@ static void uic_interrupt(u32 uic_base, int vec_base)
                        } else {
                                set_dcr(uic_base + UIC_ER,
                                        get_dcr(uic_base + UIC_ER) &
-                                       ~(0x80000000 >> vec));
+                                       ~(0x80000000 >> (vec & 0x1f)));
                                printf("Masking bogus interrupt vector %d"
                                       " (UIC_BASE=0x%x)\n", vec, uic_base);
                        }
 
                        /*
-                        * After servicing the interrupt, we have to remove the status indicator.
+                        * After servicing the interrupt, we have to remove the
+                        * status indicator
                         */
-                       set_dcr(uic_base + UIC_SR, (0x80000000 >> vec));
+                       set_dcr(uic_base + UIC_SR, (0x80000000 >> (vec & 0x1f)));
                }
 
                /*