aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:14 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:35:14 -0500
commitb3199c025d1646e25e7d1d640dd605db251dccf8 (patch)
tree752bd257f2db6b4d39bf9cdce18ca25ade5e63a9 /kernel/cpu.c
parentcb78a0ce69fad2026825f957e24e2d9cda1ec9f1 (diff)
cpumask: switch over to cpu_online/possible/active/present_mask: core
Impact: cleanup This implements the obsolescent cpu_online_map in terms of cpu_online_mask, rather than the other way around. Same for the other maps. The documentation comments are also updated to refer to _mask rather than _map. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index bae131a1211b..3ddc509b19c5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -15,30 +15,8 @@
15#include <linux/stop_machine.h> 15#include <linux/stop_machine.h>
16#include <linux/mutex.h> 16#include <linux/mutex.h>
17 17
18/*
19 * Represents all cpu's present in the system
20 * In systems capable of hotplug, this map could dynamically grow
21 * as new cpu's are detected in the system via any platform specific
22 * method, such as ACPI for e.g.
23 */
24cpumask_t cpu_present_map __read_mostly;
25EXPORT_SYMBOL(cpu_present_map);
26
27/*
28 * Represents all cpu's that are currently online.
29 */
30cpumask_t cpu_online_map __read_mostly;
31EXPORT_SYMBOL(cpu_online_map);
32
33#ifdef CONFIG_INIT_ALL_POSSIBLE
34cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL;
35#else
36cpumask_t cpu_possible_map __read_mostly;
37#endif
38EXPORT_SYMBOL(cpu_possible_map);
39
40#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
41/* Serializes the updates to cpu_online_map, cpu_present_map */ 19/* Serializes the updates to cpu_online_mask, cpu_present_mask */
42static DEFINE_MUTEX(cpu_add_remove_lock); 20static DEFINE_MUTEX(cpu_add_remove_lock);
43 21
44static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); 22static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain);
@@ -65,8 +43,6 @@ void __init cpu_hotplug_init(void)
65 cpu_hotplug.refcount = 0; 43 cpu_hotplug.refcount = 0;
66} 44}
67 45
68cpumask_t cpu_active_map;
69
70#ifdef CONFIG_HOTPLUG_CPU 46#ifdef CONFIG_HOTPLUG_CPU
71 47
72void get_online_cpus(void) 48void get_online_cpus(void)
@@ -97,7 +73,7 @@ EXPORT_SYMBOL_GPL(put_online_cpus);
97 73
98/* 74/*
99 * The following two API's must be used when attempting 75 * The following two API's must be used when attempting
100 * to serialize the updates to cpu_online_map, cpu_present_map. 76 * to serialize the updates to cpu_online_mask, cpu_present_mask.
101 */ 77 */
102void cpu_maps_update_begin(void) 78void cpu_maps_update_begin(void)
103{ 79{
@@ -503,3 +479,24 @@ EXPORT_SYMBOL_GPL(cpu_bit_bitmap);
503 479
504const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL; 480const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL;
505EXPORT_SYMBOL(cpu_all_bits); 481EXPORT_SYMBOL(cpu_all_bits);
482
483#ifdef CONFIG_INIT_ALL_POSSIBLE
484static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly
485 = CPU_BITS_ALL;
486#else
487static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly;
488#endif
489const struct cpumask *const cpu_possible_mask = to_cpumask(cpu_possible_bits);
490EXPORT_SYMBOL(cpu_possible_mask);
491
492static DECLARE_BITMAP(cpu_online_bits, CONFIG_NR_CPUS) __read_mostly;
493const struct cpumask *const cpu_online_mask = to_cpumask(cpu_online_bits);
494EXPORT_SYMBOL(cpu_online_mask);
495
496static DECLARE_BITMAP(cpu_present_bits, CONFIG_NR_CPUS) __read_mostly;
497const struct cpumask *const cpu_present_mask = to_cpumask(cpu_present_bits);
498EXPORT_SYMBOL(cpu_present_mask);
499
500static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly;
501const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits);
502EXPORT_SYMBOL(cpu_active_mask);