diff options
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 47 |
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); | |||
500 | static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; | 500 | static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; |
501 | const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); | 501 | const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); |
502 | EXPORT_SYMBOL(cpu_active_mask); | 502 | EXPORT_SYMBOL(cpu_active_mask); |
503 | |||
504 | void 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 | |||
512 | void 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 | |||
520 | void 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 | |||
528 | void 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 | |||
536 | void init_cpu_present(const struct cpumask *src) | ||
537 | { | ||
538 | cpumask_copy(to_cpumask(cpu_present_bits), src); | ||
539 | } | ||
540 | |||
541 | void init_cpu_possible(const struct cpumask *src) | ||
542 | { | ||
543 | cpumask_copy(to_cpumask(cpu_possible_bits), src); | ||
544 | } | ||
545 | |||
546 | void init_cpu_online(const struct cpumask *src) | ||
547 | { | ||
548 | cpumask_copy(to_cpumask(cpu_online_bits), src); | ||
549 | } | ||