patch-2.3.4 linux/include/asm-sparc/softirq.h

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

diff -u --recursive --new-file v2.3.3/linux/include/asm-sparc/softirq.h linux/include/asm-sparc/softirq.h
@@ -103,7 +103,8 @@
 static inline int softirq_trylock(int cpu)
 {
 	if (spin_trylock(&global_bh_count)) {
-		if (atomic_read(&global_bh_lock) == 0) {
+		if (atomic_read(&global_bh_lock) == 0 &&
+		    local_bh_count[cpu] == 0) {
 			++local_bh_count[cpu];
 			return 1;
 		}
@@ -118,6 +119,9 @@
 	spin_unlock(&global_bh_count);
 }
 
+#define local_bh_disable()	(local_bh_count[smp_processor_id()]++)
+#define local_bh_enable()	(local_bh_count[smp_processor_id()]--)
+
 #else
 extern unsigned int local_bh_count;
 
@@ -128,6 +132,9 @@
 #define softirq_trylock(cpu)	(local_bh_count ? 0 : (local_bh_count=1))
 #define softirq_endlock(cpu)	(local_bh_count = 0)
 #define synchronize_bh()	barrier()
+
+#define local_bh_disable()	(local_bh_count++)
+#define local_bh_enable()	(local_bh_count--)
 
 /*
  * These use a mask count to correctly handle

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