blob: 86c12c93e3cf6ce9c1db4085b9ee986d2c1e5b9a [file] [log] [blame]
Andrew Morton676dcb82006-12-06 20:31:30 -08001#ifndef _LINUX_BH_H
2#define _LINUX_BH_H
3
Peter Zijlstra0bd3a172013-11-19 16:13:38 +01004#include <linux/preempt.h>
5#include <linux/preempt_mask.h>
6
7#ifdef CONFIG_TRACE_IRQFLAGS
8extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
9#else
10static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
11{
12 preempt_count_add(cnt);
13 barrier();
14}
15#endif
16
17static inline void local_bh_disable(void)
18{
19 __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
20}
21
Andrew Morton676dcb82006-12-06 20:31:30 -080022extern void _local_bh_enable(void);
Peter Zijlstra0bd3a172013-11-19 16:13:38 +010023extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
24
25static inline void local_bh_enable_ip(unsigned long ip)
26{
27 __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
28}
29
30static inline void local_bh_enable(void)
31{
32 __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
33}
Andrew Morton676dcb82006-12-06 20:31:30 -080034
35#endif /* _LINUX_BH_H */