diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-04-04 15:42:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:35 -0400 |
commit | e950bea8bff23c14eb38dc706aadf197ed81abf4 (patch) | |
tree | 642a45b3eba2c2a13ed407937ddc4a934d8993a2 /arch/x86 | |
parent | f8924e770e048429ae13bfabe1ddad9bf1e64df7 (diff) |
x86: unify smp_read_mpc
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/mpparse_32.c | 25 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_64.c | 27 |
2 files changed, 35 insertions, 17 deletions
diff --git a/arch/x86/kernel/mpparse_32.c b/arch/x86/kernel/mpparse_32.c index 9120573e2616..c185065c3ebc 100644 --- a/arch/x86/kernel/mpparse_32.c +++ b/arch/x86/kernel/mpparse_32.c | |||
@@ -288,39 +288,40 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | |||
288 | unsigned char *mpt = ((unsigned char *)mpc) + count; | 288 | unsigned char *mpt = ((unsigned char *)mpc) + count; |
289 | 289 | ||
290 | if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { | 290 | if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { |
291 | printk(KERN_ERR "SMP mptable: bad signature [0x%x]!\n", | 291 | printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", |
292 | *(u32 *) mpc->mpc_signature); | 292 | mpc->mpc_signature[0], mpc->mpc_signature[1], |
293 | mpc->mpc_signature[2], mpc->mpc_signature[3]); | ||
293 | return 0; | 294 | return 0; |
294 | } | 295 | } |
295 | if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) { | 296 | if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) { |
296 | printk(KERN_ERR "SMP mptable: checksum error!\n"); | 297 | printk(KERN_ERR "MPTABLE: checksum error!\n"); |
297 | return 0; | 298 | return 0; |
298 | } | 299 | } |
299 | if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) { | 300 | if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) { |
300 | printk(KERN_ERR "SMP mptable: bad table version (%d)!!\n", | 301 | printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", |
301 | mpc->mpc_spec); | 302 | mpc->mpc_spec); |
302 | return 0; | 303 | return 0; |
303 | } | 304 | } |
304 | if (!mpc->mpc_lapic) { | 305 | if (!mpc->mpc_lapic) { |
305 | printk(KERN_ERR "SMP mptable: null local APIC address!\n"); | 306 | printk(KERN_ERR "MPTABLE: null local APIC address!\n"); |
306 | return 0; | 307 | return 0; |
307 | } | 308 | } |
308 | memcpy(oem, mpc->mpc_oem, 8); | 309 | memcpy(oem, mpc->mpc_oem, 8); |
309 | oem[8] = 0; | 310 | oem[8] = 0; |
310 | printk(KERN_INFO "OEM ID: %s ", oem); | 311 | printk(KERN_INFO "MPTABLE: OEM ID: %s ", oem); |
311 | 312 | ||
312 | memcpy(str, mpc->mpc_productid, 12); | 313 | memcpy(str, mpc->mpc_productid, 12); |
313 | str[12] = 0; | 314 | str[12] = 0; |
314 | printk("Product ID: %s ", str); | 315 | printk("Product ID: %s ", str); |
315 | 316 | ||
317 | #ifdef CONFIG_X86_32 | ||
316 | mps_oem_check(mpc, oem, str); | 318 | mps_oem_check(mpc, oem, str); |
319 | #endif | ||
320 | printk(KERN_INFO "MPTABLE: Product ID: %s ", str); | ||
317 | 321 | ||
318 | printk("APIC at: 0x%X\n", mpc->mpc_lapic); | 322 | printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic); |
319 | 323 | ||
320 | /* | 324 | /* save the local APIC address, it might be non-default */ |
321 | * Save the local APIC address (it might be non-default) -- but only | ||
322 | * if we're not using ACPI. | ||
323 | */ | ||
324 | if (!acpi_lapic) | 325 | if (!acpi_lapic) |
325 | mp_lapic_addr = mpc->mpc_lapic; | 326 | mp_lapic_addr = mpc->mpc_lapic; |
326 | 327 | ||
@@ -399,7 +400,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | |||
399 | } | 400 | } |
400 | setup_apic_routing(); | 401 | setup_apic_routing(); |
401 | if (!num_processors) | 402 | if (!num_processors) |
402 | printk(KERN_ERR "SMP mptable: no processors registered!\n"); | 403 | printk(KERN_ERR "MPTABLE: no processors registered!\n"); |
403 | return num_processors; | 404 | return num_processors; |
404 | } | 405 | } |
405 | 406 | ||
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c index 831097f2022a..d188848a893e 100644 --- a/arch/x86/kernel/mpparse_64.c +++ b/arch/x86/kernel/mpparse_64.c | |||
@@ -188,13 +188,13 @@ static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m) | |||
188 | static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | 188 | static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) |
189 | { | 189 | { |
190 | char str[16]; | 190 | char str[16]; |
191 | char oem[10]; | ||
191 | int count = sizeof(*mpc); | 192 | int count = sizeof(*mpc); |
192 | unsigned char *mpt = ((unsigned char *)mpc) + count; | 193 | unsigned char *mpt = ((unsigned char *)mpc) + count; |
193 | 194 | ||
194 | if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { | 195 | if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { |
195 | printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", | 196 | printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", |
196 | mpc->mpc_signature[0], | 197 | mpc->mpc_signature[0], mpc->mpc_signature[1], |
197 | mpc->mpc_signature[1], | ||
198 | mpc->mpc_signature[2], mpc->mpc_signature[3]); | 198 | mpc->mpc_signature[2], mpc->mpc_signature[3]); |
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
@@ -211,12 +211,17 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | |||
211 | printk(KERN_ERR "MPTABLE: null local APIC address!\n"); | 211 | printk(KERN_ERR "MPTABLE: null local APIC address!\n"); |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | memcpy(str, mpc->mpc_oem, 8); | 214 | memcpy(oem, mpc->mpc_oem, 8); |
215 | str[8] = 0; | 215 | oem[8] = 0; |
216 | printk(KERN_INFO "MPTABLE: OEM ID: %s ", str); | 216 | printk(KERN_INFO "MPTABLE: OEM ID: %s ", oem); |
217 | 217 | ||
218 | memcpy(str, mpc->mpc_productid, 12); | 218 | memcpy(str, mpc->mpc_productid, 12); |
219 | str[12] = 0; | 219 | str[12] = 0; |
220 | printk("Product ID: %s ", str); | ||
221 | |||
222 | #ifdef CONFIG_X86_32 | ||
223 | mps_oem_check(mpc, oem, str); | ||
224 | #endif | ||
220 | printk(KERN_INFO "MPTABLE: Product ID: %s ", str); | 225 | printk(KERN_INFO "MPTABLE: Product ID: %s ", str); |
221 | 226 | ||
222 | printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic); | 227 | 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) | |||
231 | /* | 236 | /* |
232 | * Now process the configuration blocks. | 237 | * Now process the configuration blocks. |
233 | */ | 238 | */ |
239 | #ifdef CONFIG_X86_NUMAQ | ||
240 | mpc_record = 0; | ||
241 | #endif | ||
234 | while (count < mpc->mpc_length) { | 242 | while (count < mpc->mpc_length) { |
235 | switch (*mpt) { | 243 | switch (*mpt) { |
236 | case MP_PROCESSOR: | 244 | case MP_PROCESSOR: |
237 | { | 245 | { |
238 | struct mpc_config_processor *m = | 246 | struct mpc_config_processor *m = |
239 | (struct mpc_config_processor *)mpt; | 247 | (struct mpc_config_processor *)mpt; |
248 | /* ACPI may have already provided this data */ | ||
240 | if (!acpi_lapic) | 249 | if (!acpi_lapic) |
241 | MP_processor_info(m); | 250 | MP_processor_info(m); |
242 | mpt += sizeof(*m); | 251 | mpt += sizeof(*m); |
@@ -280,7 +289,15 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) | |||
280 | count += sizeof(*m); | 289 | count += sizeof(*m); |
281 | break; | 290 | break; |
282 | } | 291 | } |
292 | default: | ||
293 | { | ||
294 | count = mpc->mpc_length; | ||
295 | break; | ||
296 | } | ||
283 | } | 297 | } |
298 | #ifdef CONFIG_X86_NUMAQ | ||
299 | ++mpc_record; | ||
300 | #endif | ||
284 | } | 301 | } |
285 | setup_apic_routing(); | 302 | setup_apic_routing(); |
286 | if (!num_processors) | 303 | if (!num_processors) |