patch-2.1.126 linux/include/asm-mips/hardirq.h

Next file: linux/include/asm-mips/ioctls.h
Previous file: linux/include/asm-mips/gdb-stub.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/include/asm-mips/hardirq.h linux/include/asm-mips/hardirq.h
@@ -1,3 +1,11 @@
+/* $Id: hardirq.h,v 1.5 1998/08/29 21:20:21 ralf Exp $
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1997, 1998 by Ralf Baechle
+ */
 #ifndef __ASM_MIPS_HARDIRQ_H
 #define __ASM_MIPS_HARDIRQ_H
 
@@ -5,6 +13,13 @@
 
 extern unsigned int local_irq_count[NR_CPUS];
 
+/*
+ * Are we in an interrupt context? Either doing bottom half
+ * or hardware interrupt processing?
+ */
+#define in_interrupt() ({ int __cpu = smp_processor_id(); \
+	(local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
+
 #ifndef __SMP__
 
 #define hardirq_trylock(cpu)	(local_irq_count[cpu] == 0)
@@ -13,7 +28,7 @@
 #define hardirq_enter(cpu)	(local_irq_count[cpu]++)
 #define hardirq_exit(cpu)	(local_irq_count[cpu]--)
 
-#define synchronize_irq()	do { } while (0)
+#define synchronize_irq()	barrier();
 
 #else
 

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