Skip to contentSkip to conversation

smp: move smp setup functions to kernel/smp.c

DISCUSSION Heiko Carstens 2 participants 2 messages Mar 23, 2011 1 message not in the archive Generic include/asm header files

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 35 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/linus/34db18a054c600b6f81787165669dc572fe4de25
Commit:     34db18a054c600b6f81787165669dc572fe4de25
Parent:     fa9ee9c4b9885dfdf8eccac19b8b4fc8a7c53288
Author:     Amerigo Wang <[email protected]>
AuthorDate: Tue Mar 22 16:34:06 2011 -0700
Committer:  Linus Torvalds <[email protected]>
CommitDate: Tue Mar 22 17:44:11 2011 -0700

smp: move smp setup functions to kernel/smp.c

Move setup_nr_cpu_ids(), smp_init() and some other SMP boot parameter setup functions from init/main.c to kenrel/smp.c, saves some #ifdef CONFIG_SMP.

Cc Rakib Mullick <[email protected]>
Cc David Howells <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Akinobu Mita <[email protected]>
---
 include/linux/smp.h |    2 +
 init/main.c         |   90 +--------------------------------------------------
 kernel/smp.c        |   81 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 89 deletions(-)
include/linux/smp.h +0 -0
index 6dc95ca..48159dd 100644

include/linux/smp.h int on_each_cpu(smp_call_func_t func, void *info, int wait); · line 118

Quoted 5 lines
include/linux/smp.h +2 -0
@@ -114,6 +114,8 @@ int on_each_cpu(smp_call_func_t func, void *info, int wait);
 void smp_prepare_boot_cpu(void);
 
 extern unsigned int setup_max_cpus;
+extern void __init setup_nr_cpu_ids(void);
+extern void __init smp_init(void);

This causes a build error on s390. The patch below will fix it. Cc'ed linux-arch just in case other architectures are affected as well.

Subject: [PATCH] smp: add missing init.h include

From: Heiko Carstens <[email protected]>

34db18a05 "smp: move smp setup functions to kernel/smp.c" causes this build error on s390 because of a missing init.h include:

CC arch/s390/kernel/asm-offsets.s
In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/spinlock.h:14:0,
from include/linux/spinlock.h:87,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/s390/kernel/asm-offsets.c:10:
include/linux/smp.h:117:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'setup_nr_cpu_ids' include/linux/smp.h:118:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'smp_init'

Fix it by adding the include statement.

---
 include/linux/smp.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/smp.h +1 -0
index 48159dd..74243c8 100644
@@ -10,6 +10,7 @@
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/cpumask.h>
+#include <linux/init.h>
 
 extern void cpu_idle(void);
 
Acked-by
#2 lore raw
Quoted 21 lines · Heiko Carstens

This causes a build error on s390. The patch below will fix it. Cc'ed linux-arch just in case other architectures are affected as well.

Subject: [PATCH] smp: add missing init.h include

From: Heiko Carstens<[email protected]>

34db18a05 "smp: move smp setup functions to kernel/smp.c" causes this build error on s390 because of a missing init.h include:

CC arch/s390/kernel/asm-offsets.s
In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/spinlock.h:14:0,
from include/linux/spinlock.h:87,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/s390/kernel/asm-offsets.c:10:
include/linux/smp.h:117:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'setup_nr_cpu_ids' include/linux/smp.h:118:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'smp_init'

Quoted 3 lines

Fix it by adding the include statement.

Ah... thanks for the fix!