Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73078
b: refs/heads/master
c: b46378b
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Oct 30, 2007
1 parent 6c02c25 commit b0dfcad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 121fc47db6f4868890225e987447ee59a1e1c5b5
refs/heads/master: b46378bc59989d6d284b569b5e2a28e8a50e70f8
22 changes: 7 additions & 15 deletions trunk/arch/sh/oprofile/op_model_sh7750.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/notifier.h>
#include <asm/uaccess.h>
#include <asm/io.h>

Expand Down Expand Up @@ -44,8 +43,6 @@
*/
#define NR_CNTRS 2

extern const char *get_cpu_subtype(void);

struct op_counter_config {
unsigned long enabled;
unsigned long event;
Expand Down Expand Up @@ -111,17 +108,12 @@ static struct op_counter_config ctr[NR_CNTRS];
* behavior.
*/

static int sh7750_timer_notify(struct notifier_block *self,
unsigned long val, void *regs)
static int sh7750_timer_notify(struct pt_regs *regs)
{
oprofile_add_sample((struct pt_regs *)regs, 0);
oprofile_add_sample(regs, 0);
return 0;
}

static struct notifier_block sh7750_timer_notifier = {
.notifier_call = sh7750_timer_notify,
};

static u64 sh7750_read_counter(int counter)
{
u32 hi, lo;
Expand Down Expand Up @@ -240,15 +232,15 @@ static int sh7750_perf_counter_start(void)
ctrl_outw(pmcr | PMCR_ENABLE, PMCR2);
}

return register_profile_notifier(&sh7750_timer_notifier);
return register_timer_hook(sh7750_timer_notify);
}

static void sh7750_perf_counter_stop(void)
{
ctrl_outw(ctrl_inw(PMCR1) & ~PMCR_PMEN, PMCR1);
ctrl_outw(ctrl_inw(PMCR2) & ~PMCR_PMEN, PMCR2);

unregister_profile_notifier(&sh7750_timer_notifier);
unregister_timer_hook(sh7750_timer_notify);
}

static struct oprofile_operations sh7750_perf_counter_ops = {
Expand All @@ -257,13 +249,13 @@ static struct oprofile_operations sh7750_perf_counter_ops = {
.stop = sh7750_perf_counter_stop,
};

int __init oprofile_arch_init(struct oprofile_operations **ops)
int __init oprofile_arch_init(struct oprofile_operations *ops)
{
if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER))
return -ENODEV;

sh7750_perf_counter_ops.cpu_type = (char *)get_cpu_subtype();
*ops = &sh7750_perf_counter_ops;
ops = &sh7750_perf_counter_ops;
ops->cpu_type = (char *)get_cpu_subtype(&current_cpu_data);

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

0 comments on commit b0dfcad

Please sign in to comment.