aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-10-30 05:24:17 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-10-30 05:24:17 -0400
commitb46378bc59989d6d284b569b5e2a28e8a50e70f8 (patch)
tree56cd6b7b30f05821a1b21f4f056755ad80d84adc
parent121fc47db6f4868890225e987447ee59a1e1c5b5 (diff)
sh: Make SH7750 oprofile compile again.
Converts from the profile notifier to the timer hook. Follows the generic timer interrupt-based change. This really wants to be converted to perfmon.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/oprofile/op_model_sh7750.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/arch/sh/oprofile/op_model_sh7750.c b/arch/sh/oprofile/op_model_sh7750.c
index ebee7e24ede9..6b9a98e07004 100644
--- a/arch/sh/oprofile/op_model_sh7750.c
+++ b/arch/sh/oprofile/op_model_sh7750.c
@@ -16,7 +16,6 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/notifier.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <asm/io.h> 20#include <asm/io.h>
22 21
@@ -44,8 +43,6 @@
44 */ 43 */
45#define NR_CNTRS 2 44#define NR_CNTRS 2
46 45
47extern const char *get_cpu_subtype(void);
48
49struct op_counter_config { 46struct op_counter_config {
50 unsigned long enabled; 47 unsigned long enabled;
51 unsigned long event; 48 unsigned long event;
@@ -111,17 +108,12 @@ static struct op_counter_config ctr[NR_CNTRS];
111 * behavior. 108 * behavior.
112 */ 109 */
113 110
114static int sh7750_timer_notify(struct notifier_block *self, 111static int sh7750_timer_notify(struct pt_regs *regs)
115 unsigned long val, void *regs)
116{ 112{
117 oprofile_add_sample((struct pt_regs *)regs, 0); 113 oprofile_add_sample(regs, 0);
118 return 0; 114 return 0;
119} 115}
120 116
121static struct notifier_block sh7750_timer_notifier = {
122 .notifier_call = sh7750_timer_notify,
123};
124
125static u64 sh7750_read_counter(int counter) 117static u64 sh7750_read_counter(int counter)
126{ 118{
127 u32 hi, lo; 119 u32 hi, lo;
@@ -240,7 +232,7 @@ static int sh7750_perf_counter_start(void)
240 ctrl_outw(pmcr | PMCR_ENABLE, PMCR2); 232 ctrl_outw(pmcr | PMCR_ENABLE, PMCR2);
241 } 233 }
242 234
243 return register_profile_notifier(&sh7750_timer_notifier); 235 return register_timer_hook(sh7750_timer_notify);
244} 236}
245 237
246static void sh7750_perf_counter_stop(void) 238static void sh7750_perf_counter_stop(void)
@@ -248,7 +240,7 @@ static void sh7750_perf_counter_stop(void)
248 ctrl_outw(ctrl_inw(PMCR1) & ~PMCR_PMEN, PMCR1); 240 ctrl_outw(ctrl_inw(PMCR1) & ~PMCR_PMEN, PMCR1);
249 ctrl_outw(ctrl_inw(PMCR2) & ~PMCR_PMEN, PMCR2); 241 ctrl_outw(ctrl_inw(PMCR2) & ~PMCR_PMEN, PMCR2);
250 242
251 unregister_profile_notifier(&sh7750_timer_notifier); 243 unregister_timer_hook(sh7750_timer_notify);
252} 244}
253 245
254static struct oprofile_operations sh7750_perf_counter_ops = { 246static struct oprofile_operations sh7750_perf_counter_ops = {
@@ -257,13 +249,13 @@ static struct oprofile_operations sh7750_perf_counter_ops = {
257 .stop = sh7750_perf_counter_stop, 249 .stop = sh7750_perf_counter_stop,
258}; 250};
259 251
260int __init oprofile_arch_init(struct oprofile_operations **ops) 252int __init oprofile_arch_init(struct oprofile_operations *ops)
261{ 253{
262 if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER)) 254 if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER))
263 return -ENODEV; 255 return -ENODEV;
264 256
265 sh7750_perf_counter_ops.cpu_type = (char *)get_cpu_subtype(); 257 ops = &sh7750_perf_counter_ops;
266 *ops = &sh7750_perf_counter_ops; 258 ops->cpu_type = (char *)get_cpu_subtype(&current_cpu_data);
267 259
268 printk(KERN_INFO "oprofile: using SH-4 (%s) performance monitoring.\n", 260 printk(KERN_INFO "oprofile: using SH-4 (%s) performance monitoring.\n",
269 sh7750_perf_counter_ops.cpu_type); 261 sh7750_perf_counter_ops.cpu_type);