aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
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}