mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
Implementing BPF version of preempt_count() requires accessing lowcore from BPF. Since lowcore can be relocated, open-coding (struct lowcore *)0 does not work, so add a kfunc. Signed-off-by: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
13 lines
214 B
C
13 lines
214 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <asm/lowcore.h>
|
|
#include <linux/btf.h>
|
|
|
|
__bpf_kfunc_start_defs();
|
|
|
|
__bpf_kfunc struct lowcore *bpf_get_lowcore(void)
|
|
{
|
|
return get_lowcore();
|
|
}
|
|
|
|
__bpf_kfunc_end_defs();
|