Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt add fdtbus_intr_establish_xname() function



details:   https://anonhg.NetBSD.org/src/rev/6cd0e529c591
branches:  trunk
changeset: 979859:6cd0e529c591
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Jan 15 17:17:04 2021 +0000

description:
add fdtbus_intr_establish_xname() function

diffstat:

 sys/arch/arm/fdt/pcihost_fdt.c |   7 ++++---
 sys/dev/fdt/fdt_intr.c         |  18 +++++++++++++-----
 sys/dev/fdt/fdtvar.h           |   8 ++++++--
 3 files changed, 23 insertions(+), 10 deletions(-)

diffs (120 lines):

diff -r 911db82e7b88 -r 6cd0e529c591 sys/arch/arm/fdt/pcihost_fdt.c
--- a/sys/arch/arm/fdt/pcihost_fdt.c    Fri Jan 15 15:54:20 2021 +0000
+++ b/sys/arch/arm/fdt/pcihost_fdt.c    Fri Jan 15 17:17:04 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcihost_fdt.c,v 1.18 2020/10/10 09:58:16 jmcneill Exp $ */
+/* $NetBSD: pcihost_fdt.c,v 1.19 2021/01/15 17:17:04 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.18 2020/10/10 09:58:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.19 2021/01/15 17:17:04 ryo Exp $");
 
 #include <sys/param.h>
 
@@ -612,7 +612,8 @@
        if (specifier == NULL)
                return NULL;
 
-       return fdtbus_intr_establish_raw(ihandle, specifier, ipl, flags, callback, arg);
+       return fdtbus_intr_establish_raw(ihandle, specifier, ipl, flags,
+           callback, arg, xname);
 }
 
 static void
diff -r 911db82e7b88 -r 6cd0e529c591 sys/dev/fdt/fdt_intr.c
--- a/sys/dev/fdt/fdt_intr.c    Fri Jan 15 15:54:20 2021 +0000
+++ b/sys/dev/fdt/fdt_intr.c    Fri Jan 15 17:17:04 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.27 2021/01/15 00:38:23 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.28 2021/01/15 17:17:04 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.27 2021/01/15 00:38:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.28 2021/01/15 17:17:04 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -181,6 +181,14 @@
 fdtbus_intr_establish(int phandle, u_int index, int ipl, int flags,
     int (*func)(void *), void *arg)
 {
+       return fdtbus_intr_establish_xname(phandle, index, ipl, flags,
+           func, arg, NULL);
+}
+
+void *
+fdtbus_intr_establish_xname(int phandle, u_int index, int ipl, int flags,
+    int (*func)(void *), void *arg, const char *xname)
+{
        const u_int *specifier;
        int ihandle;
 
@@ -189,7 +197,7 @@
                return NULL;
 
        return fdtbus_intr_establish_raw(ihandle, specifier, ipl,
-           flags, func, arg);
+           flags, func, arg, xname);
 }
 
 void *
@@ -208,7 +216,7 @@
 
 void *
 fdtbus_intr_establish_raw(int ihandle, const u_int *specifier, int ipl,
-    int flags, int (*func)(void *), void *arg)
+    int flags, int (*func)(void *), void *arg, const char *xname)
 {
        struct fdtbus_interrupt_controller *ic;
        struct fdtbus_interrupt_cookie *c;
@@ -235,7 +243,7 @@
         * and hope that the device won't actually interrupt until we return.
         */
        ih = ic->ic_funcs->establish(ic->ic_dev, __UNCONST(specifier),
-           ipl, flags, func, arg, NULL);
+           ipl, flags, func, arg, xname);
        if (ih != NULL) {
                atomic_store_release(&c->c_ih, ih);
        } else {
diff -r 911db82e7b88 -r 6cd0e529c591 sys/dev/fdt/fdtvar.h
--- a/sys/dev/fdt/fdtvar.h      Fri Jan 15 15:54:20 2021 +0000
+++ b/sys/dev/fdt/fdtvar.h      Fri Jan 15 17:17:04 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.65 2021/01/15 00:38:23 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.66 2021/01/15 17:17:04 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -77,6 +77,8 @@
        bool    (*intrstr)(device_t, u_int *, char *, size_t);
        void    (*mask)(device_t, void *);
        void    (*unmask)(device_t, void *);
+       void *  (*establish_xname)(device_t, u_int *, int, int,
+                            int (*)(void *), void *, const char *);
 };
 
 struct fdtbus_spi_controller_func {
@@ -317,10 +319,12 @@
 i2c_tag_t      fdtbus_i2c_acquire(int, const char *);
 void *         fdtbus_intr_establish(int, u_int, int, int,
                    int (*func)(void *), void *arg);
+void *         fdtbus_intr_establish_xname(int, u_int, int, int,
+                   int (*func)(void *), void *arg, const char *);
 void *         fdtbus_intr_establish_byname(int, const char *, int, int,
                    int (*func)(void *), void *arg);
 void *         fdtbus_intr_establish_raw(int, const u_int *, int, int,
-                   int (*func)(void *), void *arg);
+                   int (*func)(void *), void *arg, const char *);
 void           fdtbus_intr_mask(int, void *);
 void           fdtbus_intr_unmask(int, void *);
 void           fdtbus_intr_disestablish(int, void *);



Home | Main Index | Thread Index | Old Index