]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
riscv, bpf: Add missing uapi header for BPF_PROG_TYPE_PERF_EVENT programs
authorBjörn Töpel <bjorn.topel@gmail.com>
Mon, 16 Dec 2019 09:13:42 +0000 (10:13 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Dec 2019 15:03:31 +0000 (16:03 +0100)
Add missing uapi header the BPF_PROG_TYPE_PERF_EVENT programs by
exporting struct user_regs_struct instead of struct pt_regs which is
in-kernel only.

Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191216091343.23260-9-bjorn.topel@gmail.com
arch/riscv/include/uapi/asm/bpf_perf_event.h [new file with mode: 0644]
tools/include/uapi/asm/bpf_perf_event.h

diff --git a/arch/riscv/include/uapi/asm/bpf_perf_event.h b/arch/riscv/include/uapi/asm/bpf_perf_event.h
new file mode 100644 (file)
index 0000000..6cb1c28
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
+#define _UAPI__ASM_BPF_PERF_EVENT_H__
+
+#include <asm/ptrace.h>
+
+typedef struct user_regs_struct bpf_user_pt_regs_t;
+
+#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
index 13a58531e6fa844df407a921385a9356294e9b61..39acc149d8432055147af53af0f77d57f1873622 100644 (file)
@@ -2,6 +2,8 @@
 #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h"
 #elif defined(__s390__)
 #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h"
+#elif defined(__riscv)
+#include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h"
 #else
 #include <uapi/asm-generic/bpf_perf_event.h>
 #endif