mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
Some time ago we dual-licensed both libbpf and bpftool through commits1bc38b8ff6("libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause") and907b223651("tools: bpftool: dual license all files"). The latter missed the disasm.{c,h} which we pull in via kernel/bpf/ such that we have a single source for verifier as well as bpftool asm dumping, see alsof4ac7e0b5c("bpf: move instruction printing into a separate file"). It is currently GPL-2.0-only and missed the conversion in907b223651, therefore relicense the two as GPL-2.0-only OR BSD-2-Clause as well. Spotted-by: Quentin Monnet <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: Thomas Graf <[email protected]> Acked-by: Brendan Jackman <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Acked-by: Jiri Olsa <[email protected]> Acked-by: Simon Horman <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Acked-by: Xu Kuohai <[email protected]> Acked-by: Edward Cree <[email protected]>
41 lines
1.0 KiB
C
41 lines
1.0 KiB
C
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
|
|
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
|
|
* Copyright (c) 2016 Facebook
|
|
*/
|
|
|
|
#ifndef __BPF_DISASM_H__
|
|
#define __BPF_DISASM_H__
|
|
|
|
#include <linux/bpf.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/stringify.h>
|
|
#ifndef __KERNEL__
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#endif
|
|
|
|
extern const char *const bpf_alu_string[16];
|
|
extern const char *const bpf_class_string[8];
|
|
|
|
const char *func_id_name(int id);
|
|
|
|
typedef __printf(2, 3) void (*bpf_insn_print_t)(void *private_data,
|
|
const char *, ...);
|
|
typedef const char *(*bpf_insn_revmap_call_t)(void *private_data,
|
|
const struct bpf_insn *insn);
|
|
typedef const char *(*bpf_insn_print_imm_t)(void *private_data,
|
|
const struct bpf_insn *insn,
|
|
__u64 full_imm);
|
|
|
|
struct bpf_insn_cbs {
|
|
bpf_insn_print_t cb_print;
|
|
bpf_insn_revmap_call_t cb_call;
|
|
bpf_insn_print_imm_t cb_imm;
|
|
void *private_data;
|
|
};
|
|
|
|
void print_bpf_insn(const struct bpf_insn_cbs *cbs,
|
|
const struct bpf_insn *insn,
|
|
bool allow_ptr_leaks);
|
|
#endif
|