Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright (c) Meta Platforms, Inc. and affiliates. */
0003 
0004 #include <stdbool.h>
0005 #include <linux/bpf.h>
0006 #include <bpf/bpf_helpers.h>
0007 
0008 /* volatile to force a read, compiler may assume 0 otherwise */
0009 const volatile int rovar1;
0010 int out1;
0011 
0012 /* Override weak symbol in test_subskeleton_lib */
0013 int var5 = 5;
0014 
0015 extern volatile bool CONFIG_BPF_SYSCALL __kconfig;
0016 
0017 extern int lib_routine(void);
0018 
0019 SEC("raw_tp/sys_enter")
0020 int handler1(const void *ctx)
0021 {
0022     (void) CONFIG_BPF_SYSCALL;
0023 
0024     out1 = lib_routine() * rovar1;
0025     return 0;
0026 }
0027 
0028 char LICENSE[] SEC("license") = "GPL";