diff options
Diffstat (limited to 'kernel/include/linux/bottom_half.h')
-rw-r--r-- | kernel/include/linux/bottom_half.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/kernel/include/linux/bottom_half.h b/kernel/include/linux/bottom_half.h new file mode 100644 index 000000000..8ca938935 --- /dev/null +++ b/kernel/include/linux/bottom_half.h @@ -0,0 +1,47 @@ +#ifndef _LINUX_BH_H +#define _LINUX_BH_H + +#include <linux/preempt.h> +#include <linux/preempt_mask.h> + +#ifdef CONFIG_PREEMPT_RT_FULL + +extern void local_bh_disable(void); +extern void _local_bh_enable(void); +extern void local_bh_enable(void); +extern void local_bh_enable_ip(unsigned long ip); +extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); +extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); + +#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 */ |