Skip to content

Commit

Permalink
x86/oprofile/nmi_int: add Nehalem to list of ppro cores
Browse files Browse the repository at this point in the history
..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 <[email protected]>
  • Loading branch information
torvalds committed Jul 25, 2008
1 parent b30f3ae commit 4b9f12a
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions arch/x86/oprofile/nmi_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,20 +369,34 @@ static int __init ppro_init(char **cpu_type)
{
__u8 cpu_model = boot_cpu_data.x86_model;

if (cpu_model == 14)
switch (cpu_model) {
case 0 ... 2:
*cpu_type = "i386/ppro";
break;
case 3 ... 5:
*cpu_type = "i386/pii";
break;
case 6 ... 8:
*cpu_type = "i386/piii";
break;
case 9:
*cpu_type = "i386/p6_mobile";
break;
case 10 ... 13:
*cpu_type = "i386/p6";
break;
case 14:
*cpu_type = "i386/core";
else if (cpu_model == 15 || cpu_model == 23)
break;
case 15: case 23:
*cpu_type = "i386/core_2";
break;
case 26:
*cpu_type = "i386/core_2";
else if (cpu_model > 0xd)
break;
default:
/* Unknown */
return 0;
else if (cpu_model == 9) {
*cpu_type = "i386/p6_mobile";
} else if (cpu_model > 5) {
*cpu_type = "i386/piii";
} else if (cpu_model > 2) {
*cpu_type = "i386/pii";
} else {
*cpu_type = "i386/ppro";
}

model = &op_ppro_spec;
Expand Down

0 comments on commit 4b9f12a

Please sign in to comment.