Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/arm/ti Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/b2b961f4f8c3
branches:  netbsd-9
changeset: 1001496:b2b961f4f8c3
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Feb 20 14:36:38 2020 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #711):

        sys/arch/arm/ti/if_cpsw.c: revision 1.9

Fix KERNHIST build (and simplify)

diffstat:

 sys/arch/arm/ti/if_cpsw.c |  37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 deletions(-)

diffs (124 lines):

diff -r afc5dc8011e8 -r b2b961f4f8c3 sys/arch/arm/ti/if_cpsw.c
--- a/sys/arch/arm/ti/if_cpsw.c Sun Feb 16 12:21:24 2020 +0000
+++ b/sys/arch/arm/ti/if_cpsw.c Thu Feb 20 14:36:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.6.2.2 2020/01/28 11:01:37 martin Exp $   */
+/*     $NetBSD: if_cpsw.c,v 1.6.2.3 2020/02/20 14:36:38 martin Exp $   */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.6.2.2 2020/01/28 11:01:37 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.6.2.3 2020/02/20 14:36:38 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -174,19 +174,14 @@
 CFATTACH_DECL_NEW(cpsw, sizeof(struct cpsw_softc),
     cpsw_match, cpsw_attach, cpsw_detach, NULL);
 
-#undef KERNHIST
 #include <sys/kernhist.h>
 KERNHIST_DEFINE(cpswhist);
 
-#ifdef KERNHIST
-#define KERNHIST_CALLED_5(NAME, i, j, k, l) \
-do { \
-       _kernhist_call = atomic_inc_uint_nv(&_kernhist_cnt); \
-       KERNHIST_LOG(NAME, "called! %x %x %x %x", i, j, k, l); \
-} while (/*CONSTCOND*/ 0)
-#else
-#define KERNHIST_CALLED_5(NAME, i, j, k, l)
-#endif
+#define CPSWHIST_CALLARGS(A,B,C,D)     do {                                    \
+           KERNHIST_CALLARGS(cpswhist, "%jx %jx %jx %jx",                      \
+               (uintptr_t)(A), (uintptr_t)(B), (uintptr_t)(C), (uintptr_t)(D));\
+       } while (0)
+
 
 static inline u_int
 cpsw_txdesc_adjust(u_int x, int y)
@@ -219,7 +214,7 @@
        const bus_size_t o = sizeof(struct cpsw_cpdma_bd) * i + 0;
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, n, 0);
+       CPSWHIST_CALLARGS(sc, i, n, 0);
 
        bus_space_write_4(sc->sc_bst, sc->sc_bsh_txdescs, o, n);
 }
@@ -230,7 +225,7 @@
        const bus_size_t o = sizeof(struct cpsw_cpdma_bd) * i + 0;
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, n, 0);
+       CPSWHIST_CALLARGS(sc, i, n, 0);
 
        bus_space_write_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, n);
 }
@@ -244,7 +239,7 @@
        const bus_size_t c = __arraycount(bdp->word);
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+       CPSWHIST_CALLARGS(sc, i, bdp, 0);
 
        bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_txdescs, o, dp, c);
        KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
@@ -260,7 +255,7 @@
        const bus_size_t c = __arraycount(bdp->word);
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+       CPSWHIST_CALLARGS(sc, i, bdp, 0);
        KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
            dp[0], dp[1], dp[2], dp[3]);
 
@@ -276,7 +271,7 @@
        const bus_size_t c = __arraycount(bdp->word);
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+       CPSWHIST_CALLARGS(sc, i, bdp, 0);
 
        bus_space_read_region_4(sc->sc_bst, sc->sc_bsh_rxdescs, o, dp, c);
 
@@ -293,7 +288,7 @@
        const bus_size_t c = __arraycount(bdp->word);
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, i, bdp, 0);
+       CPSWHIST_CALLARGS(sc, i, bdp, 0);
        KERNHIST_LOG(cpswhist, "%08x %08x %08x %08x\n",
            dp[0], dp[1], dp[2], dp[3]);
 
@@ -607,7 +602,7 @@
        u_int mlen;
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+       CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
        if (__predict_false((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) !=
            IFF_RUNNING)) {
@@ -1140,7 +1135,7 @@
        u_int len, off;
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+       CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
        for (;;) {
                KASSERT(sc->sc_rxhead < CPSW_NRXDESCS);
@@ -1225,7 +1220,7 @@
        u_int cpi;
 
        KERNHIST_FUNC(__func__);
-       KERNHIST_CALLED_5(cpswhist, sc, 0, 0, 0);
+       CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
        KASSERT(sc->sc_txrun);
 



Home | Main Index | Thread Index | Old Index