File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -811,9 +811,16 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
811811/* First bits of cpu_bit_bitmap are in fact unset. */
812812#define cpu_none_mask to_cpumask(cpu_bit_bitmap[0])
813813
814+ #if NR_CPUS == 1
815+ /* Uniprocessor: the possible/online/present masks are always "1" */
816+ #define for_each_possible_cpu (cpu ) for ((cpu) = 0; (cpu) < 1; (cpu)++)
817+ #define for_each_online_cpu (cpu ) for ((cpu) = 0; (cpu) < 1; (cpu)++)
818+ #define for_each_present_cpu (cpu ) for ((cpu) = 0; (cpu) < 1; (cpu)++)
819+ #else
814820#define for_each_possible_cpu (cpu ) for_each_cpu((cpu), cpu_possible_mask)
815821#define for_each_online_cpu (cpu ) for_each_cpu((cpu), cpu_online_mask)
816822#define for_each_present_cpu (cpu ) for_each_cpu((cpu), cpu_present_mask)
823+ #endif
817824
818825/* Wrappers for arch boot code to manipulate normally-constant masks */
819826void init_cpu_present (const struct cpumask * src );
You can’t perform that action at this time.
0 commit comments