Andrew Morton | 676dcb8 | 2006-12-06 20:31:30 -0800 | [diff] [blame] | 1 | #ifndef _LINUX_BH_H |
| 2 | #define _LINUX_BH_H |
| 3 | |
Peter Zijlstra | 0bd3a17 | 2013-11-19 16:13:38 +0100 | [diff] [blame] | 4 | #include <linux/preempt.h> |
Peter Zijlstra | 0bd3a17 | 2013-11-19 16:13:38 +0100 | [diff] [blame] | 5 | |
| 6 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 7 | extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); |
| 8 | #else |
| 9 | static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) |
| 10 | { |
| 11 | preempt_count_add(cnt); |
| 12 | barrier(); |
| 13 | } |
| 14 | #endif |
| 15 | |
| 16 | static inline void local_bh_disable(void) |
| 17 | { |
| 18 | __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); |
| 19 | } |
| 20 | |
Andrew Morton | 676dcb8 | 2006-12-06 20:31:30 -0800 | [diff] [blame] | 21 | extern void _local_bh_enable(void); |
Peter Zijlstra | 0bd3a17 | 2013-11-19 16:13:38 +0100 | [diff] [blame] | 22 | extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); |
| 23 | |
| 24 | static inline void local_bh_enable_ip(unsigned long ip) |
| 25 | { |
| 26 | __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET); |
| 27 | } |
| 28 | |
| 29 | static inline void local_bh_enable(void) |
| 30 | { |
| 31 | __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); |
| 32 | } |
Andrew Morton | 676dcb8 | 2006-12-06 20:31:30 -0800 | [diff] [blame] | 33 | |
| 34 | #endif /* _LINUX_BH_H */ |