brintos

brintos / linux-shallow public Read only

0
0
Text · 896 B · 66dcf75 Raw
38 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * Copyright (C) 2015, He Kuang <hekuang@huawei.com>4 * Copyright (C) 2015, Huawei Inc.5 */6#ifndef __BPF_PROLOGUE_H7#define __BPF_PROLOGUE_H8 9struct probe_trace_arg;10struct bpf_insn;11 12#define BPF_PROLOGUE_MAX_ARGS 313#define BPF_PROLOGUE_START_ARG_REG BPF_REG_314#define BPF_PROLOGUE_FETCH_RESULT_REG BPF_REG_215 16#ifdef HAVE_BPF_PROLOGUE17int bpf__gen_prologue(struct probe_trace_arg *args, int nargs,18		      struct bpf_insn *new_prog, size_t *new_cnt,19		      size_t cnt_space);20#else21#include <linux/compiler.h>22#include <errno.h>23 24static inline int25bpf__gen_prologue(struct probe_trace_arg *args __maybe_unused,26		  int nargs __maybe_unused,27		  struct bpf_insn *new_prog __maybe_unused,28		  size_t *new_cnt,29		  size_t cnt_space __maybe_unused)30{31	if (!new_cnt)32		return -EINVAL;33	*new_cnt = 0;34	return -ENOTSUP;35}36#endif37#endif /* __BPF_PROLOGUE_H */38