]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - tools/testing/selftests/bpf/progs/test_core_reloc_ptr_as_arr.c
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Facebook
6 #include "bpf_helpers.h"
7 #include "bpf_core_read.h"
9 char _license
[] SEC("license") = "GPL";
16 struct core_reloc_ptr_as_arr
{
20 #define CORE_READ(dst, src) bpf_core_read(dst, sizeof(*(dst)), src)
22 SEC("raw_tracepoint/sys_enter")
23 int test_core_ptr_as_arr(void *ctx
)
25 struct core_reloc_ptr_as_arr
*in
= (void *)&data
.in
;
26 struct core_reloc_ptr_as_arr
*out
= (void *)&data
.out
;
28 if (CORE_READ(&out
->a
, &in
[2].a
))