diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-01-15 16:22:39 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-01-22 09:10:56 -0500 |
commit | 30b8b0066cafef274fc92462578ee346211ce7cb (patch) | |
tree | 62d479f3d0c710ba2500522b86a295f579d86a55 | |
parent | e714a91f92ca59f7e71e7332b8ec2aa2944f629e (diff) |
init: Get rid of x86isms
The UP local API support can be set up from an early initcall. No need
for horrible hackery in the init code.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/20150115211703.827943883@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 7 | ||||
-rw-r--r-- | include/linux/smp.h | 7 | ||||
-rw-r--r-- | init/main.c | 13 |
4 files changed, 18 insertions, 13 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index ba397bde7948..ffcc3ca5862a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -855,6 +855,10 @@ config SCHED_MC | |||
855 | 855 | ||
856 | source "kernel/Kconfig.preempt" | 856 | source "kernel/Kconfig.preempt" |
857 | 857 | ||
858 | config UP_LATE_INIT | ||
859 | def_bool y | ||
860 | depends on X86_UP_APIC | ||
861 | |||
858 | config X86_UP_APIC | 862 | config X86_UP_APIC |
859 | bool "Local APIC support on uniprocessors" | 863 | bool "Local APIC support on uniprocessors" |
860 | depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI | 864 | depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index c681e9ba9e47..19f1bc714ee6 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -2267,6 +2267,13 @@ int __init APIC_init_uniprocessor(void) | |||
2267 | return 0; | 2267 | return 0; |
2268 | } | 2268 | } |
2269 | 2269 | ||
2270 | #ifdef CONFIG_UP_LATE_INIT | ||
2271 | void __init up_late_init(void) | ||
2272 | { | ||
2273 | APIC_init_uniprocessor(); | ||
2274 | } | ||
2275 | #endif | ||
2276 | |||
2270 | /* | 2277 | /* |
2271 | * Power management | 2278 | * Power management |
2272 | */ | 2279 | */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 93dff5fff524..be91db2a7017 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -151,6 +151,13 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, | |||
151 | static inline void kick_all_cpus_sync(void) { } | 151 | static inline void kick_all_cpus_sync(void) { } |
152 | static inline void wake_up_all_idle_cpus(void) { } | 152 | static inline void wake_up_all_idle_cpus(void) { } |
153 | 153 | ||
154 | #ifdef CONFIG_UP_LATE_INIT | ||
155 | extern void __init up_late_init(void); | ||
156 | static inline void smp_init(void) { up_late_init(); } | ||
157 | #else | ||
158 | static inline void smp_init(void) { } | ||
159 | #endif | ||
160 | |||
154 | #endif /* !SMP */ | 161 | #endif /* !SMP */ |
155 | 162 | ||
156 | /* | 163 | /* |
diff --git a/init/main.c b/init/main.c index 61b993767db5..179ada15d08a 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -87,10 +87,6 @@ | |||
87 | #include <asm/sections.h> | 87 | #include <asm/sections.h> |
88 | #include <asm/cacheflush.h> | 88 | #include <asm/cacheflush.h> |
89 | 89 | ||
90 | #ifdef CONFIG_X86_LOCAL_APIC | ||
91 | #include <asm/smp.h> | ||
92 | #endif | ||
93 | |||
94 | static int kernel_init(void *); | 90 | static int kernel_init(void *); |
95 | 91 | ||
96 | extern void init_IRQ(void); | 92 | extern void init_IRQ(void); |
@@ -351,15 +347,6 @@ __setup("rdinit=", rdinit_setup); | |||
351 | 347 | ||
352 | #ifndef CONFIG_SMP | 348 | #ifndef CONFIG_SMP |
353 | static const unsigned int setup_max_cpus = NR_CPUS; | 349 | static const unsigned int setup_max_cpus = NR_CPUS; |
354 | #ifdef CONFIG_X86_LOCAL_APIC | ||
355 | static void __init smp_init(void) | ||
356 | { | ||
357 | APIC_init_uniprocessor(); | ||
358 | } | ||
359 | #else | ||
360 | #define smp_init() do { } while (0) | ||
361 | #endif | ||
362 | |||
363 | static inline void setup_nr_cpu_ids(void) { } | 350 | static inline void setup_nr_cpu_ids(void) { } |
364 | static inline void smp_prepare_cpus(unsigned int maxcpus) { } | 351 | static inline void smp_prepare_cpus(unsigned int maxcpus) { } |
365 | #endif | 352 | #endif |