diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 20:29:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 20:29:00 -0400 |
commit | 4b9f12a3779c548b68bc9af7d94030868ad3aa1b (patch) | |
tree | e9f17f0f37313b2b09a79a66e4b19f8f1bb1b9e6 /arch/x86/oprofile | |
parent | b30f3ae50cd03ef2ff433a5030fbf88dd8323528 (diff) |
x86/oprofile/nmi_int: add Nehalem to list of ppro cores
..otherwise oprofile will fall back on that poor timer interrupt.
Also replace the unreadable chain of if-statements with a "switch()"
statement instead. It generates better code, and is a lot clearer.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 7f3329b55d2e..3f90289410e6 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -369,20 +369,34 @@ static int __init ppro_init(char **cpu_type) | |||
369 | { | 369 | { |
370 | __u8 cpu_model = boot_cpu_data.x86_model; | 370 | __u8 cpu_model = boot_cpu_data.x86_model; |
371 | 371 | ||
372 | if (cpu_model == 14) | 372 | switch (cpu_model) { |
373 | case 0 ... 2: | ||
374 | *cpu_type = "i386/ppro"; | ||
375 | break; | ||
376 | case 3 ... 5: | ||
377 | *cpu_type = "i386/pii"; | ||
378 | break; | ||
379 | case 6 ... 8: | ||
380 | *cpu_type = "i386/piii"; | ||
381 | break; | ||
382 | case 9: | ||
383 | *cpu_type = "i386/p6_mobile"; | ||
384 | break; | ||
385 | case 10 ... 13: | ||
386 | *cpu_type = "i386/p6"; | ||
387 | break; | ||
388 | case 14: | ||
373 | *cpu_type = "i386/core"; | 389 | *cpu_type = "i386/core"; |
374 | else if (cpu_model == 15 || cpu_model == 23) | 390 | break; |
391 | case 15: case 23: | ||
392 | *cpu_type = "i386/core_2"; | ||
393 | break; | ||
394 | case 26: | ||
375 | *cpu_type = "i386/core_2"; | 395 | *cpu_type = "i386/core_2"; |
376 | else if (cpu_model > 0xd) | 396 | break; |
397 | default: | ||
398 | /* Unknown */ | ||
377 | return 0; | 399 | return 0; |
378 | else if (cpu_model == 9) { | ||
379 | *cpu_type = "i386/p6_mobile"; | ||
380 | } else if (cpu_model > 5) { | ||
381 | *cpu_type = "i386/piii"; | ||
382 | } else if (cpu_model > 2) { | ||
383 | *cpu_type = "i386/pii"; | ||
384 | } else { | ||
385 | *cpu_type = "i386/ppro"; | ||
386 | } | 400 | } |
387 | 401 | ||
388 | model = &op_ppro_spec; | 402 | model = &op_ppro_spec; |