]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/mpparse.c
Merge branch 'core/percpu' into x86/core
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / mpparse.c
index a86a65537433d139b7245ec39b8398c97250e7a7..2007644531957f04c372fb498b65aa66fb830cf4 100644 (file)
@@ -3,7 +3,7 @@
  *     compliant MP-table parsing routines.
  *
  *     (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
- *     (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
+ *     (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
  *      (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
  */
 
 #include <asm/e820.h>
 #include <asm/trampoline.h>
 #include <asm/setup.h>
+#include <asm/smp.h>
 
-#include <mach_apic.h>
-#ifdef CONFIG_X86_32
-#include <mach_apicdef.h>
-#include <mach_mpparse.h>
-#endif
-
+#include <asm/genapic.h>
 /*
  * Checksum an MP configuration block.
  */
@@ -159,55 +155,55 @@ static void print_MP_intsrc_info(struct mpc_intsrc *m)
                m->srcbusirq, m->dstapic, m->dstirq);
 }
 
-static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
+static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq)
 {
        apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC INT %02x\n",
-               mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3,
-               (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus,
-               mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq);
+               mp_irq->irqtype, mp_irq->irqflag & 3,
+               (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus,
+               mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq);
 }
 
 static void __init assign_to_mp_irq(struct mpc_intsrc *m,
-                                   struct mp_config_intsrc *mp_irq)
+                                   struct mpc_intsrc *mp_irq)
 {
-       mp_irq->mp_dstapic = m->dstapic;
-       mp_irq->mp_type = m->type;
-       mp_irq->mp_irqtype = m->irqtype;
-       mp_irq->mp_irqflag = m->irqflag;
-       mp_irq->mp_srcbus = m->srcbus;
-       mp_irq->mp_srcbusirq = m->srcbusirq;
-       mp_irq->mp_dstirq = m->dstirq;
+       mp_irq->dstapic = m->dstapic;
+       mp_irq->type = m->type;
+       mp_irq->irqtype = m->irqtype;
+       mp_irq->irqflag = m->irqflag;
+       mp_irq->srcbus = m->srcbus;
+       mp_irq->srcbusirq = m->srcbusirq;
+       mp_irq->dstirq = m->dstirq;
 }
 
-static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq,
+static void __init assign_to_mpc_intsrc(struct mpc_intsrc *mp_irq,
                                        struct mpc_intsrc *m)
 {
-       m->dstapic = mp_irq->mp_dstapic;
-       m->type = mp_irq->mp_type;
-       m->irqtype = mp_irq->mp_irqtype;
-       m->irqflag = mp_irq->mp_irqflag;
-       m->srcbus = mp_irq->mp_srcbus;
-       m->srcbusirq = mp_irq->mp_srcbusirq;
-       m->dstirq = mp_irq->mp_dstirq;
+       m->dstapic = mp_irq->dstapic;
+       m->type = mp_irq->type;
+       m->irqtype = mp_irq->irqtype;
+       m->irqflag = mp_irq->irqflag;
+       m->srcbus = mp_irq->srcbus;
+       m->srcbusirq = mp_irq->srcbusirq;
+       m->dstirq = mp_irq->dstirq;
 }
 
