提交 34fba3e6 编写于 作者: D Dou Liyang 提交者: Thomas Gleixner

x86/init: Add intr_mode_init to x86_init_ops

X86 and XEN initialize interrupt delivery mode in different way.

To avoid conditionals, add a new x86_init_ops function which defaults to
the standard function and can be overridden by the early XEN platform code.

[ tglx: Folded the XEN part which was a separate patch to preserve
  	bisectability ]
Signed-off-by: NDou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Cc: yinghai@kernel.org
Cc: bhe@redhat.com
Link: https://lkml.kernel.org/r/1505293975-26005-10-git-send-email-douly.fnst@cn.fujitsu.com
上级 ca7c6076
...@@ -50,11 +50,13 @@ struct x86_init_resources { ...@@ -50,11 +50,13 @@ struct x86_init_resources {
* are set up. * are set up.
* @intr_init: interrupt init code * @intr_init: interrupt init code
* @trap_init: platform specific trap setup * @trap_init: platform specific trap setup
* @intr_mode_init: interrupt delivery mode setup
*/ */
struct x86_init_irqs { struct x86_init_irqs {
void (*pre_vector_init)(void); void (*pre_vector_init)(void);
void (*intr_init)(void); void (*intr_init)(void);
void (*trap_init)(void); void (*trap_init)(void);
void (*intr_mode_init)(void);
}; };
/** /**
......
...@@ -2423,7 +2423,7 @@ void __init apic_bsp_setup(bool upmode) ...@@ -2423,7 +2423,7 @@ void __init apic_bsp_setup(bool upmode)
#ifdef CONFIG_UP_LATE_INIT #ifdef CONFIG_UP_LATE_INIT
void __init up_late_init(void) void __init up_late_init(void)
{ {
apic_intr_mode_init(); x86_init.irqs.intr_mode_init();
if (apic_intr_mode == APIC_PIC) if (apic_intr_mode == APIC_PIC)
return; return;
......
...@@ -1296,7 +1296,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) ...@@ -1296,7 +1296,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
set_cpu_sibling_map(0); set_cpu_sibling_map(0);
apic_intr_mode_init(); x86_init.irqs.intr_mode_init();
smp_sanity_check(); smp_sanity_check();
......
...@@ -55,6 +55,7 @@ struct x86_init_ops x86_init __initdata = { ...@@ -55,6 +55,7 @@ struct x86_init_ops x86_init __initdata = {
.pre_vector_init = init_ISA_irqs, .pre_vector_init = init_ISA_irqs,
.intr_init = native_init_IRQ, .intr_init = native_init_IRQ,
.trap_init = x86_init_noop, .trap_init = x86_init_noop,
.intr_mode_init = apic_intr_mode_init
}, },
.oem = { .oem = {
......
...@@ -1230,6 +1230,7 @@ asmlinkage __visible void __init xen_start_kernel(void) ...@@ -1230,6 +1230,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
x86_platform.get_nmi_reason = xen_get_nmi_reason; x86_platform.get_nmi_reason = xen_get_nmi_reason;
x86_init.resources.memory_setup = xen_memory_setup; x86_init.resources.memory_setup = xen_memory_setup;
x86_init.irqs.intr_mode_init = x86_init_noop;
x86_init.oem.arch_setup = xen_arch_setup; x86_init.oem.arch_setup = xen_arch_setup;
x86_init.oem.banner = xen_banner; x86_init.oem.banner = xen_banner;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册