1 #ifndef LINUX_HARDIRQ_H
2 #define LINUX_HARDIRQ_H
4 #include <linux/preempt_mask.h>
5 #include <linux/lockdep.h>
6 #include <linux/ftrace_irq.h>
7 #include <linux/vtime.h>
10 extern void synchronize_irq(unsigned int irq);
12 #if defined(CONFIG_TINY_RCU)
14 static inline void rcu_nmi_enter(void)
18 static inline void rcu_nmi_exit(void)
23 extern void rcu_nmi_enter(void);
24 extern void rcu_nmi_exit(void);
28 * It is safe to do non-atomic ops on ->hardirq_context,
29 * because NMI handlers may not preempt and the ops are
30 * always balanced, so the interrupted value of ->hardirq_context
31 * will always be restored.
33 #define __irq_enter() \
35 account_irq_enter_time(current); \
36 preempt_count_add(HARDIRQ_OFFSET); \
37 trace_hardirq_enter(); \
41 * Enter irq context (on NO_HZ, update jiffies):
43 extern void irq_enter(void);
46 * Exit irq context without processing softirqs:
48 #define __irq_exit() \
50 trace_hardirq_exit(); \
51 account_irq_exit_time(current); \
52 preempt_count_sub(HARDIRQ_OFFSET); \
56 * Exit irq context and process softirqs if needed:
58 extern void irq_exit(void);
65 preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
67 trace_hardirq_enter(); \
72 trace_hardirq_exit(); \
75 preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \
80 #endif /* LINUX_HARDIRQ_H */