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

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

diff -u --recursive --new-file v2.3.3/linux/include/asm-sparc64/softirq.h linux/include/asm-sparc64/softirq.h
@@ -16,6 +16,9 @@
 #define local_bh_count		(cpu_data[smp_processor_id()].bh_count)
 #endif
 
+#define local_bh_disable()	(local_bh_count++)
+#define local_bh_enable()	(local_bh_count--)
+
 /* The locking mechanism for base handlers, to prevent re-entrancy,
  * is entirely private to an implementation, it should not be
  * referenced at all outside of this file.
@@ -94,7 +97,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 &&
+		    cpu_data[cpu].bh_count == 0) {
 			++(cpu_data[cpu].bh_count);
 			return 1;
 		}

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