patch-2.3.11 linux/include/asm-alpha/softirq.h

Next file: linux/include/asm-alpha/spinlock.h
Previous file: linux/include/asm-alpha/smp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.10/linux/include/asm-alpha/softirq.h linux/include/asm-alpha/softirq.h
@@ -5,28 +5,33 @@
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 
-extern unsigned int local_bh_count[NR_CPUS];
+#ifndef __SMP__
+extern int __local_bh_count;
+#define local_bh_count(cpu)	((void)(cpu), __local_bh_count)
+#else
+#define local_bh_count(cpu)	(cpu_data[cpu].bh_count)
+#endif
 
 extern inline void cpu_bh_disable(int cpu)
 {
-	local_bh_count[cpu]++;
+	local_bh_count(cpu)++;
 	mb();
 }
 
 extern inline void cpu_bh_enable(int cpu)
 {
 	mb();
-	local_bh_count[cpu]--;
+	local_bh_count(cpu)--;
 }
 
 extern inline int cpu_bh_trylock(int cpu)
 {
-	return local_bh_count[cpu] ? 0 : (local_bh_count[cpu] = 1);
+	return local_bh_count(cpu) ? 0 : (local_bh_count(cpu) = 1);
 }
 
 extern inline void cpu_bh_endlock(int cpu)
 {
-	local_bh_count[cpu] = 0;
+	local_bh_count(cpu) = 0;
 }
 
 #define local_bh_enable()	cpu_bh_enable(smp_processor_id())

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