diff options
author | Richard Braun <rbraun@sceen.net> | 2014-05-06 20:47:44 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-05-06 20:47:44 +0200 |
commit | e447ec951660f8a55597758be7f6747ee772fe86 (patch) | |
tree | 5a070537b26fddaccabfd3179d5632c198136159 | |
parent | 6ef4f1e3a6c626e5bc2a49efb65e60d170445fd2 (diff) |
kern/cpumap: initialize cpumap_active_cpus
The cpumap_all function may be called before the cpumap module is
initialized. Make the cpumap_active_cpus cpumap initialized in the data
section, representing the BSP only.
-rw-r--r-- | kern/cpumap.c | 2 | ||||
-rw-r--r-- | kern/cpumap.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/kern/cpumap.c b/kern/cpumap.c index 68a84ab..7113af5 100644 --- a/kern/cpumap.c +++ b/kern/cpumap.c @@ -23,7 +23,7 @@ #include <kern/stddef.h> #include <machine/cpu.h> -static struct cpumap cpumap_active_cpus __read_mostly; +static struct cpumap cpumap_active_cpus __read_mostly = { { 1 } }; static struct kmem_cache cpumap_cache; diff --git a/kern/cpumap.h b/kern/cpumap.h index 0e57c30..68a040c 100644 --- a/kern/cpumap.h +++ b/kern/cpumap.h @@ -141,6 +141,9 @@ void cpumap_setup(void); /* * Return a cpumap representing all active processors. + * + * Until the cpumap module is initialized, the cpumap returned by this + * function describes the BSP only. */ const struct cpumap * cpumap_all(void); |