]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/hardirq.h
UBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs
[mirror_ubuntu-artful-kernel.git] / include / linux / hardirq.h
CommitLineData
1da177e4
LT
1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H
3
92cf2118 4#include <linux/preempt.h>
fbb9ce95 5#include <linux/lockdep.h>
6a60dd12 6#include <linux/ftrace_irq.h>
dcbf832e 7#include <linux/vtime.h>
0bd3a173 8#include <asm/hardirq.h>
1da177e4 9
1da177e4 10
1da177e4 11extern void synchronize_irq(unsigned int irq);
02cea395 12extern bool synchronize_hardirq(unsigned int irq);
1da177e4 13
127781d1 14#if defined(CONFIG_TINY_RCU)
9b1d82fa
PM
15
16static inline void rcu_nmi_enter(void)
17{
18}
19
20static inline void rcu_nmi_exit(void)
21{
22}
23
24#else
64db4cff
PM
25extern void rcu_nmi_enter(void);
26extern void rcu_nmi_exit(void);
9b1d82fa 27#endif
2232c2d8 28
de30a2b3
IM
29/*
30 * It is safe to do non-atomic ops on ->hardirq_context,
31 * because NMI handlers may not preempt and the ops are
32 * always balanced, so the interrupted value of ->hardirq_context
33 * will always be restored.
34 */
79bf2bb3
TG
35#define __irq_enter() \
36 do { \
6a61671b 37 account_irq_enter_time(current); \
bdb43806 38 preempt_count_add(HARDIRQ_OFFSET); \
79bf2bb3
TG
39 trace_hardirq_enter(); \
40 } while (0)
41
42/*
43 * Enter irq context (on NO_HZ, update jiffies):
44 */
dde4b2b5 45extern void irq_enter(void);
de30a2b3
IM
46
47/*
48 * Exit irq context without processing softirqs:
49 */
50#define __irq_exit() \
51 do { \
52 trace_hardirq_exit(); \
6a61671b 53 account_irq_exit_time(current); \
bdb43806 54 preempt_count_sub(HARDIRQ_OFFSET); \
1da177e4
LT
55 } while (0)
56
de30a2b3
IM
57/*
58 * Exit irq context and process softirqs if needed:
59 */
1da177e4
LT
60extern void irq_exit(void);
61
2a7b8df0
SR
62#define nmi_enter() \
63 do { \
42a0bb3f 64 printk_nmi_enter(); \
0f1ac8fd 65 lockdep_off(); \
2a7b8df0
SR
66 ftrace_nmi_enter(); \
67 BUG_ON(in_nmi()); \
bdb43806 68 preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
2a7b8df0
SR
69 rcu_nmi_enter(); \
70 trace_hardirq_enter(); \
17666f02 71 } while (0)
5f34fe1c 72
2a7b8df0
SR
73#define nmi_exit() \
74 do { \
75 trace_hardirq_exit(); \
76 rcu_nmi_exit(); \
2a7b8df0 77 BUG_ON(!in_nmi()); \
bdb43806 78 preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \
2a7b8df0 79 ftrace_nmi_exit(); \
0f1ac8fd 80 lockdep_on(); \
42a0bb3f 81 printk_nmi_exit(); \
17666f02 82 } while (0)
de30a2b3 83
1da177e4 84#endif /* LINUX_HARDIRQ_H */