x86: unify smp_read_mpc
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Fri, 4 Apr 2008 19:42:27 +0000 (23:42 +0400)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:41:35 +0000 (17:41 +0200)
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/mpparse_32.c
arch/x86/kernel/mpparse_64.c

index 9120573e2616bde2468804ff1d1aa42bd9743003..c185065c3ebcebaa78fbe4f83add12aae84f1d19 100644 (file)
@@ -288,39 +288,40 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
        unsigned char *mpt = ((unsigned char *)mpc) + count;
 
        if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) {
-               printk(KERN_ERR "SMP mptable: bad signature [0x%x]!\n",
-                      *(u32 *) mpc->mpc_signature);
+               printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n",
+                      mpc->mpc_signature[0], mpc->mpc_signature[1],
+                      mpc->mpc_signature[2], mpc->mpc_signature[3]);
                return 0;
        }
        if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) {
-               printk(KERN_ERR "SMP mptable: checksum error!\n");
+               printk(KERN_ERR "MPTABLE: checksum error!\n");
                return 0;
        }
        if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) {
-               printk(KERN_ERR "SMP mptable: bad table version (%d)!!\n",
+               printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n",
                       mpc->mpc_spec);
                return 0;
        }
        if (!mpc->mpc_lapic) {
-               printk(KERN_ERR "SMP mptable: null local APIC address!\n");
+               printk(KERN_ERR "MPTABLE: null local APIC address!\n");
                return 0;
        }
        memcpy(oem, mpc->mpc_oem, 8);
        oem[8] = 0;
-       printk(KERN_INFO "OEM ID: %s ", oem);
+       printk(KERN_INFO "MPTABLE: OEM ID: %s ", oem);
 
        memcpy(str, mpc->mpc_productid, 12);
        str[12] = 0;
        printk("Product ID: %s ", str);
 
+#ifdef CONFIG_X86_32
        mps_oem_check(mpc, oem, str);
+#endif
+       printk(KERN_INFO "MPTABLE: Product ID: %s ", str);
 
-       printk("APIC at: 0x%X\n", mpc->mpc_lapic);
+       printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic);
 
-       /*
-        * Save the local APIC address (it might be non-default) -- but only
-        * if we're not using ACPI.
-        */
+       /* save the local APIC address, it might be non-default */
        if (!acpi_lapic)
                mp_lapic_addr = mpc->mpc_lapic;
 
@@ -399,7 +400,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
        }
        setup_apic_routing();
        if (!num_processors)
-               printk(KERN_ERR "SMP mptable: no processors registered!\n");
+               printk(KERN_ERR "MPTABLE: no processors registered!\n");
        return num_processors;
 }
 
index 831097f2022a29ad610e42f5e468f299952cf37d..d188848a893eac8b4ea6df5a8582d43306c29a31 100644 (file)
@@ -188,13 +188,13 @@ static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
 static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
 {
        char str[16];
+       char oem[10];
        int count = sizeof(*mpc);
        unsigned char *mpt = ((unsigned char *)mpc) + count;
 
        if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) {
                printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n",
-                      mpc->mpc_signature[0],
-                      mpc->mpc_signature[1],
+                      mpc->mpc_signature[0], mpc->mpc_signature[1],
                       mpc->mpc_signature[2], mpc->mpc_signature[3]);
                return 0;
        }
@@ -211,12 +211,17 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
                printk(KERN_ERR "MPTABLE: null local APIC address!\n");
                return 0;
        }
-       memcpy(str, mpc->mpc_oem, 8);
-       str[8] = 0;
-       printk(KERN_INFO "MPTABLE: OEM ID: %s ", str);
+       memcpy(oem, mpc->mpc_oem, 8);
+       oem[8] = 0;
+       printk(KERN_INFO "MPTABLE: OEM ID: %s ", oem);
 
        memcpy(str, mpc->mpc_productid, 12);
        str[12] = 0;
+       printk("Product ID: %s ", str);
+
+#ifdef CONFIG_X86_32
+       mps_oem_check(mpc, oem, str);
+#endif
        printk(KERN_INFO "MPTABLE: Product ID: %s ", str);
 
        printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic);
@@ -231,12 +236,16 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
        /*
         *      Now process the configuration blocks.
         */
+#ifdef CONFIG_X86_NUMAQ
+       mpc_record = 0;
+#endif
        while (count < mpc->mpc_length) {
                switch (*mpt) {
                case MP_PROCESSOR:
                        {
                                struct mpc_config_processor *m =
                                    (struct mpc_config_processor *)mpt;
+                               /* ACPI may have already provided this data */
                                if (!acpi_lapic)
                                        MP_processor_info(m);
                                mpt += sizeof(*m);
@@ -280,7 +289,15 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
                                count += sizeof(*m);
                                break;
                        }
+               default:
+                       {
+                               count = mpc->mpc_length;
+                               break;
+                       }
                }
+#ifdef CONFIG_X86_NUMAQ
+               ++mpc_record;
+#endif
        }
        setup_apic_routing();
        if (!num_processors)