WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / test_skeleton.c
blob374ccef704e10e56e95cb8ced5f9e84bc3adfb2d
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019 Facebook */
4 #include <stdbool.h>
5 #include <linux/bpf.h>
6 #include <bpf/bpf_helpers.h>
8 struct s {
9 int a;
10 long long b;
11 } __attribute__((packed));
13 /* .data section */
14 int in1 = -1;
15 long long in2 = -1;
17 /* .bss section */
18 char in3 = '\0';
19 long long in4 __attribute__((aligned(64))) = 0;
20 struct s in5 = {};
22 /* .rodata section */
23 const volatile struct {
24 const int in6;
25 } in = {};
27 /* .data section */
28 int out1 = -1;
29 long long out2 = -1;
31 /* .bss section */
32 char out3 = 0;
33 long long out4 = 0;
34 int out6 = 0;
36 extern bool CONFIG_BPF_SYSCALL __kconfig;
37 extern int LINUX_KERNEL_VERSION __kconfig;
38 bool bpf_syscall = 0;
39 int kern_ver = 0;
41 SEC("raw_tp/sys_enter")
42 int handler(const void *ctx)
44 static volatile struct s out5;
46 out1 = in1;
47 out2 = in2;
48 out3 = in3;
49 out4 = in4;
50 out5 = in5;
51 out6 = in.in6;
53 bpf_syscall = CONFIG_BPF_SYSCALL;
54 kern_ver = LINUX_KERNEL_VERSION;
56 return 0;
59 char _license[] SEC("license") = "GPL";