diff options
| author | ryo <ryo@NetBSD.org> | 2021-01-15 17:17:04 +0000 |
|---|---|---|
| committer | ryo <ryo@NetBSD.org> | 2021-01-15 17:17:04 +0000 |
| commit | 4db7df072fc01b7418e0bac3e8adad449ec10fc0 (patch) | |
| tree | d2d2688188c7b0efde582bea6d443d70078dc856 /sys/dev/fdt | |
| parent | 4d1e3d2416a2c7718575351c5616a90188541c72 (diff) | |
add fdtbus_intr_establish_xname() function
Diffstat (limited to 'sys/dev/fdt')
| -rw-r--r-- | sys/dev/fdt/fdt_intr.c | 18 | ||||
| -rw-r--r-- | sys/dev/fdt/fdtvar.h | 8 |
2 files changed, 19 insertions, 7 deletions
diff --git a/sys/dev/fdt/fdt_intr.c b/sys/dev/fdt/fdt_intr.c index 2b7ae98f9df..ffa73f64d8c 100644 --- a/sys/dev/fdt/fdt_intr.c +++ b/sys/dev/fdt/fdt_intr.c @@ -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> @@ -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 @@ void * 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 @@ fdtbus_intr_establish(int phandle, u_int index, int ipl, int flags, return NULL; return fdtbus_intr_establish_raw(ihandle, specifier, ipl, - flags, func, arg); + flags, func, arg, xname); } void * @@ -208,7 +216,7 @@ fdtbus_intr_establish_byname(int phandle, const char *name, int ipl, 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 @@ fdtbus_intr_establish_raw(int ihandle, const u_int *specifier, int ipl, * 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 --git a/sys/dev/fdt/fdtvar.h b/sys/dev/fdt/fdtvar.h index c28463f2b31..f076d8827b9 100644 --- a/sys/dev/fdt/fdtvar.h +++ b/sys/dev/fdt/fdtvar.h @@ -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> @@ -77,6 +77,8 @@ struct fdtbus_interrupt_controller_func { 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_get_i2c_tag(int); 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 *); |
