<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Greg Banks &lt;gnb@melbourne.sgi.com&gt;

oprofile arm arch updates, including some internal API changes.

Signed-off-by: John Levon &lt;levon@movementarian.org&gt;
Signed-off-by: Greg Banks &lt;gnb@melbourne.sgi.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/arch/arm/oprofile/common.c          |   21 ++++++++-------------
 25-akpm/arch/arm/oprofile/init.c            |    7 ++-----
 25-akpm/arch/arm/oprofile/op_model_xscale.c |    5 ++---
 3 files changed, 12 insertions(+), 21 deletions(-)

diff -puN arch/arm/oprofile/common.c~oprofile-update-arm-for-api-changes arch/arm/oprofile/common.c
--- 25/arch/arm/oprofile/common.c~oprofile-update-arm-for-api-changes	Tue Nov  9 13:55:29 2004
+++ 25-akpm/arch/arm/oprofile/common.c	Tue Nov  9 13:55:29 2004
@@ -24,14 +24,6 @@ static int pmu_setup(void);
 static void pmu_stop(void);
 static int pmu_create_files(struct super_block *, struct dentry *);
 
-static struct oprofile_operations pmu_ops = {
-	.create_files	= pmu_create_files,
-	.setup		= pmu_setup,
-	.shutdown	= pmu_stop,
-	.start		= pmu_start,
-	.stop		= pmu_stop,
-};
-
 #ifdef CONFIG_PM
 static struct sys_device device_oprofile = {
 	.id		= 0,
@@ -113,19 +105,22 @@ static void pmu_stop(void)
 	up(&amp;pmu_sem);
 }
 
-int __init pmu_init(struct oprofile_operations **ops, struct op_arm_model_spec *spec)
+void __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec)
 {
 	init_MUTEX(&amp;pmu_sem);
 
 	if (spec-&gt;init() &lt; 0)
-		return -ENODEV;
+		return;
 
 	pmu_model = spec;
 	init_driverfs();
-	*ops = &amp;pmu_ops;
-	pmu_ops.cpu_type = pmu_model-&gt;name;
+	ops-&gt;create_files = pmu_create_files;
+	ops-&gt;setup = pmu_setup;
+	ops-&gt;shutdown = pmu_stop;
+	ops-&gt;start = pmu_start;
+	ops-&gt;stop = pmu_stop;
+	ops-&gt;cpu_type = pmu_model-&gt;name;
 	printk(KERN_INFO "oprofile: using %s PMU\n", spec-&gt;name);
-	return 0;
 }
 
 void pmu_exit(void)
diff -puN arch/arm/oprofile/init.c~oprofile-update-arm-for-api-changes arch/arm/oprofile/init.c
--- 25/arch/arm/oprofile/init.c~oprofile-update-arm-for-api-changes	Tue Nov  9 13:55:29 2004
+++ 25-akpm/arch/arm/oprofile/init.c	Tue Nov  9 13:55:29 2004
@@ -12,14 +12,11 @@
 #include &lt;linux/errno.h&gt;
 #include "op_arm_model.h"
 
-int __init oprofile_arch_init(struct oprofile_operations **ops)
+void __init oprofile_arch_init(struct oprofile_operations *ops)
 {
-	int ret = -ENODEV;
-
 #ifdef CONFIG_CPU_XSCALE
-	ret = pmu_init(ops, &amp;op_xscale_spec);
+	pmu_init(ops, &amp;op_xscale_spec);
 #endif
-	return ret;
 }
 
 void oprofile_arch_exit(void)
diff -puN arch/arm/oprofile/op_model_xscale.c~oprofile-update-arm-for-api-changes arch/arm/oprofile/op_model_xscale.c
--- 25/arch/arm/oprofile/op_model_xscale.c~oprofile-update-arm-for-api-changes	Tue Nov  9 13:55:29 2004
+++ 25-akpm/arch/arm/oprofile/op_model_xscale.c	Tue Nov  9 13:55:29 2004
@@ -343,8 +343,7 @@ static void inline __xsc2_check_ctrs(voi
 
 static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
 {
-	unsigned long pc = profile_pc(regs);
-	int i, is_kernel = !user_mode(regs);
+	int i;
 	u32 pmnc;
 
 	if (pmu-&gt;id == PMU_XSC1)
@@ -357,7 +356,7 @@ static irqreturn_t xscale_pmu_interrupt(
 			continue;
 
 		write_counter(i, -(u32)results[i].reset_counter);
-		oprofile_add_sample(pc, is_kernel, i, smp_processor_id());
+		oprofile_add_sample(regs, i);
 		results[i].ovf--;
 	}
 
_
</pre></body></html>