Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-fixes-2.6
[pandora-kernel.git] / arch / x86 / kernel / mpparse.c
index 014ac5d..3b25e49 100644 (file)
@@ -34,8 +34,6 @@
 #include <mach_mpparse.h>
 #endif
 
-int enable_update_mptable;
-
 /*
  * Checksum an MP configuration block.
  */
@@ -246,7 +244,7 @@ static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
                mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq);
 }
 
-static void assign_to_mp_irq(struct mpc_config_intsrc *m,
+static void __init assign_to_mp_irq(struct mpc_config_intsrc *m,
                                    struct mp_config_intsrc *mp_irq)
 {
        mp_irq->mp_dstapic = m->mpc_dstapic;
@@ -270,7 +268,7 @@ static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq,
        m->mpc_dstirq = mp_irq->mp_dstirq;
 }
 
-static int mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
+static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
                                        struct mpc_config_intsrc *m)
 {
        if (mp_irq->mp_dstapic != m->mpc_dstapic)
@@ -291,17 +289,16 @@ static int mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
        return 0;
 }
 
-void MP_intsrc_info(struct mpc_config_intsrc *m)
+static void __init MP_intsrc_info(struct mpc_config_intsrc *m)
 {
        int i;
 
        print_MP_intsrc_info(m);
 
-       if (enable_update_mptable)
-               for (i = 0; i < mp_irq_entries; i++) {
-                       if (!mp_irq_mpc_intsrc_cmp(&mp_irqs[i], m))
-                               return;
-               }
+       for (i = 0; i < mp_irq_entries; i++) {
+               if (!mp_irq_mpc_intsrc_cmp(&mp_irqs[i], m))
+                       return;
+       }
 
        assign_to_mp_irq(m, &mp_irqs[mp_irq_entries]);
        if (++mp_irq_entries == MAX_IRQ_SOURCES)
@@ -728,13 +725,23 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
 
 static struct intel_mp_floating *mpf_found;
 
+/*
+ * Machine specific quirk for finding the SMP config before other setup
+ * activities destroy the table:
+ */
+int (*mach_get_smp_config_quirk)(unsigned int early);
+
 /*
  * Scan the memory blocks for an SMP configuration block.
  */
-static void __init __get_smp_config(unsigned early)
+static void __init __get_smp_config(unsigned int early)
 {
        struct intel_mp_floating *mpf = mpf_found;
 
+       if (mach_get_smp_config_quirk) {
+               if (mach_get_smp_config_quirk(early))
+                       return;
+       }
        if (acpi_lapic && early)
                return;
        /*
@@ -892,10 +899,16 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
        return 0;
 }
 
-static void __init __find_smp_config(unsigned reserve)
+int (*mach_find_smp_config_quirk)(unsigned int reserve);
+
+static void __init __find_smp_config(unsigned int reserve)
 {
        unsigned int address;
 
+       if (mach_find_smp_config_quirk) {
+               if (mach_find_smp_config_quirk(reserve))
+                       return;
+       }
        /*
         * FIXME: Linux assumes you have 640K of base ram..
         * this continues the error...
@@ -1113,6 +1126,8 @@ out:
        return 0;
 }
 
+static int __initdata enable_update_mptable;
+
 static int __init update_mptable_setup(char *str)
 {
        enable_update_mptable = 1;