From 116674acc97ba75a720329996877077d988443a2 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 9 Mar 2001 20:33:35 +0000 Subject: Merge with Linux 2.4.2. --- include/asm-cris/hardirq.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/asm-cris/hardirq.h (limited to 'include/asm-cris/hardirq.h') diff --git a/include/asm-cris/hardirq.h b/include/asm-cris/hardirq.h new file mode 100644 index 000000000..f5d717416 --- /dev/null +++ b/include/asm-cris/hardirq.h @@ -0,0 +1,35 @@ +#ifndef __ASM_HARDIRQ_H +#define __ASM_HARDIRQ_H + +/* only non-SMP supported */ + +#include + +/* entry.S is sensitive to the offsets of these fields */ +typedef struct { + unsigned int __softirq_active; + unsigned int __softirq_mask; + unsigned int __local_irq_count; + unsigned int __local_bh_count; + unsigned int __syscall_count; +} ____cacheline_aligned irq_cpustat_t; + +#include /* Standard mappings for irq_cpustat_t above */ + +/* + * Are we in an interrupt context? Either doing bottom half + * or hardware interrupt processing? + */ +#define in_interrupt() ((local_irq_count(smp_processor_id()) + \ + local_bh_count(smp_processor_id())) != 0) +#define in_irq() (local_irq_count(smp_processor_id()) != 0) + +#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0) +#define hardirq_endlock(cpu) do { (void)(cpu); } while (0) + +#define irq_enter(cpu) (local_irq_count(cpu)++) +#define irq_exit(cpu) (local_irq_count(cpu)--) + +#define synchronize_irq() barrier() + +#endif /* __ASM_HARDIRQ_H */ -- cgit v1.2.3