summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/bottom_half.h
blob: d07dbeec7bc16fea0020d886a5bf415fe3ecf8aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _LINUX_BH_H
#define _LINUX_BH_H

#include <linux/preempt.h>

#ifdef CONFIG_PREEMPT_RT_FULL

extern void __local_bh_disable(void);
extern void _local_bh_enable(void);
extern void __local_bh_enable(void);

static inline void local_bh_disable(void)
{
	__local_bh_disable();
}

static inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
{
	__local_bh_disable();
}

static inline void local_bh_enable(void)
{
	__local_bh_enable();
}

static inline void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
{
	__local_bh_enable();
}

static inline void local_bh_enable_ip(unsigned long ip)
{
	__local_bh_enable();
}

#else

#ifdef CONFIG_TRACE_IRQFLAGS
extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
#else
static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
{
	preempt_count_add(cnt);
	barrier();
}
#endif

static inline void local_bh_disable(void)
{
	__local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
}

extern void _local_bh_enable(void);
extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);

static inline void local_bh_enable_ip(unsigned long ip)
{
	__local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
}

static inline void local_bh_enable(void)
{
	__local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
}
#endif

#endif /* _LINUX_BH_H */