提交 333344d9 编写于 作者: I Ingo Molnar

x86, smp: refactor ->smp_callin_clear_local_apic() methods

Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
reset the APIC.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 a9659366
...@@ -13,11 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert) ...@@ -13,11 +13,6 @@ static inline void es7000_wait_for_init_deassert(atomic_t *deassert)
return; return;
} }
/* Nothing to do for most platforms, since cleared by the INIT cycle */
static inline void smp_callin_clear_local_apic(void)
{
}
static inline void store_NMI_vector(unsigned short *high, unsigned short *low) static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{ {
} }
......
...@@ -8,11 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert) ...@@ -8,11 +8,6 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
return; return;
} }
/* Nothing to do for most platforms, since cleared by the INIT cycle */
static inline void smp_callin_clear_local_apic(void)
{
}
static inline void store_NMI_vector(unsigned short *high, unsigned short *low) static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
{ {
} }
......
#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H #ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H #define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
#define smp_callin_clear_local_apic (apic->smp_callin_clear_local_apic)
#define store_NMI_vector (apic->store_NMI_vector) #define store_NMI_vector (apic->store_NMI_vector)
#define restore_NMI_vector (apic->restore_NMI_vector) #define restore_NMI_vector (apic->restore_NMI_vector)
#define inquire_remote_apic (apic->inquire_remote_apic) #define inquire_remote_apic (apic->inquire_remote_apic)
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
/* /*
* Because we use NMIs rather than the INIT-STARTUP sequence to * Because we use NMIs rather than the INIT-STARTUP sequence to
* bootstrap the CPUs, the APIC may be in a weird state. Kick it. * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
*/ */
static inline void smp_callin_clear_local_apic(void) static inline void numaq_smp_callin_clear_local_apic(void)
{ {
clear_local_APIC(); clear_local_APIC();
} }
......
...@@ -244,7 +244,8 @@ static void __cpuinit smp_callin(void) ...@@ -244,7 +244,8 @@ static void __cpuinit smp_callin(void)
*/ */
pr_debug("CALLIN, before setup_local_APIC().\n"); pr_debug("CALLIN, before setup_local_APIC().\n");
smp_callin_clear_local_apic(); if (apic->smp_callin_clear_local_apic)
apic->smp_callin_clear_local_apic();
setup_local_APIC(); setup_local_APIC();
end_local_APIC_setup(); end_local_APIC_setup();
map_cpu_to_logical_apicid(); map_cpu_to_logical_apicid();
......
...@@ -109,7 +109,8 @@ struct genapic apic_bigsmp = { ...@@ -109,7 +109,8 @@ struct genapic apic_bigsmp = {
.wait_for_init_deassert = default_wait_for_init_deassert, .wait_for_init_deassert = default_wait_for_init_deassert,
.smp_callin_clear_local_apic = smp_callin_clear_local_apic, .smp_callin_clear_local_apic = NULL,
.store_NMI_vector = store_NMI_vector, .store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic, .inquire_remote_apic = inquire_remote_apic,
......
...@@ -90,7 +90,7 @@ struct genapic apic_default = { ...@@ -90,7 +90,7 @@ struct genapic apic_default = {
.wait_for_init_deassert = default_wait_for_init_deassert, .wait_for_init_deassert = default_wait_for_init_deassert,
.smp_callin_clear_local_apic = smp_callin_clear_local_apic, .smp_callin_clear_local_apic = NULL,
.store_NMI_vector = store_NMI_vector, .store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic, .inquire_remote_apic = inquire_remote_apic,
......
...@@ -145,7 +145,9 @@ struct genapic apic_es7000 = { ...@@ -145,7 +145,9 @@ struct genapic apic_es7000 = {
.wait_for_init_deassert = default_wait_for_init_deassert, .wait_for_init_deassert = default_wait_for_init_deassert,
.smp_callin_clear_local_apic = smp_callin_clear_local_apic, /* Nothing to do for most platforms, since cleared by the INIT cycle: */
.smp_callin_clear_local_apic = NULL,
.store_NMI_vector = store_NMI_vector, .store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic, .inquire_remote_apic = inquire_remote_apic,
......
...@@ -110,7 +110,7 @@ struct genapic apic_numaq = { ...@@ -110,7 +110,7 @@ struct genapic apic_numaq = {
/* We don't do anything here because we use NMI's to boot instead */ /* We don't do anything here because we use NMI's to boot instead */
.wait_for_init_deassert = NULL, .wait_for_init_deassert = NULL,
.smp_callin_clear_local_apic = smp_callin_clear_local_apic, .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
.store_NMI_vector = store_NMI_vector, .store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic, .inquire_remote_apic = inquire_remote_apic,
......
...@@ -89,7 +89,8 @@ struct genapic apic_summit = { ...@@ -89,7 +89,8 @@ struct genapic apic_summit = {
.wait_for_init_deassert = default_wait_for_init_deassert, .wait_for_init_deassert = default_wait_for_init_deassert,
.smp_callin_clear_local_apic = smp_callin_clear_local_apic, .smp_callin_clear_local_apic = NULL,
.store_NMI_vector = store_NMI_vector, .store_NMI_vector = store_NMI_vector,
.restore_NMI_vector = restore_NMI_vector, .restore_NMI_vector = restore_NMI_vector,
.inquire_remote_apic = inquire_remote_apic, .inquire_remote_apic = inquire_remote_apic,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册