patch-2.3.99-pre6 linux/include/asm-sh/hardirq.h
Next file: linux/include/asm-sh/ptrace.h
Previous file: linux/include/asm-sh/elf.h
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Tue Apr 25 16:53:13 2000
- Orig file:
v2.3.99-pre5/linux/include/asm-sh/hardirq.h
- Orig date:
Tue Mar 7 14:32:26 2000
diff -u --recursive --new-file v2.3.99-pre5/linux/include/asm-sh/hardirq.h linux/include/asm-sh/hardirq.h
@@ -1,14 +1,22 @@
#ifndef __ASM_SH_HARDIRQ_H
#define __ASM_SH_HARDIRQ_H
+#include <linux/config.h>
#include <linux/threads.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
+extern unsigned int local_bh_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); })
#define in_irq() (local_irq_count[smp_processor_id()] != 0)
-#ifndef __SMP__
+#ifndef CONFIG_SMP
#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
#define hardirq_endlock(cpu) do { } while (0)
@@ -22,5 +30,5 @@
#error Super-H SMP is not available
-#endif /* __SMP__ */
+#endif /* CONFIG_SMP */
#endif /* __ASM_SH_HARDIRQ_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)