1 #ifndef __ASM_HARDIRQ_H
2 #define __ASM_HARDIRQ_H
4 #include <linux/config.h>
5 #include <linux/threads.h>
7 extern unsigned int local_irq_count
[NR_CPUS
];
8 extern unsigned int local_bh_count
[NR_CPUS
];
10 #define local_irq_count(cpu) (local_irq_count[(cpu)])
11 #define local_bh_count(cpu) (local_bh_count[(cpu)])
14 * Are we in an interrupt context? Either doing bottom half
15 * or hardware interrupt processing?
17 #define in_interrupt() ({ const int __cpu = smp_processor_id(); \
18 (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
20 #define in_irq() (local_irq_count(smp_processor_id()) != 0)
24 #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
25 #define hardirq_endlock(cpu) do { } while (0)
27 #define irq_enter(cpu,irq) (local_irq_count(cpu)++)
28 #define irq_exit(cpu,irq) (local_irq_count(cpu)--)
30 #define synchronize_irq() do { } while (0)
33 #error SMP not supported
34 #endif /* CONFIG_SMP */
36 #endif /* __ASM_HARDIRQ_H */