Commit e403669e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix for more than 256 CPUs

From: Paul Jackson <pj@sgi.com>

The patch is needed to build NR_CPUS > 256.

Without this fix, you get compile errors:
    include/linux/cpumask.h: In function `next_online_cpu':
    include/linux/cpumask.h:56: structure has no member named `val'
parent 6caf4668
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
typedef const cpumask_t cpumask_const_t; typedef const cpumask_t cpumask_const_t;
#define mk_cpumask_const(map) ((cpumask_const_t)(map)) #define mk_cpumask_const(map) (map)
#define cpu_isset_const(cpu, map) cpu_isset(cpu, map) #define cpu_isset_const(cpu, map) cpu_isset(cpu, map)
#define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2) #define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2)
#define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2) #define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2)
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
#define APIC_DFR_VALUE (APIC_DFR_FLAT) #define APIC_DFR_VALUE (APIC_DFR_FLAT)
static inline cpumask_t target_cpus(void) static inline cpumask_const_t target_cpus(void)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
return cpu_online_map; return mk_cpumask_const(cpu_online_map);
#else #else
return cpumask_of_cpu(0); return mk_cpumask_const(cpumask_of_cpu(0));
#endif #endif
} }
#define TARGET_CPUS (target_cpus()) #define TARGET_CPUS (target_cpus())
......
...@@ -53,18 +53,18 @@ extern cpumask_t cpu_online_map; ...@@ -53,18 +53,18 @@ extern cpumask_t cpu_online_map;
static inline int next_online_cpu(int cpu, cpumask_t map) static inline int next_online_cpu(int cpu, cpumask_t map)
{ {
do do
cpu = next_cpu_const(cpu, map); cpu = next_cpu_const(cpu, mk_cpumask_const(map));
while (cpu < NR_CPUS && !cpu_online(cpu)); while (cpu < NR_CPUS && !cpu_online(cpu));
return cpu; return cpu;
} }
#define for_each_cpu(cpu, map) \ #define for_each_cpu(cpu, map) \
for (cpu = first_cpu_const(map); \ for (cpu = first_cpu_const(mk_cpumask_const(map)); \
cpu < NR_CPUS; \ cpu < NR_CPUS; \
cpu = next_cpu_const(cpu,map)) cpu = next_cpu_const(cpu,mk_cpumask_const(map)))
#define for_each_online_cpu(cpu, map) \ #define for_each_online_cpu(cpu, map) \
for (cpu = first_cpu_const(map); \ for (cpu = first_cpu_const(mk_cpumask_const(map)); \
cpu < NR_CPUS; \ cpu < NR_CPUS; \
cpu = next_online_cpu(cpu,map)) cpu = next_online_cpu(cpu,map))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment