x86: Move mpc_apic_id to x86_init_ops
authorThomas Gleixner <tglx@linutronix.de>
Thu, 20 Aug 2009 08:41:58 +0000 (10:41 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 27 Aug 2009 15:12:52 +0000 (17:12 +0200)
The mpc_apic_id setup is handled by a x86_quirk. Make it a
x86_init_ops function with a default implementation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/mpspec.h
arch/x86/include/asm/setup.h
arch/x86/include/asm/x86_init.h
arch/x86/kernel/apic/numaq_32.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/x86_init.c

index e2a1bb6d71ea832f6a6dbb3fc9ad7b58c7c9e6c4..03c6a92bfd4214156cb1eeb37585a1f7d94aaff6 100644 (file)
@@ -62,10 +62,12 @@ extern void get_smp_config(void);
 extern void find_smp_config(void);
 extern void early_reserve_e820_mpc_new(void);
 extern int enable_update_mptable;
+extern int default_mpc_apic_id(struct mpc_cpu *m);
 #else
 static inline void find_smp_config(void) { }
 static inline void early_reserve_e820_mpc_new(void) { }
 #define enable_update_mptable 0
+#define default_mpc_apic_id NULL
 #endif
 
 void __cpuinit generic_processor_info(int apicid, int version);
index cc8b4b0550ea102adf04395edfb92ece03e4464a..7c7f44f3e4d93711dc5aa7e50b3caa91c3f5d166 100644 (file)
@@ -12,7 +12,6 @@
 /*
  * Any setup quirks to be performed?
  */
-struct mpc_cpu;
 struct mpc_bus;
 struct mpc_oemtable;
 
@@ -25,7 +24,6 @@ struct x86_quirks {
        int (*mach_get_smp_config)(unsigned int early);
        int (*mach_find_smp_config)(unsigned int reserve);
 
-       int (*mpc_apic_id)(struct mpc_cpu *m);
        void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
        void (*mpc_oem_pci_bus)(struct mpc_bus *m);
        void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable,
index 65985730b376820d9868e6abedef754a64252b7c..f2be2a780189c3d9490f67c748ff5c37edb515ab 100644 (file)
@@ -1,14 +1,18 @@
 #ifndef _ASM_X86_PLATFORM_H
 #define _ASM_X86_PLATFORM_H
 
+struct mpc_cpu;
+
 /**
  * struct x86_init_mpparse - platform specific mpparse ops
  * @mpc_record:                        platform specific mpc record accounting
  * @setup_ioapic_ids:          platform specific ioapic id override
+ * @mpc_apic_id:               platform specific mpc apic id assignment
  */
 struct x86_init_mpparse {
        void (*mpc_record)(unsigned int mode);
        void (*setup_ioapic_ids)(void);
+       int (*mpc_apic_id)(struct mpc_cpu *m);
 };
 
 /**
index f3717659265d357b2671fb25cf05070d982ddc40..222413f7e79796489e19b5405403b972dadb994b 100644 (file)
@@ -270,7 +270,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = {
        .arch_trap_init                 = NULL,
        .mach_get_smp_config            = NULL,
        .mach_find_smp_config           = NULL,
-       .mpc_apic_id                    = mpc_apic_id,
        .mpc_oem_bus_info               = mpc_oem_bus_info,
        .mpc_oem_pci_bus                = mpc_oem_pci_bus,
        .smp_read_mpc_oem               = smp_read_mpc_oem,
@@ -293,6 +292,7 @@ static __init void early_check_numaq(void)
                x86_quirks = &numaq_x86_quirks;
                x86_init.mpparse.mpc_record = numaq_mpc_record;
                x86_init.mpparse.setup_ioapic_ids = x86_init_noop;
+               x86_init.mpparse.mpc_apic_id = mpc_apic_id;
        }
 }
 
index b2179fdf0ff78de304eac44f99ed22810a5dbe1f..04560860a72a246a7b0ad51fb7b73125d42072c0 100644 (file)
@@ -45,6 +45,11 @@ static int __init mpf_checksum(unsigned char *mp, int len)
        return sum & 0xFF;
 }
 
+int __init default_mpc_apic_id(struct mpc_cpu *m)
+{
+       return m->apicid;
+}
+
 static void __init MP_processor_info(struct mpc_cpu *m)
 {
        int apicid;
@@ -55,10 +60,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
                return;
        }
 
-       if (x86_quirks->mpc_apic_id)
-               apicid = x86_quirks->mpc_apic_id(m);
-       else
-               apicid = m->apicid;
+       apicid = x86_init.mpparse.mpc_apic_id(m);
 
        if (m->cpuflag & CPU_BOOTPROCESSOR) {
                bootup_cpu = " (Bootup-CPU)";
index f4a32b3ab0249c0826cc333fdff748741198f074..08749f2612f30c52f2b6ba0ca377b89f362dfd0d 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/init.h>
 
 #include <asm/bios_ebda.h>
+#include <asm/mpspec.h>
 #include <asm/setup.h>
 #include <asm/e820.h>
 
@@ -28,5 +29,6 @@ struct __initdata x86_init_ops x86_init = {
        .mpparse = {
                .mpc_record             = x86_init_uint_noop,
                .setup_ioapic_ids       = x86_init_noop,
+               .mpc_apic_id            = default_mpc_apic_id,
        },
 };