These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / include / linux / bottom_half.h
1 #ifndef _LINUX_BH_H
2 #define _LINUX_BH_H
3
4 #include <linux/preempt.h>
5
6 #ifdef CONFIG_PREEMPT_RT_FULL
7
8 extern void __local_bh_disable(void);
9 extern void _local_bh_enable(void);
10 extern void __local_bh_enable(void);
11
12 static inline void local_bh_disable(void)
13 {
14         __local_bh_disable();
15 }
16
17 static inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
18 {
19         __local_bh_disable();
20 }
21
22 static inline void local_bh_enable(void)
23 {
24         __local_bh_enable();
25 }
26
27 static inline void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
28 {
29         __local_bh_enable();
30 }
31
32 static inline void local_bh_enable_ip(unsigned long ip)
33 {
34         __local_bh_enable();
35 }
36
37 #else
38
39 #ifdef CONFIG_TRACE_IRQFLAGS
40 extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
41 #else
42 static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
43 {
44         preempt_count_add(cnt);
45         barrier();
46 }
47 #endif
48
49 static inline void local_bh_disable(void)
50 {
51         __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
52 }
53
54 extern void _local_bh_enable(void);
55 extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
56
57 static inline void local_bh_enable_ip(unsigned long ip)
58 {
59         __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
60 }
61
62 static inline void local_bh_enable(void)
63 {
64         __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
65 }
66 #endif
67
68 #endif /* _LINUX_BH_H */