Lines Matching refs:struct
12 ``struct cpumask`` is a bitmap data structure in the kernel whose indices
26 2.1 ``struct bpf_cpumask *``
29 ``struct bpf_cpumask *`` is a cpumask that is allocated by BPF, on behalf of a
32 to a ``struct cpumask *``.
34 2.1.1 ``struct bpf_cpumask *`` lifecycle
37 A ``struct bpf_cpumask *`` is allocated, acquired, and released, using the
53 struct cpumask_map_value {
54 struct bpf_cpumask __kptr * cpumask;
57 struct array_map {
60 __type(value, struct cpumask_map_value);
64 static int cpumask_map_insert(struct bpf_cpumask *mask, u32 pid)
66 struct cpumask_map_value local, *v;
68 struct bpf_cpumask *old;
96 int BPF_PROG(record_task_cpumask, struct task_struct *task, u64 clone_flags)
98 struct bpf_cpumask *cpumask;
114 2.1.1 ``struct bpf_cpumask *`` as kptrs
117 As mentioned and illustrated above, these ``struct bpf_cpumask *`` objects can
118 also be stored in a map and used as kptrs. If a ``struct bpf_cpumask *`` is in
124 /* struct containing the struct bpf_cpumask kptr which is stored in the map. */
125 struct cpumasks_kfunc_map_value {
126 struct bpf_cpumask __kptr * bpf_cpumask;
129 /* The map containing struct cpumasks_kfunc_map_value entries. */
130 struct {
133 __type(value, struct cpumasks_kfunc_map_value);
141 * struct bpf_cpumask * kptr that is stored in a map can
145 int BPF_PROG(cgrp_ancestor_example, struct cgroup *cgrp, const char *path)
147 struct bpf_cpumask *kptr;
148 struct cpumasks_kfunc_map_value *v;
177 2.2 ``struct cpumask``
180 ``struct cpumask`` is the object that actually contains the cpumask bitmap
181 being queried, mutated, etc. A ``struct bpf_cpumask`` wraps a ``struct
183 **not** safe to cast a ``struct cpumask *`` to a ``struct bpf_cpumask *``, and
187 ``struct bpf_cpumask *`` as that argument. Any argument that simply queries the
188 cpumask will instead take a ``struct cpumask *``.
194 etc a ``struct bpf_cpumask *``. This section of the document will describe the
202 argument must be a ``struct bpf_cpumask *``, as described above).
211 a CPU in a ``struct bpf_cpumask`` respectively:
225 int BPF_PROG(test_set_clear_cpu, struct task_struct *task, u64 clone_flags)
227 struct bpf_cpumask *cpumask;
243 /* struct cpumask * pointers such as task->cpus_ptr can also be queried. */
263 We can also set and clear entire ``struct bpf_cpumask *`` objects in one
289 int BPF_PROG(test_and_or_xor, struct task_struct *task, u64 clone_flags)
291 struct bpf_cpumask *mask1, *mask2, *dst1, *dst2;
307 bpf_cpumask_and(dst1, (const struct cpumask *)mask1, (const struct cpumask *)mask2);
308 if (!bpf_cpumask_empty((const struct cpumask *)dst1))
312 bpf_cpumask_or(dst1, (const struct cpumask *)mask1, (const struct cpumask *)mask2);
313 if (!bpf_cpumask_test_cpu(0, (const struct cpumask *)dst1))
317 if (!bpf_cpumask_test_cpu(1, (const struct cpumask *)dst1))
321 bpf_cpumask_xor(dst2, (const struct cpumask *)mask1, (const struct cpumask *)mask2);
322 if (!bpf_cpumask_equal((const struct cpumask *)dst1,
323 (const struct cpumask *)dst2))