1 #ifndef __ASM_HARDIRQ_H
2 #define __ASM_HARDIRQ_H
4 /* only non-SMP supported */
6 #include <linux/threads.h>
8 /* entry.S is sensitive to the offsets of these fields */
10 unsigned int __softirq_pending;
11 unsigned int __local_irq_count;
12 unsigned int __local_bh_count;
13 unsigned int __syscall_count;
14 struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
15 } ____cacheline_aligned irq_cpustat_t;
17 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
20 * Are we in an interrupt context? Either doing bottom half
21 * or hardware interrupt processing?
23 #define in_interrupt() ((local_irq_count(smp_processor_id()) + \
24 local_bh_count(smp_processor_id())) != 0)
25 #define in_irq() (local_irq_count(smp_processor_id()) != 0)
27 #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
28 #define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
30 #define irq_enter(cpu) (local_irq_count(cpu)++)
31 #define irq_exit(cpu) (local_irq_count(cpu)--)
33 #define synchronize_irq() barrier()
35 #endif /* __ASM_HARDIRQ_H */