Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm * PMC_TYPE_I80200 -> PMC_CLASS_I80200 to reflec...



details:   https://anonhg.NetBSD.org/src/rev/132ec970cf15
branches:  trunk
changeset: 535054:132ec970cf15
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Aug 09 05:27:09 2002 +0000

description:
* PMC_TYPE_I80200 -> PMC_CLASS_I80200 to reflect the terminology
  used in pmc(3).
* Some minor namespace cleanup.

diffstat:

 sys/arch/arm/include/pmc.h       |    4 +-
 sys/arch/arm/xscale/xscale_pmc.c |  112 ++++++++++++++++----------------------
 2 files changed, 48 insertions(+), 68 deletions(-)

diffs (285 lines):

diff -r 0132dbd4b425 -r 132ec970cf15 sys/arch/arm/include/pmc.h
--- a/sys/arch/arm/include/pmc.h        Fri Aug 09 05:10:45 2002 +0000
+++ b/sys/arch/arm/include/pmc.h        Fri Aug 09 05:27:09 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmc.h,v 1.2 2002/08/07 21:11:36 thorpej Exp $  */
+/*     $NetBSD: pmc.h,v 1.3 2002/08/09 05:27:10 thorpej Exp $  */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #ifndef _ARM_PMC_H_
 #define        _ARM_PMC_H_
 
-#define        PMC_TYPE_I80200         0x10000         /* i80200-compatible */
+#define        PMC_CLASS_I80200        0x10000         /* i80200-compatible */
 #define        PMC_TYPE_I80200_CCNT    0x10001         /* cycle counter */
 #define        PMC_TYPE_I80200_PMCx    0x10002         /* performance counter */
 
diff -r 0132dbd4b425 -r 132ec970cf15 sys/arch/arm/xscale/xscale_pmc.c
--- a/sys/arch/arm/xscale/xscale_pmc.c  Fri Aug 09 05:10:45 2002 +0000
+++ b/sys/arch/arm/xscale/xscale_pmc.c  Fri Aug 09 05:27:09 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xscale_pmc.c,v 1.3 2002/08/08 18:23:46 briggs Exp $    */
+/*     $NetBSD: xscale_pmc.c,v 1.4 2002/08/09 05:27:09 thorpej Exp $   */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xscale_pmc.c,v 1.3 2002/08/08 18:23:46 briggs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xscale_pmc.c,v 1.4 2002/08/09 05:27:09 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -50,46 +50,6 @@
 
 extern int     profsrc;
 
-void   xscale_fork(struct proc *p1, struct proc *p2);
-int    xscale_num_counters(void);
-int    xscale_counter_type(int ctr);
-void   xscale_save_context(struct proc *p);
-void   xscale_restore_context(struct proc *p);
-void   xscale_enable_counter(struct proc *p, int ctr);
-void   xscale_disable_counter(struct proc *p, int ctr);
-void   xscale_accumulate(struct proc *parent, struct proc *child);
-void   xscale_process_exit(struct proc *p);
-int    xscale_configure_counter(struct proc *p, int ctr,
-                                struct pmc_counter_cfg *cfg);
-int    xscale_get_counter_value(struct proc *p, int ctr, int flags,
-                                uint64_t *pval);
-int    xscale_counter_isconfigured(struct proc *p, int ctr);
-int    xscale_counter_isrunning(struct proc *p, int ctr);
-int    xscale_start_profiling(int ctr, struct pmc_counter_cfg *cfg);
-int    xscale_stop_profiling(int ctr);
-int    xscale_alloc_kernel_counter(int ctr, struct pmc_counter_cfg *cfg);
-int    xscale_free_kernel_counter(int ctr);
-
-struct arm_pmc_funcs xscale_pmc_funcs = {
-       xscale_fork,
-       xscale_num_counters,
-       xscale_counter_type,
-       xscale_save_context,
-       xscale_restore_context,
-       xscale_enable_counter,
-       xscale_disable_counter,
-       xscale_accumulate,
-       xscale_process_exit,
-       xscale_configure_counter,
-       xscale_get_counter_value,
-       xscale_counter_isconfigured,
-       xscale_counter_isrunning,
-       xscale_start_profiling,
-       xscale_stop_profiling,
-       xscale_alloc_kernel_counter,
-       xscale_free_kernel_counter
-};
-
 struct xscale_pmc_state {
        uint32_t        pmnc;           /* performance monitor ctrl */
        uint32_t        pmcr[3];        /* array of counter reset values */
@@ -113,12 +73,6 @@
 
 int            pmc_usecount[3] = {0, 0, 0};
 
-void
-xscale_pmu_init(void)
-{
-       arm_pmc = &xscale_pmc_funcs;
-}
-
 static __inline uint32_t
 xscale_pmnc_read(void)
 {
@@ -225,7 +179,7 @@
        return 1;
 }
 
-void
+static void
 xscale_fork(struct proc *p1, struct proc *p2)
 {
        struct xscale_pmc_state *pmcs_p1, *pmcs_p2;
@@ -258,13 +212,13 @@
                pmc_usecount[__PMC1_I]++;
 }
 
-int
+static int
 xscale_num_counters(void)
 {
        return __PMC_NCTRS;
 }
 
-int
+static int
 xscale_counter_type(int ctr)
 {
        int     ret;
@@ -278,7 +232,7 @@
                ret = PMC_TYPE_I80200_PMCx;
                break;
        case -1:
-               ret = PMC_TYPE_I80200;
+               ret = PMC_CLASS_I80200;
                break;
        default:
                ret = -1;
@@ -288,7 +242,7 @@
        return ret;
 }
 
-void
+static void
 xscale_save_context(struct proc *p)
 {
        struct xscale_pmc_state *pmcs;
@@ -334,7 +288,7 @@
        }
 }
 
-void
+static void
 xscale_restore_context(struct proc *p)
 {
        struct xscale_pmc_state *pmcs;
@@ -376,7 +330,7 @@
        }
 }
 
-void
+static void
 xscale_accumulate(struct proc *parent, struct proc *child)
 {
        struct xscale_pmc_state *pmcs_parent, *pmcs_child;
@@ -391,7 +345,7 @@
        }
 }
 
-void
+static void
 xscale_process_exit(struct proc *p)
 {
        int     i;
@@ -411,7 +365,7 @@
        p->p_md.pmc_enabled = 0;
 }
 
-void
+static void
 xscale_enable_counter(struct proc *p, int ctr)
 {
 
@@ -430,7 +384,7 @@
                pmc_restore_context(p);
 }
 
-void
+static void
 xscale_disable_counter(struct proc *p, int ctr)
 {
 
@@ -449,7 +403,7 @@
                pmc_restore_context(p);
 }
 
-int
+static int
 xscale_counter_isrunning(struct proc *p, int ctr)
 {
 
@@ -459,14 +413,14 @@
        return ((pmc_kernel_enabled | p->p_md.pmc_enabled) & (1 << ctr));
 }
 
-int
+static int
 xscale_counter_isconfigured(struct proc *p, int ctr)
 {
 
        return ((ctr >= 0) && (ctr < __PMC_NCTRS));
 }
 
-int
+static int
 xscale_configure_counter(struct proc *p, int ctr, struct pmc_counter_cfg *cfg)
 {
        struct xscale_pmc_state *pmcs;
@@ -524,7 +478,7 @@
        return 0;
 }
 
-int
+static int
 xscale_get_counter_value(struct proc *p, int ctr, int flags, uint64_t *pval)
 {
        struct xscale_pmc_state *pmcs;
@@ -569,7 +523,7 @@
        return 0;
 }
 
-int
+static int
 xscale_start_profiling(int ctr, struct pmc_counter_cfg *cfg)
 {
        int s;
@@ -637,7 +591,7 @@
        return 0;
 }
 
-int
+static int
 xscale_stop_profiling(int ctr)
 {
        uint32_t save;
@@ -676,7 +630,7 @@
        return 0;
 }
 
-int
+static int
 xscale_alloc_kernel_counter(int ctr, struct pmc_counter_cfg *cfg)
 {
        if (ctr < 0 || ctr >= __PMC_NCTRS)
@@ -727,7 +681,7 @@
        return 0;
 }
 
-int
+static int
 xscale_free_kernel_counter(int ctr)
 {
        if (ctr < 0 || ctr >= __PMC_NCTRS)
@@ -740,3 +694,29 @@
 
        return 0;
 }
+
+struct arm_pmc_funcs xscale_pmc_funcs = {
+       xscale_fork,
+       xscale_num_counters,
+       xscale_counter_type,
+       xscale_save_context,
+       xscale_restore_context,
+       xscale_enable_counter,
+       xscale_disable_counter,
+       xscale_accumulate,
+       xscale_process_exit,
+       xscale_configure_counter,
+       xscale_get_counter_value,
+       xscale_counter_isconfigured,
+       xscale_counter_isrunning,
+       xscale_start_profiling,
+       xscale_stop_profiling,
+       xscale_alloc_kernel_counter,
+       xscale_free_kernel_counter
+};
+
+void
+xscale_pmu_init(void)
+{
+       arm_pmc = &xscale_pmc_funcs;
+}



Home | Main Index | Thread Index | Old Index