aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:16 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:16 -0500
commit3fa41520696fec2815e2d88fbcccdda77ba4d693 (patch)
tree418c698535189083b9cbed28bc30e895bda147e3 /kernel/cpu.c
parentae7a47e72e1a0b5e2b46d1596bc2c22942a73023 (diff)
cpumask: make set_cpu_*/init_cpu_* out-of-line
They're only for use in boot/cpu hotplug code anyway, and this avoids the use of deprecated cpu_*_map. Stephen Rothwell points out that gcc 4.2.4 (on powerpc at least) didn't like the cast away of const anyway: include/linux/cpumask.h: In function 'set_cpu_possible': include/linux/cpumask.h:1052: warning: passing argument 2 of 'cpumask_set_cpu' discards qualifiers from pointer target type So this kills two birds with one stone. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3ddc509b19c5..2c9f78f3a2fc 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -500,3 +500,50 @@ EXPORT_SYMBOL(cpu_present_mask);
500static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; 500static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly;
501const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); 501const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits);
502EXPORT_SYMBOL(cpu_active_mask); 502EXPORT_SYMBOL(cpu_active_mask);
503
504void set_cpu_possible(unsigned int cpu, bool possible)
505{
506 if (possible)
507 cpumask_set_cpu(cpu, to_cpumask(cpu_possible_bits));
508 else
509 cpumask_clear_cpu(cpu, to_cpumask(cpu_possible_bits));
510}
511
512void set_cpu_present(unsigned int cpu, bool present)
513{
514 if (present)
515 cpumask_set_cpu(cpu, to_cpumask(cpu_present_bits));
516 else
517 cpumask_clear_cpu(cpu, to_cpumask(cpu_present_bits));
518}
519
520void set_cpu_online(unsigned int cpu, bool online)
521{
522 if (online)
523 cpumask_set_cpu(cpu, to_cpumask(cpu_online_bits));
524 else
525 cpumask_clear_cpu(cpu, to_cpumask(cpu_online_bits));
526}
527
528void set_cpu_active(unsigned int cpu, bool active)
529{
530 if (active)
531 cpumask_set_cpu(cpu, to_cpumask(cpu_active_bits));
532 else
533 cpumask_clear_cpu(cpu, to_cpumask(cpu_active_bits));
534}
535
536void init_cpu_present(const struct cpumask *src)
537{
538 cpumask_copy(to_cpumask(cpu_present_bits), src);
539}
540
541void init_cpu_possible(const struct cpumask *src)
542{
543 cpumask_copy(to_cpumask(cpu_possible_bits), src);
544}
545
546void init_cpu_online(const struct cpumask *src)
547{
548 cpumask_copy(to_cpumask(cpu_online_bits), src);
549}