xref: /linux/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c (revision 90e43f1b47535cc7aceef3add1a61ba3260b7aee)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
3 #include <vmlinux.h>
4 #include <bpf/bpf_helpers.h>
5 #include "../test_kmods/bpf_testmod_kfunc.h"
6 
7 #if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
8 	defined(__BPF_FEATURE_STACK_ARGUMENT)
9 
10 long subprog_call_mem_kfunc(long a, long b, long c, long d, long e, long size)
11 {
12 	char buf[8] = {};
13 
14 	return bpf_kfunc_call_stack_arg_mem(a, b, c, d, e, buf, size);
15 }
16 
17 #else
18 
19 long subprog_call_mem_kfunc(void)
20 {
21 	return 0;
22 }
23 
24 #endif
25