Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d9e1ae06d8f0bb187ea083fabab2dfb6f589270
Commit:     2d9e1ae06d8f0bb187ea083fabab2dfb6f589270
Parent:     c265a762aa196de11f38f6f44cc817329f32a813
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 19 12:41:22 2006 +0000
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Tue Feb 6 16:46:44 2007 +0000

    [ARM] oprofile: add ARM11 UP support
    
    Add oprofile glue for ARM11 (ARMv6) oprofile support.  This
    connects the ARM11 core profiling support to the oprofile code
    for uniprocessor configurations.
    
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/oprofile/Kconfig        |   10 ++++++
 arch/arm/oprofile/Makefile       |    1 +
 arch/arm/oprofile/common.c       |    4 ++
 arch/arm/oprofile/op_arm_model.h |    2 +
 arch/arm/oprofile/op_model_v6.c  |   67 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/arch/arm/oprofile/Kconfig b/arch/arm/oprofile/Kconfig
index 615a6b9..40cc189 100644
--- a/arch/arm/oprofile/Kconfig
+++ b/arch/arm/oprofile/Kconfig
@@ -19,8 +19,18 @@ config OPROFILE
 
          If unsure, say N.
 
+if OPROFILE
+
+config OPROFILE_ARMV6
+       bool
+       depends on CPU_V6 && !SMP
+       default y
+       select OPROFILE_ARM11_CORE
+
 config OPROFILE_ARM11_CORE
        bool
 
+endif
+
 endmenu
 
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile
index 30352d6..3d5ff30 100644
--- a/arch/arm/oprofile/Makefile
+++ b/arch/arm/oprofile/Makefile
@@ -9,3 +9,4 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
 oprofile-y                             := $(DRIVER_OBJS) common.o backtrace.o
 oprofile-$(CONFIG_CPU_XSCALE)          += op_model_xscale.o
 oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o
+oprofile-$(CONFIG_OPROFILE_ARMV6)      += op_model_v6.o
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 6f83335..f1b24fb 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -135,6 +135,10 @@ int __init oprofile_arch_init(struct oprofile_operations 
*ops)
        spec = &op_xscale_spec;
 #endif
 
+#ifdef CONFIG_OPROFILE_ARMV6
+       spec = &op_armv6_spec;
+#endif
+
        if (spec) {
                ret = spec->init();
                if (ret < 0)
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h
index 38c6ad1..ad1c962 100644
--- a/arch/arm/oprofile/op_arm_model.h
+++ b/arch/arm/oprofile/op_arm_model.h
@@ -24,6 +24,8 @@ struct op_arm_model_spec {
 extern struct op_arm_model_spec op_xscale_spec;
 #endif
 
+extern struct op_arm_model_spec op_armv6_spec;
+
 extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
 
 extern int __init op_arm_init(struct oprofile_operations *ops, struct 
op_arm_model_spec *spec);
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c
new file mode 100644
index 0000000..fe58138
--- /dev/null
+++ b/arch/arm/oprofile/op_model_v6.c
@@ -0,0 +1,67 @@
+/**
+ * @file op_model_v6.c
+ * ARM11 Performance Monitor Driver
+ *
+ * Based on op_model_xscale.c
+ *
+ * @remark Copyright 2000-2004 Deepak Saxena <[EMAIL PROTECTED]>
+ * @remark Copyright 2000-2004 MontaVista Software Inc
+ * @remark Copyright 2004 Dave Jiang <[EMAIL PROTECTED]>
+ * @remark Copyright 2004 Intel Corporation
+ * @remark Copyright 2004 Zwane Mwaikambo <[EMAIL PROTECTED]>
+ * @remark Copyright 2004 OProfile Authors
+ *
+ * @remark Read the file COPYING
+ *
+ * @author Tony Lindgren <[EMAIL PROTECTED]>
+ */
+
+/* #define DEBUG */
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/oprofile.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+
+#include "op_counter.h"
+#include "op_arm_model.h"
+#include "op_model_arm11_core.h"
+
+static int irqs[] = {
+#ifdef CONFIG_ARCH_OMAP2
+       3,
+#endif
+};
+
+static void armv6_pmu_stop(void)
+{
+       arm11_stop_pmu();
+       arm11_release_interrupts(irqs, ARRAY_SIZE(irqs));
+}
+
+static int armv6_pmu_start(void)
+{
+       int ret;
+
+       ret = arm11_request_interrupts(irqs, ARRAY_SIZE(irqs));
+       if (ret >= 0)
+               ret = arm11_start_pmu();
+
+       return ret;
+}
+
+static int armv6_detect_pmu(void)
+{
+       return 0;
+}
+
+struct op_arm_model_spec op_armv6_spec = {
+       .init           = armv6_detect_pmu,
+       .num_counters   = 3,
+       .setup_ctrs     = arm11_setup_pmu,
+       .start          = armv6_pmu_start,
+       .stop           = armv6_pmu_stop,
+       .name           = "arm/armv6",
+};
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to