From e447ec951660f8a55597758be7f6747ee772fe86 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 6 May 2014 20:47:44 +0200 Subject: 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. --- kern/cpumap.c | 2 +- kern/cpumap.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kern/cpumap.c b/kern/cpumap.c index 68a84ab9..7113af57 100644 --- a/kern/cpumap.c +++ b/kern/cpumap.c @@ -23,7 +23,7 @@ #include #include -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 0e57c30d..68a040ce 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); -- cgit v1.2.3