lkml.org 
[lkml]   [2023]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH bpf-next 1/4] bpf: Add new macro BPF_ALU32 and BPF_JMP64
Date
In the current code, BPF_ALU means BPF_ALU32, but BPF_JMP means BPF_JMP64,
it is a little confusing at the first glance, add new macro BPF_ALU32 and
BPF_JMP64, then we can replace the ambiguos macro BPF_ALU and BPF_JMP with
new macro BPF_ALU32 and BPF_JMP64 step by step, BPF_ALU and BPF_JMP can be
removed from the uapi header file in some day.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
include/uapi/linux/bpf.h | 2 ++
tools/include/uapi/linux/bpf.h | 2 ++
2 files changed, 4 insertions(+)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index ba0f0cf..a118c43 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -15,6 +15,8 @@

/* instruction classes */
#define BPF_JMP32 0x06 /* jmp mode in word width */
+#define BPF_JMP64 0x05 /* jmp mode in double word width */
+#define BPF_ALU32 0x04 /* alu mode in word width */
#define BPF_ALU64 0x07 /* alu mode in double word width */

/* ld/ldx fields */
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7f024ac..014b449 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -15,6 +15,8 @@

/* instruction classes */
#define BPF_JMP32 0x06 /* jmp mode in word width */
+#define BPF_JMP64 0x05 /* jmp mode in double word width */
+#define BPF_ALU32 0x04 /* alu mode in word width */
#define BPF_ALU64 0x07 /* alu mode in double word width */

/* ld/ldx fields */
--
2.1.0
\
 
 \ /
  Last update: 2023-03-27 00:05    [W:0.378 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site