summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-05-06 20:47:44 +0200
committerRichard Braun <rbraun@sceen.net>2014-05-06 20:47:44 +0200
commite447ec951660f8a55597758be7f6747ee772fe86 (patch)
tree5a070537b26fddaccabfd3179d5632c198136159
parent6ef4f1e3a6c626e5bc2a49efb65e60d170445fd2 (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.c2
-rw-r--r--kern/cpumap.h3
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);