diff options
author | Yury Norov <yury.norov@gmail.com> | 2025-02-10 21:51:06 -0500 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2025-02-18 11:51:22 -0500 |
commit | 9ffa4b35a62d9786ce418085f36af671df3aacaa (patch) | |
tree | 854ea4a8375377db76771eed200639a994e1ac28 | |
parent | 158e9d2f3366976d74a500dbbba633036ba8501b (diff) |
cpumask: add for_each_{possible,online}_cpu_wrap
The iterators are trivial extensions of for_each_cpu_wrap(). They
are used in the following patches of the series to replace
cpumask_next_wrap().
Signed-off-by: Yury Norov <yury.norov@gmail.com>
-rw-r--r-- | include/linux/cpumask.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 36a890d0dd57..e57fd41ca38e 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -1033,11 +1033,21 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); #define for_each_possible_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++) #define for_each_online_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++) #define for_each_present_cpu(cpu) for ((cpu) = 0; (cpu) < 1; (cpu)++) + +#define for_each_possible_cpu_wrap(cpu, start) \ + for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++) +#define for_each_online_cpu_wrap(cpu, start) \ + for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++) #else #define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask) #define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask) #define for_each_enabled_cpu(cpu) for_each_cpu((cpu), cpu_enabled_mask) #define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask) + +#define for_each_possible_cpu_wrap(cpu, start) \ + for_each_cpu_wrap((cpu), cpu_possible_mask, (start)) +#define for_each_online_cpu_wrap(cpu, start) \ + for_each_cpu_wrap((cpu), cpu_online_mask, (start)) #endif /* Wrappers for arch boot code to manipulate normally-constant masks */ |