]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/hardirq.h
Merge tag 'fbdev-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux
[mirror_ubuntu-bionic-kernel.git] / include / linux / hardirq.h
CommitLineData
1da177e4
LT
1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H
3
2d4b8473 4#include <linux/preempt_mask.h>
fbb9ce95 5#include <linux/lockdep.h>
6a60dd12 6#include <linux/ftrace_irq.h>
dcbf832e 7#include <linux/vtime.h>
1da177e4 8
1da177e4 9
1da177e4 10extern void synchronize_irq(unsigned int irq);
1da177e4 11
127781d1 12#if defined(CONFIG_TINY_RCU)
9b1d82fa
PM
13
14static inline void rcu_nmi_enter(void)
15{
16}
17
18static inline void rcu_nmi_exit(void)
19{
20}
21
22#else
64db4cff
PM
23extern void rcu_nmi_enter(void);
24extern void rcu_nmi_exit(void);
9b1d82fa 25#endif
2232c2d8 26
de30a2b3
IM
27/*
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.
32 */
79bf2bb3
TG
33#define __irq_enter() \
34 do { \
6a61671b 35 account_irq_enter_time(current); \
bdb43806 36 preempt_count_add(HARDIRQ_OFFSET); \
79bf2bb3
TG
37 trace_hardirq_enter(); \
38 } while (0)
39
40/*
41 * Enter irq context (on NO_HZ, update jiffies):
42 */
dde4b2b5 43extern void irq_enter(void);
de30a2b3
IM
44
45/*
46 * Exit irq context without processing softirqs:
47 */
48#define __irq_exit() \
49 do { \
50 trace_hardirq_exit(); \
6a61671b 51 account_irq_exit_time(current); \
bdb43806 52 preempt_count_sub(HARDIRQ_OFFSET); \
1da177e4
LT
53 } while (0)
54
de30a2b3
IM
55/*
56 * Exit irq context and process softirqs if needed:
57 */
1da177e4
LT
58extern void irq_exit(void);
59
2a7b8df0
SR
60#define nmi_enter() \
61 do { \
0f1ac8fd 62 lockdep_off(); \
2a7b8df0
SR
63 ftrace_nmi_enter(); \
64 BUG_ON(in_nmi()); \
bdb43806 65 preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
2a7b8df0
SR
66 rcu_nmi_enter(); \
67 trace_hardirq_enter(); \
17666f02 68 } while (0)
5f34fe1c 69
2a7b8df0
SR
70#define nmi_exit() \
71 do { \
72 trace_hardirq_exit(); \
73 rcu_nmi_exit(); \
2a7b8df0 74 BUG_ON(!in_nmi()); \
bdb43806 75 preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \
2a7b8df0 76 ftrace_nmi_exit(); \
0f1ac8fd 77 lockdep_on(); \
17666f02 78 } while (0)
de30a2b3 79
1da177e4 80#endif /* LINUX_HARDIRQ_H */