Skip to content

Commit 8fd8869

Browse files
iii-iAlexei Starovoitov
authored andcommitted
bpf: Add BTF_KIND_FLOAT to uapi
Add a new kind value and expand the kind bitfield. Signed-off-by: Ilya Leoshkevich <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 86a35af commit 8fd8869

File tree

2 files changed

+6
-4
lines changed
  • include/uapi/linux
  • tools/include/uapi/linux

2 files changed

+6
-4
lines changed

include/uapi/linux/btf.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct btf_type {
5252
};
5353
};
5454

55-
#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)
55+
#define BTF_INFO_KIND(info) (((info) >> 24) & 0x1f)
5656
#define BTF_INFO_VLEN(info) ((info) & 0xffff)
5757
#define BTF_INFO_KFLAG(info) ((info) >> 31)
5858

@@ -72,7 +72,8 @@ struct btf_type {
7272
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
7373
#define BTF_KIND_VAR 14 /* Variable */
7474
#define BTF_KIND_DATASEC 15 /* Section */
75-
#define BTF_KIND_MAX BTF_KIND_DATASEC
75+
#define BTF_KIND_FLOAT 16 /* Floating point */
76+
#define BTF_KIND_MAX BTF_KIND_FLOAT
7677
#define NR_BTF_KINDS (BTF_KIND_MAX + 1)
7778

7879
/* For some specific BTF_KIND, "struct btf_type" is immediately

tools/include/uapi/linux/btf.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct btf_type {
5252
};
5353
};
5454

55-
#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)
55+
#define BTF_INFO_KIND(info) (((info) >> 24) & 0x1f)
5656
#define BTF_INFO_VLEN(info) ((info) & 0xffff)
5757
#define BTF_INFO_KFLAG(info) ((info) >> 31)
5858

@@ -72,7 +72,8 @@ struct btf_type {
7272
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
7373
#define BTF_KIND_VAR 14 /* Variable */
7474
#define BTF_KIND_DATASEC 15 /* Section */
75-
#define BTF_KIND_MAX BTF_KIND_DATASEC
75+
#define BTF_KIND_FLOAT 16 /* Floating point */
76+
#define BTF_KIND_MAX BTF_KIND_FLOAT
7677
#define NR_BTF_KINDS (BTF_KIND_MAX + 1)
7778

7879
/* For some specific BTF_KIND, "struct btf_type" is immediately

0 commit comments

Comments
 (0)