mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
smp, generic: introduce arch_disable_smp_support() instead of disable_ioapic_setup()
Impact: cleanup disable_ioapic_setup() in init/main.c is ugly as the function is x86-specific. The #ifdef inline prototype there is ugly too. Replace it with a generic arch_disable_smp_support() function - which has a weak alias for non-x86 architectures and for non-ioapic x86 builds. Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d8106d2e24
commit
65a4e574d2
6 changed files with 24 additions and 20 deletions
12
init/main.c
12
init/main.c
|
@ -136,14 +136,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS;
|
|||
* greater than 0, limits the maximum number of CPUs activated in
|
||||
* SMP mode to <NUM>.
|
||||
*/
|
||||
#ifndef CONFIG_X86_IO_APIC
|
||||
static inline void disable_ioapic_setup(void) {};
|
||||
#endif
|
||||
|
||||
void __weak arch_disable_smp_support(void) { }
|
||||
|
||||
static int __init nosmp(char *str)
|
||||
{
|
||||
setup_max_cpus = 0;
|
||||
disable_ioapic_setup();
|
||||
arch_disable_smp_support();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -153,14 +153,14 @@ static int __init maxcpus(char *str)
|
|||
{
|
||||
get_option(&str, &setup_max_cpus);
|
||||
if (setup_max_cpus == 0)
|
||||
disable_ioapic_setup();
|
||||
arch_disable_smp_support();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
early_param("maxcpus", maxcpus);
|
||||
#else
|
||||
#define setup_max_cpus NR_CPUS
|
||||
const unsigned int setup_max_cpus = NR_CPUS;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue