xref: /linux/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c (revision 12e896b9794bbd88f56aeac2a5807ae8d4bb5ad8)
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