-static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
+static int __init mp_irq_mpc_intsrc_cmp(struct mpc_intsrc *mp_irq,
                                        struct mpc_intsrc *m)
 {
-       if (mp_irq->mp_dstapic != m->dstapic)
+       if (mp_irq->dstapic != m->dstapic)
                return 1;
-       if (mp_irq->mp_type != m->type)
+       if (mp_irq->type != m->type)
                return 2;
-       if (mp_irq->mp_irqtype != m->irqtype)
+       if (mp_irq->irqtype != m->irqtype)
                return 3;
-       if (mp_irq->mp_irqflag != m->irqflag)
+       if (mp_irq->irqflag != m->irqflag)
                return 4;
-       if (mp_irq->mp_srcbus != m->srcbus)
+       if (mp_irq->srcbus != m->srcbus)
                return 5;
-       if (mp_irq->mp_srcbusirq != m->srcbusirq)
+       if (mp_irq->srcbusirq != m->srcbusirq)
                return 6;
-       if (mp_irq->mp_dstirq != m->dstirq)
+       if (mp_irq->dstirq != m->dstirq)
                return 7;
 
        return 0;
@@ -291,16 +287,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
                return 0;
 
 #ifdef CONFIG_X86_32
-       /*
-        * need to make sure summit and es7000's mps_oem_check is safe to be
-        * called early via genericarch 's mps_oem_check
-        */
-       if (early) {
-#ifdef CONFIG_X86_NUMAQ
-               numaq_mps_oem_check(mpc, oem, str);
-#endif
-       } else
-               mps_oem_check(mpc, oem, str);
+       generic_mps_oem_check(mpc, oem, str);
 #endif
        /* save the local APIC address, it might be non-default */
        if (!acpi_lapic)
@@ -385,13 +372,13 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
                        (*x86_quirks->mpc_record)++;
        }
 
-#ifdef CONFIG_X86_GENERICARCH
-       generic_bigsmp_probe();
+#ifdef CONFIG_X86_BIGSMP
+       generic_bigsmp_probe();
 #endif
 
-#ifdef CONFIG_X86_32
-       setup_apic_routing();
-#endif
+       if (apic->setup_apic_routing)
+               apic->setup_apic_routing();
+
        if (!num_processors)
                printk(KERN_ERR "MPTABLE: no processors registered!\n");
        return num_processors;
@@ -705,8 +692,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
 #endif
                        mpf_found = mpf;
 
-                       printk(KERN_INFO "found SMP MP-table at [%p] %08lx\n",
-                              mpf, virt_to_phys(mpf));
+                       printk(KERN_INFO "found SMP MP-table at [%p] %llx\n",
+                              mpf, (u64)virt_to_phys(mpf));
 
                        if (!reserve)
                                return 1;
@@ -808,15 +795,15 @@ static int  __init get_MP_intsrc_index(struct mpc_intsrc *m)
        /* not legacy */
 
        for (i = 0; i < mp_irq_entries; i++) {
-               if (mp_irqs[i].mp_irqtype != mp_INT)
+               if (mp_irqs[i].irqtype != mp_INT)
                        continue;
 
-               if (mp_irqs[i].mp_irqflag != 0x0f)
+               if (mp_irqs[i].irqflag != 0x0f)
                        continue;
 
-               if (mp_irqs[i].mp_srcbus != m->srcbus)
+               if (mp_irqs[i].srcbus != m->srcbus)
                        continue;
-               if (mp_irqs[i].mp_srcbusirq != m->srcbusirq)
+               if (mp_irqs[i].srcbusirq != m->srcbusirq)
                        continue;
                if (irq_used[i]) {
                        /* already claimed */
@@ -921,10 +908,10 @@ static int  __init replace_intsrc_all(struct mpc_table *mpc,
                if (irq_used[i])
                        continue;
 
-               if (mp_irqs[i].mp_irqtype != mp_INT)
+               if (mp_irqs[i].irqtype != mp_INT)
                        continue;
 
-               if (mp_irqs[i].mp_irqflag != 0x0f)
+               if (mp_irqs[i].irqflag != 0x0f)
                        continue;
 
                if (nr_m_spare > 0) {
@@ -1024,7 +1011,7 @@ static int __init update_mp_table(void)
        if (!smp_check_mpc(mpc, oem, str))
                return 0;
 
-       printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
+       printk(KERN_INFO "mpf: %llx\n", (u64)virt_to_phys(mpf));
        printk(KERN_INFO "physptr: %x\n", mpf->physptr);
 
        if (mpc_new_phys && mpc->length > mpc_new_length) {