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>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user