Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-fixes-2.6
[pandora-kernel.git] / arch / x86 / kernel / mpparse.c
index 7ac1b68..3b25e49 100644 (file)
@@ -244,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;
@@ -268,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)
@@ -289,7 +289,7 @@ 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;
 
@@ -725,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;
        /*
@@ -859,10 +869,11 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
 
                        if (!reserve)
                                return 1;
-#ifdef CONFIG_X86_32
-                       reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE,
+                       reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
                                        BOOTMEM_DEFAULT);
                        if (mpf->mpf_physptr) {
+                               unsigned long size = PAGE_SIZE;
+#ifdef CONFIG_X86_32
                                /*
                                 * We cannot access to MPC table to compute
                                 * table size yet, as only few megabytes from
@@ -872,22 +883,15 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
                                 * PAGE_SIZE from mpg->mpf_physptr yields BUG()
                                 * in reserve_bootmem.
                                 */
-                               unsigned long size = PAGE_SIZE;
                                unsigned long end = max_low_pfn * PAGE_SIZE;
                                if (mpf->mpf_physptr + size > end)
                                        size = end - mpf->mpf_physptr;
-                               reserve_bootmem(mpf->mpf_physptr, size,
+#endif
+                               reserve_bootmem_generic(mpf->mpf_physptr, size,
                                                BOOTMEM_DEFAULT);
                        }
 
-#else
-                       reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
-                               BOOTMEM_DEFAULT);
-                       if (mpf->mpf_physptr)
-                               reserve_bootmem_generic(mpf->mpf_physptr,
-                                       PAGE_SIZE, BOOTMEM_DEFAULT);
-#endif
-               return 1;
+                       return 1;
                }
                bp += 4;
                length -= 16;
@@ -895,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...
@@ -1116,7 +1126,7 @@ out:
        return 0;
 }
 
-int __initdata enable_update_mptable;
+static int __initdata enable_update_mptable;
 
 static int __init update_mptable_setup(char *str)
 {