Lines Matching +full:end +full:- +full:of +full:- +full:conversion
1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
7 * vmlinux.h (auto-generated from BTF) or linux/types.h
23 * To allow use of SEC() with externs (e.g., for extern .maps declarations),
39 _Pragma("GCC diagnostic ignored \"-Wignored-attributes\"") \
45 /* Avoid 'linux/stddef.h' definition of '__always_inline'. */
57 * Use __hidden attribute to mark a non-static BPF subprogram effectively
64 /* When utilizing vmlinux.h with BPF CO-RE, user BPF programs can't include
65 * any system-level headers (such as stddef.h, linux/version.h, etc), and
66 * commonly-used macros like NULL and KERNEL_VERSION aren't available through
67 * vmlinux.h. This just adds unnecessary hurdles and forces users to re-define
83 * offset CO-RE relocation properly, so force-redefine offsetof() using
84 * old-school approach which works with CO-RE correctly
87 #define offsetof(type, member) ((unsigned long)&((type *)0)->member)
94 ((type *)(__mptr - offsetof(type, member))); \
104 /* Variable-specific compiler (optimization) barrier. It's a no-op which makes
105 * compiler believe that there is some black box modification of a given
109 * E.g., compiler might often delay or even omit 32-bit to 64-bit casting of
115 * This is a variable-specific variant of more global barrier().
123 * built into the resulting code. This works given BPF back end does not
125 * of the program code are never used and hence eliminated by the compiler.
152 * jmpq/nopl retpoline-free patching by the x86-64 JIT in the kernel in bpf_tail_call_static()
156 * Note on clobber list: we need to stay in-line with BPF calling in bpf_tail_call_static()
157 * convention, so even if we don't end up using r0, r4, r5, we need in bpf_tail_call_static()
158 * to mark them as clobber so that LLVM doesn't end up using them in bpf_tail_call_static()
242 * BPF_SEQ_PRINTF to wrap bpf_seq_printf to-be-printed values
251 _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
260 * BPF_SNPRINTF wraps the bpf_snprintf helper with variadic arguments instead of
261 * an array of u64.
269 _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
292 * instead of an array of u64.
300 _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \
322 extern int bpf_iter_num_new(struct bpf_iter_num *it, int start, int end) __weak __ksym;
328 * using BPF open-coded iterators without having to write mundane explicit
329 * low-level loop logic. Instead, it provides for()-like generic construct
336 * bpf_printk("Child cgroup id = %d", cg->cgroup_id);
337 * if (cg->cgroup_id == 123)
341 * I.e., it looks almost like high-level for each loop in other languages,
349 * Note: this macro relies on C99 feature of allowing to declare variables
370 /* bpf_for(i, start, end) implements a for()-like looping construct that sets
372 * but not including, *end*. It also proves to BPF verifier that *i* belongs
373 * to range [start, end), so this can be used for accessing arrays without
376 * Note: *start* and *end* are assumed to be expressions with no side effects
380 * Note: similarly to bpf_for_each(), it relies on C99 feature of declaring for()
383 #define bpf_for(i, start, end) for ( \ argument
389 bpf_iter_num_new(&___it, (start), (end)), \
397 (___t && ((i) = *___t, (i) >= (start) && (i) < (end))); \
405 * Note: similarly to bpf_for_each(), it relies on C99 feature of declaring for()