diff options
| author | Alexei Starovoitov <[email protected]> | 2024-03-07 03:12:26 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2024-03-07 22:58:48 +0000 |
| commit | d147357e2e5977c5fe9218457a1e359fd1d36609 (patch) | |
| tree | 3460c738a1dd66aeab815a4e10efee871376909a /tools/lib/bpf/bpf_helpers.h | |
| parent | bpf: Plumb get_unmapped_area() callback into bpf_map_ops (diff) | |
| download | kernel-d147357e2e5977c5fe9218457a1e359fd1d36609.tar.gz kernel-d147357e2e5977c5fe9218457a1e359fd1d36609.zip | |
libbpf: Allow specifying 64-bit integers in map BTF.
__uint() macro that is used to specify map attributes like:
__uint(type, BPF_MAP_TYPE_ARRAY);
__uint(map_flags, BPF_F_MMAPABLE);
It is limited to 32-bit, since BTF_KIND_ARRAY has u32 "number of elements"
field in "struct btf_array".
Introduce __ulong() macro that allows specifying values bigger than 32-bit.
In map definition "map_extra" is the only u64 field, so far.
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
| -rw-r--r-- | tools/lib/bpf/bpf_helpers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h index 79eaa581be98..112b1504e072 100644 --- a/tools/lib/bpf/bpf_helpers.h +++ b/tools/lib/bpf/bpf_helpers.h @@ -13,6 +13,7 @@ #define __uint(name, val) int (*name)[val] #define __type(name, val) typeof(val) *name #define __array(name, val) typeof(val) *name[] +#define __ulong(name, val) enum { ___bpf_concat(__unique_value, __COUNTER__) = val } name /* * Helper macro to place programs, maps, license in |
