File: /usr/src/linux/include/asm-cris/hardirq.h
1 #ifndef __ASM_HARDIRQ_H
2 #define __ASM_HARDIRQ_H
3
4 /* only non-SMP supported */
5
6 #include <linux/threads.h>
7
8 /* entry.S is sensitive to the offsets of these fields */
9 typedef struct {
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;
16
17 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
18
19 /*
20 * Are we in an interrupt context? Either doing bottom half
21 * or hardware interrupt processing?
22 */
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)
26
27 #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
28 #define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
29
30 #define irq_enter(cpu) (local_irq_count(cpu)++)
31 #define irq_exit(cpu) (local_irq_count(cpu)--)
32
33 #define synchronize_irq() barrier()
34
35 #endif /* __ASM_HARDIRQ_H */
36