patch-2.1.30 linux/include/asm-i386/softirq.h

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

diff -u --recursive --new-file v2.1.29/linux/include/asm-i386/softirq.h linux/include/asm-i386/softirq.h
@@ -0,0 +1,34 @@
+#ifndef __ASM_SOFTIRQ_H
+#define __ASM_SOFTIRQ_H
+
+/*
+ * Software interrupts..
+ */
+#define get_active_bhs()	(bh_mask & bh_active)
+#define clear_active_bhs(x)	atomic_clear_mask((x),&bh_active)
+
+#ifdef __SMP__
+
+/* These are for the irq's testing the lock */
+static inline int softirq_trylock(void)
+{
+	atomic_inc(&intr_count);
+	if (intr_count != 1) {
+		atomic_dec(&intr_count);
+		return 0;
+	}
+	return 1;
+}
+
+#define softirq_endlock()	atomic_dec(&intr_count)
+
+#else
+
+/* These are for the irq's testing the lock */
+#define softirq_trylock()	(intr_count ? 0 : ((intr_count=1),1))
+#define softirq_endlock()	(intr_count = 0)
+
+
+#endif
+
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov