aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2024-10-10 00:13:40 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-10-10 09:10:20 +0000
commit3937a9e90d502451ef8555e1ed1eca08dd50da7b (patch)
tree9134d97dc06fa86dbf30a348674e9044e79044f6 /sys
parenta156c5520d62af5106f4db32702d9b98e79cff9c (diff)
sys/linux: fix linkage field of BTF_KIND_VAR type
The linkage field of BTF type BTF_KIND_VAR isn't actually a boolean, but a flag. Given it can now take three different values [1], it doesn't match the boolean type and needs to be fixed. This commit defines it as a proper flags type. 1 - https://docs.kernel.org/bpf/btf.html#btf-kind-var Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys')
-rw-r--r--sys/linux/bpf.txt3
-rw-r--r--sys/linux/bpf.txt.const3
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt
index b373afbd1..9f856d70c 100644
--- a/sys/linux/bpf.txt
+++ b/sys/linux/bpf.txt
@@ -777,7 +777,7 @@ btf_type_var {
info_pad const[0, int8]
info_typ const[BTF_KIND_VAR, int8]
type btf_type_id
- linkage bool32
+ linkage flags[btf_linkage_values, int32]
}
btf_type_datasec {
@@ -841,3 +841,4 @@ nf_dev_hooks = NF_NETDEV_INGRESS, NF_NETDEV_EGRESS
bpf_link_create_netfilter_flags = BPF_F_NETFILTER_IP_DEFRAG
bpf_link_create_uprobe_multi_flags = BPF_F_UPROBE_MULTI_RETURN
btf_load_flags = BPF_F_TOKEN_FD
+btf_linkage_values = BTF_VAR_STATIC, BTF_VAR_GLOBAL_ALLOCATED, BTF_VAR_GLOBAL_EXTERN
diff --git a/sys/linux/bpf.txt.const b/sys/linux/bpf.txt.const
index 7b2885431..608d7bf3e 100644
--- a/sys/linux/bpf.txt.const
+++ b/sys/linux/bpf.txt.const
@@ -241,6 +241,9 @@ BTF_KIND_UNION = 5
BTF_KIND_VAR = 14
BTF_KIND_VOLATILE = 9
BTF_MAGIC = 60319
+BTF_VAR_GLOBAL_ALLOCATED = 1
+BTF_VAR_GLOBAL_EXTERN = 2
+BTF_VAR_STATIC = 0
BTF_VERSION = 1
EXP_CGROUP = 63
EXP_MAP = 39