x86: rename mpc_config_processor to mpc_cpu
[safe/jmp/linux-2.6] / arch / x86 / kernel / mpparse.c
index 78509ee..1ec13bb 100644 (file)
 #include <linux/bitops.h>
 #include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/smp.h>
+#include <linux/acpi.h>
 
-#include <asm/smp.h>
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>
 #include <asm/pgalloc.h>
 #include <asm/io_apic.h>
 #include <asm/proto.h>
-#include <asm/acpi.h>
 #include <asm/bios_ebda.h>
 #include <asm/e820.h>
 #include <asm/trampoline.h>
@@ -49,7 +49,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
        return sum & 0xFF;
 }
 
-static void __init MP_processor_info(struct mpc_config_processor *m)
+static void __init MP_processor_info(struct mpc_cpu *m)
 {
        int apicid;
        char *bootup_cpu = "";
@@ -74,7 +74,7 @@ static void __init MP_processor_info(struct mpc_config_processor *m)
 }
 
 #ifdef CONFIG_X86_IO_APIC
-static void __init MP_bus_info(struct mpc_config_bus *m)
+static void __init MP_bus_info(struct mpc_bus *m)
 {
        char str[7];
        memcpy(str, m->mpc_bustype, 6);
@@ -83,7 +83,7 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
        if (x86_quirks->mpc_oem_bus_info)
                x86_quirks->mpc_oem_bus_info(m, str);
        else
-               printk(KERN_INFO "Bus #%d is %s\n", m->mpc_busid, str);
+               apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->mpc_busid, str);
 
 #if MAX_MP_BUSSES < 256
        if (m->mpc_busid >= MAX_MP_BUSSES) {
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
 #endif
 
        if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
-                set_bit(m->mpc_busid, mp_bus_not_pci);
-#if defined(CONFIG_EISA) || defined (CONFIG_MCA)
+               set_bit(m->mpc_busid, mp_bus_not_pci);
+#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
                mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA;
 #endif
        } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) {
@@ -104,7 +104,7 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
                        x86_quirks->mpc_oem_pci_bus(m);
 
                clear_bit(m->mpc_busid, mp_bus_not_pci);
-#if defined(CONFIG_EISA) || defined (CONFIG_MCA)
+#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
                mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI;
        } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) {
                mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA;
@@ -154,7 +154,7 @@ static void __init MP_ioapic_info(struct mpc_config_ioapic *m)
 
 static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
 {
-       printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
+       apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC INT %02x\n",
                m->mpc_irqtype, m->mpc_irqflag & 3,
                (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
@@ -163,7 +163,7 @@ static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
 
 static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
 {
-       printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
+       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,
@@ -235,7 +235,7 @@ static void __init MP_intsrc_info(struct mpc_config_intsrc *m)
 
 static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
 {
-       printk(KERN_INFO "Lint: type %d, pol %d, trig %d, bus %02x,"
+       apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC LINT %02x\n",
                m->mpc_irqtype, m->mpc_irqflag & 3,
                (m->mpc_irqflag >> 2) & 3, m->mpc_srcbusid,
@@ -246,8 +246,7 @@ static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
  * Read/parse the MPC
  */
 
-static int __init smp_check_mpc(struct mp_config_table *mpc, char *oem,
-                               char *str)
+static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
 {
 
        if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) {
@@ -283,7 +282,7 @@ static int __init smp_check_mpc(struct mp_config_table *mpc, char *oem,
        return 1;
 }
 
-static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
+static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
 {
        char str[16];
        char oem[10];
@@ -328,8 +327,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
                switch (*mpt) {
                case MP_PROCESSOR:
                        {
-                               struct mpc_config_processor *m =
-                                   (struct mpc_config_processor *)mpt;
+                               struct mpc_cpu *m = (struct mpc_cpu *)mpt;
                                /* ACPI may have already provided this data */
                                if (!acpi_lapic)
                                        MP_processor_info(m);
@@ -339,8 +337,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
                        }
                case MP_BUS:
                        {
-                               struct mpc_config_bus *m =
-                                   (struct mpc_config_bus *)mpt;
+                               struct mpc_bus *m = (struct mpc_bus *)mpt;
 #ifdef CONFIG_X86_IO_APIC
                                MP_bus_info(m);
 #endif
@@ -397,7 +394,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
        generic_bigsmp_probe();
 #endif
 
+#ifdef CONFIG_X86_32
        setup_apic_routing();
+#endif
        if (!num_processors)
                printk(KERN_ERR "MPTABLE: no processors registered!\n");
        return num_processors;
@@ -484,10 +483,10 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type)
 }
 
 
-static void construct_ioapic_table(int mpc_default_type)
+static void __init construct_ioapic_table(int mpc_default_type)
 {
        struct mpc_config_ioapic ioapic;
-       struct mpc_config_bus bus;
+       struct mpc_bus bus;
 
        bus.mpc_type = MP_BUS;
        bus.mpc_busid = 0;
@@ -529,12 +528,12 @@ static void construct_ioapic_table(int mpc_default_type)
        construct_default_ioirq_mptable(mpc_default_type);
 }
 #else
-static inline void construct_ioapic_table(int mpc_default_type) { }
+static inline void __init construct_ioapic_table(int mpc_default_type) { }
 #endif
 
 static inline void __init construct_default_ISA_mptable(int mpc_default_type)
 {
-       struct mpc_config_processor processor;
+       struct mpc_cpu processor;
        struct mpc_config_lintsrc lintsrc;
        int linttypes[2] = { mp_ExtINT, mp_NMI };
        int i;
@@ -584,23 +583,23 @@ static void __init __get_smp_config(unsigned int early)
 {
        struct intel_mp_floating *mpf = mpf_found;
 
-       if (x86_quirks->mach_get_smp_config) {
-               if (x86_quirks->mach_get_smp_config(early))
-                       return;
-       }
+       if (!mpf)
+               return;
+
        if (acpi_lapic && early)
                return;
+
        /*
-        * ACPI supports both logical (e.g. Hyper-Threading) and physical
-        * processors, where MPS only supports physical.
+        * MPS doesn't support hyperthreading, aka only have
+        * thread 0 apic id in MPS table
         */
-       if (acpi_lapic && acpi_ioapic) {
-               printk(KERN_INFO "Using ACPI (MADT) for SMP configuration "
-                      "information\n");
+       if (acpi_lapic && acpi_ioapic)
                return;
-       } else if (acpi_lapic)
-               printk(KERN_INFO "Using ACPI for processor (LAPIC) "
-                      "configuration information\n");
+
+       if (x86_quirks->mach_get_smp_config) {
+               if (x86_quirks->mach_get_smp_config(early))
+                       return;
+       }
 
        printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
               mpf->mpf_specification);
@@ -655,7 +654,7 @@ static void __init __get_smp_config(unsigned int early)
                 * ISA defaults and hope it will work.
                 */
                if (!mp_irq_entries) {
-                       struct mpc_config_bus bus;
+                       struct mpc_bus bus;
 
                        printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
                               "using default mptable. "
@@ -695,7 +694,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
        unsigned int *bp = phys_to_virt(base);
        struct intel_mp_floating *mpf;
 
-       printk(KERN_DEBUG "Scan SMP from %p for %ld bytes.\n", bp, length);
+       apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
+                       bp, length);
        BUILD_BUG_ON(sizeof(*mpf) != 16);
 
        while (length > 0) {
@@ -840,7 +840,7 @@ static int  __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
 static struct mpc_config_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
 #endif
 
-static int  __init replace_intsrc_all(struct mp_config_table *mpc,
+static int  __init replace_intsrc_all(struct mpc_table *mpc,
                                        unsigned long mpc_new_phys,
                                        unsigned long mpc_new_length)
 {
@@ -857,16 +857,14 @@ static int  __init replace_intsrc_all(struct mp_config_table *mpc,
                switch (*mpt) {
                case MP_PROCESSOR:
                        {
-                               struct mpc_config_processor *m =
-                                   (struct mpc_config_processor *)mpt;
+                               struct mpc_cpu *m = (struct mpc_cpu *)mpt;
                                mpt += sizeof(*m);
                                count += sizeof(*m);
                                break;
                        }
                case MP_BUS:
                        {
-                               struct mpc_config_bus *m =
-                                   (struct mpc_config_bus *)mpt;
+                               struct mpc_bus *m = (struct mpc_bus *)mpt;
                                mpt += sizeof(*m);
                                count += sizeof(*m);
                                break;
@@ -1011,8 +1009,7 @@ static int __init update_mp_table(void)
        char str[16];
        char oem[10];
        struct intel_mp_floating *mpf;
-       struct mp_config_table *mpc;
-       struct mp_config_table *mpc_new;
+       struct mpc_table *mpc, *mpc_new;
 
        if (!enable_update_mptable)
                return 0;