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);
811
811
/* First bits of cpu_bit_bitmap are in fact unset. */
812
812
#define cpu_none_mask to_cpumask(cpu_bit_bitmap[0])
813
813
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
814
820
#define for_each_possible_cpu (cpu ) for_each_cpu((cpu), cpu_possible_mask)
815
821
#define for_each_online_cpu (cpu ) for_each_cpu((cpu), cpu_online_mask)
816
822
#define for_each_present_cpu (cpu ) for_each_cpu((cpu), cpu_present_mask)
823
+ #endif
817
824
818
825
/* Wrappers for arch boot code to manipulate normally-constant masks */
819
826
void init_cpu_present (const struct cpumask * src );
You can’t perform that action at this time.
0 commit comments