diff options
author | Robert Richter <robert.richter@amd.com> | 2008-07-22 15:08:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-26 05:48:01 -0400 |
commit | adf5ec0bca553b763a6b9baed2677a4c7470025b (patch) | |
tree | c3009400fcdd1d0a27ab96e8d9ed6a88535307d4 /arch/x86/oprofile/nmi_int.c | |
parent | 12f2b2610e812627acf338aaf043fef20bb726ca (diff) |
x86/oprofile: introduce model specific init/exit functions
This patch implements model specific OProfile init/exit functions for
x86 CPUs. Though there is more rework needed at the initialization
code, this new introduced functions allow it to keep model specific
code in the corresponding op_model_*.c files.
The function interface is the same as for oprofile_arch_init/exit().
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: oprofile-list <oprofile-list@lists.sourceforge.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/oprofile/nmi_int.c')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 33db99ab90c0..75e889156f23 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -1,10 +1,11 @@ | |||
1 | /** | 1 | /** |
2 | * @file nmi_int.c | 2 | * @file nmi_int.c |
3 | * | 3 | * |
4 | * @remark Copyright 2002 OProfile authors | 4 | * @remark Copyright 2002-2008 OProfile authors |
5 | * @remark Read the file COPYING | 5 | * @remark Read the file COPYING |
6 | * | 6 | * |
7 | * @author John Levon <levon@movementarian.org> | 7 | * @author John Levon <levon@movementarian.org> |
8 | * @author Robert Richter <robert.richter@amd.com> | ||
8 | */ | 9 | */ |
9 | 10 | ||
10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
@@ -411,6 +412,7 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
411 | __u8 vendor = boot_cpu_data.x86_vendor; | 412 | __u8 vendor = boot_cpu_data.x86_vendor; |
412 | __u8 family = boot_cpu_data.x86; | 413 | __u8 family = boot_cpu_data.x86; |
413 | char *cpu_type; | 414 | char *cpu_type; |
415 | int ret = 0; | ||
414 | 416 | ||
415 | if (!cpu_has_apic) | 417 | if (!cpu_has_apic) |
416 | return -ENODEV; | 418 | return -ENODEV; |
@@ -466,6 +468,11 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
466 | return -ENODEV; | 468 | return -ENODEV; |
467 | } | 469 | } |
468 | 470 | ||
471 | if (model->init) | ||
472 | ret = model->init(ops); | ||
473 | if (ret) | ||
474 | return ret; | ||
475 | |||
469 | init_sysfs(); | 476 | init_sysfs(); |
470 | using_nmi = 1; | 477 | using_nmi = 1; |
471 | ops->create_files = nmi_create_files; | 478 | ops->create_files = nmi_create_files; |
@@ -482,4 +489,6 @@ void op_nmi_exit(void) | |||
482 | { | 489 | { |
483 | if (using_nmi) | 490 | if (using_nmi) |
484 | exit_sysfs(); | 491 | exit_sysfs(); |
492 | if (model->exit) | ||
493 | model->exit(); | ||
485 | } | 494 | } |