patch-2.2.14 linux/arch/ppc/kernel/irq.c

Next file: linux/arch/ppc/kernel/open_pic.c
Previous file: linux/arch/ppc/kernel/head.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.13/linux/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c
@@ -94,8 +94,8 @@
  * this needs to be removed.
  * -- Cort
  */
-static char cache_bitmask = 0;
-static struct irqaction malloc_cache[8];
+static unsigned long cache_bitmask[1];
+static struct irqaction malloc_cache[32];
 extern int mem_init_done;
 
 void *irq_kmalloc(size_t size, int pri)
@@ -103,10 +103,10 @@
 	unsigned int i;
 	if ( mem_init_done )
 		return kmalloc(size,pri);
-	for ( i = 0; i <= 3 ; i++ )
-		if ( ! ( cache_bitmask & (1<<i) ) )
+	for ( i = 0; i < 32 ; i++ )
+		if ( ! (test_bit(i, (void *)cache_bitmask)) )
 		{
-			cache_bitmask |= (1<<i);
+			set_bit(i,(void *)cache_bitmask);
 			return (void *)(&malloc_cache[i]);
 		}
 	return 0;
@@ -115,10 +115,10 @@
 void irq_kfree(void *ptr)
 {
 	unsigned int i;
-	for ( i = 0 ; i <= 3 ; i++ )
+	for ( i = 0 ; i < 32 ; i++ )
 		if ( ptr == &malloc_cache[i] )
 		{
-			cache_bitmask &= ~(1<<i);
+			clear_bit( i, (void *)cache_bitmask );
 			return;
 		}
 	kfree(ptr);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)