Update of /cvsroot/oprofile/oprofile/module
In directory usw-pr-cvs1:/tmp/cvs-serv32192/module
Modified Files:
op_init.c
Log Message:
finish previous commit
Index: op_init.c
===================================================================
RCS file: /cvsroot/oprofile/oprofile/module/op_init.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- op_init.c 28 Feb 2002 03:33:49 -0000 1.9
+++ op_init.c 28 Feb 2002 03:39:18 -0000 1.10
@@ -21,7 +21,7 @@
EXPORT_NO_SYMBOLS;
-static void __init set_cpu_type(void)
+static __init op_cpu get_cpu_type(void)
{
__u8 vendor = current_cpu_data.x86_vendor;
__u8 family = current_cpu_data.x86;
@@ -29,28 +29,27 @@
/* unknown vendor */
if (vendor != X86_VENDOR_INTEL && vendor != X86_VENDOR_AMD) {
- sysctl.cpu_type = CPU_RTC;
- return;
+ return CPU_RTC;
}
/* not a P6-class processor */
- if (family != 6) {
- sysctl.cpu_type = CPU_RTC;
- return;
- }
-
- /* 0 if PPro, 1 if PII, 2 if PIII, 3 if Athlon */
- if (current_cpu_data.x86_vendor == X86_VENDOR_AMD) {
- sysctl.cpu_type = CPU_ATHLON;
- } else {
- sysctl.cpu_type = (current_cpu_data.x86_model > 5) ? CPU_PIII :
- (current_cpu_data.x86_model > 2);
- }
+ if (family != 6)
+ return CPU_RTC;
+
+ if (vendor == X86_VENDOR_AMD)
+ return CPU_ATHLON;
+
+ if (model > 5)
+ return CPU_PIII;
+ else if (model > 2)
+ return CPU_PII;
+
+ return CPU_PPRO;
}
int __init stub_init(void)
{
- set_cpu_type();
+ sysctl.cpu_type = get_cpu_type();
return oprof_init();
}
|