Merge branch 'master' of /home/cbou/linux-2.6
[pandora-kernel.git] / arch / mips / oprofile / op_model_mipsxx.c
index ca65469..54759f1 100644 (file)
@@ -31,6 +31,8 @@
 
 #define M_COUNTER_OVERFLOW             (1UL      << 31)
 
+static int (*save_perf_irq)(void);
+
 #ifdef CONFIG_MIPS_MT_SMP
 static int cpu_has_mipsmt_pertccounters;
 #define WHAT           (M_TC_EN_VPE | \
@@ -279,7 +281,7 @@ static inline int n_counters(void)
 
 static void reset_counters(void *arg)
 {
-       int counters = (int)arg;
+       int counters = (int)(long)arg;
        switch (counters) {
        case 4:
                w_c0_perfctrl3(0);
@@ -311,7 +313,7 @@ static int __init mipsxx_init(void)
        if (!cpu_has_mipsmt_pertccounters)
                counters = counters_total_to_per_cpu(counters);
 #endif
-       on_each_cpu(reset_counters, (void *)counters, 0, 1);
+       on_each_cpu(reset_counters, (void *)(long)counters, 1);
 
        op_model_mipsxx_ops.num_counters = counters;
        switch (current_cpu_type()) {
@@ -369,6 +371,7 @@ static int __init mipsxx_init(void)
                return -ENODEV;
        }
 
+       save_perf_irq = perf_irq;
        perf_irq = mipsxx_perfcount_handler;
 
        return 0;
@@ -379,9 +382,9 @@ static void mipsxx_exit(void)
        int counters = op_model_mipsxx_ops.num_counters;
 
        counters = counters_per_cpu_to_total(counters);
-       on_each_cpu(reset_counters, (void *)counters, 0, 1);
+       on_each_cpu(reset_counters, (void *)(long)counters, 1);
 
-       perf_irq = null_perf_irq;
+       perf_irq = save_perf_irq;
 }
 
 struct op_mips_model op_model_mipsxx_ops = {