Skip to content

Commit b46378b

Browse files
committed
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>
1 parent 121fc47 commit b46378b

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

‎arch/sh/oprofile/op_model_sh7750.c‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/errno.h>
1717
#include <linux/interrupt.h>
1818
#include <linux/fs.h>
19-
#include <linux/notifier.h>
2019
#include <asm/uaccess.h>
2120
#include <asm/io.h>
2221

@@ -44,8 +43,6 @@
4443
*/
4544
#define NR_CNTRS 2
4645

47-
extern const char *get_cpu_subtype(void);
48-
4946
struct op_counter_config {
5047
unsigned long enabled;
5148
unsigned long event;
@@ -111,17 +108,12 @@ static struct op_counter_config ctr[NR_CNTRS];
111108
* behavior.
112109
*/
113110

114-
static int sh7750_timer_notify(struct notifier_block *self,
115-
unsigned long val, void *regs)
111+
static int sh7750_timer_notify(struct pt_regs *regs)
116112
{
117-
oprofile_add_sample((struct pt_regs *)regs, 0);
113+
oprofile_add_sample(regs, 0);
118114
return 0;
119115
}
120116

121-
static struct notifier_block sh7750_timer_notifier = {
122-
.notifier_call = sh7750_timer_notify,
123-
};
124-
125117
static u64 sh7750_read_counter(int counter)
126118
{
127119
u32 hi, lo;
@@ -240,15 +232,15 @@ static int sh7750_perf_counter_start(void)
240232
ctrl_outw(pmcr | PMCR_ENABLE, PMCR2);
241233
}
242234

243-
return register_profile_notifier(&sh7750_timer_notifier);
235+
return register_timer_hook(sh7750_timer_notify);
244236
}
245237

246238
static void sh7750_perf_counter_stop(void)
247239
{
248240
ctrl_outw(ctrl_inw(PMCR1) & ~PMCR_PMEN, PMCR1);
249241
ctrl_outw(ctrl_inw(PMCR2) & ~PMCR_PMEN, PMCR2);
250242

251-
unregister_profile_notifier(&sh7750_timer_notifier);
243+
unregister_timer_hook(sh7750_timer_notify);
252244
}
253245

254246
static struct oprofile_operations sh7750_perf_counter_ops = {
@@ -257,13 +249,13 @@ static struct oprofile_operations sh7750_perf_counter_ops = {
257249
.stop = sh7750_perf_counter_stop,
258250
};
259251

260-
int __init oprofile_arch_init(struct oprofile_operations **ops)
252+
int __init oprofile_arch_init(struct oprofile_operations *ops)
261253
{
262254
if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER))
263255
return -ENODEV;
264256

265-
sh7750_perf_counter_ops.cpu_type = (char *)get_cpu_subtype();
266-
*ops = &sh7750_perf_counter_ops;
257+
ops = &sh7750_perf_counter_ops;
258+
ops->cpu_type = (char *)get_cpu_subtype(&current_cpu_data);
267259

268260
printk(KERN_INFO "oprofile: using SH-4 (%s) performance monitoring.\n",
269261
sh7750_perf_counter_ops.cpu_type);

0 commit comments

Comments
 (0)