1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/instruction_pointer.h>
6 #include <linux/preempt.h>
8 #if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS)
9 extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
11 static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
13 preempt_count_add(cnt);
18 static inline void local_bh_disable(void)
20 __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
23 extern void _local_bh_enable(void);
24 extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
26 static inline void local_bh_enable_ip(unsigned long ip)
28 __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
31 static inline void local_bh_enable(void)
33 __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
36 #ifdef CONFIG_PREEMPT_RT
37 extern bool local_bh_blocked(void);
39 static inline bool local_bh_blocked(void) { return false; }
42 #endif /* _LINUX_BH_H */