Merge tag 'x86_asm_for_v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-block.git] / include / linux / bottom_half.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
676dcb8b
AM
2#ifndef _LINUX_BH_H
3#define _LINUX_BH_H
4
e52340de 5#include <linux/instruction_pointer.h>
0bd3a173 6#include <linux/preempt.h>
0bd3a173 7
8b1c04ac 8#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS)
0bd3a173
PZ
9extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
10#else
11static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
12{
13 preempt_count_add(cnt);
14 barrier();
15}
16#endif
17
18static inline void local_bh_disable(void)
19{
20 __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
21}
22
676dcb8b 23extern void _local_bh_enable(void);
0bd3a173
PZ
24extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
25
26static inline void local_bh_enable_ip(unsigned long ip)
27{
28 __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
29}
30
31static inline void local_bh_enable(void)
32{
33 __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
34}
676dcb8b 35
47c218dc
TG
36#ifdef CONFIG_PREEMPT_RT
37extern bool local_bh_blocked(void);
38#else
39static inline bool local_bh_blocked(void) { return false; }
40#endif
41
676dcb8b 42#endif /* _LINUX_BH_H */