]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/linux/bottom_half.h
Merge tag 'block-5.15-2021-10-01' of git://git.kernel.dk/linux-block
[mirror_ubuntu-jammy-kernel.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
0bd3a173 5#include <linux/preempt.h>
0bd3a173 6
8b1c04ac 7#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS)
0bd3a173
PZ
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
676dcb8b 22extern void _local_bh_enable(void);
0bd3a173
PZ
23extern 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}
676dcb8b 34
47c218dc
TG
35#ifdef CONFIG_PREEMPT_RT
36extern bool local_bh_blocked(void);
37#else
38static inline bool local_bh_blocked(void) { return false; }
39#endif
40
676dcb8b 41#endif /* _LINUX_BH_H */