Module Name: src Committed By: ryo Date: Fri Jan 15 17:17:05 UTC 2021
Modified Files: src/sys/arch/arm/fdt: pcihost_fdt.c src/sys/dev/fdt: fdt_intr.c fdtvar.h Log Message: add fdtbus_intr_establish_xname() function To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/fdt/pcihost_fdt.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/fdt/fdt_intr.c cvs rdiff -u -r1.65 -r1.66 src/sys/dev/fdt/fdtvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/fdt/pcihost_fdt.c diff -u src/sys/arch/arm/fdt/pcihost_fdt.c:1.18 src/sys/arch/arm/fdt/pcihost_fdt.c:1.19 --- src/sys/arch/arm/fdt/pcihost_fdt.c:1.18 Sat Oct 10 09:58:16 2020 +++ src/sys/arch/arm/fdt/pcihost_fdt.c Fri Jan 15 17:17:04 2021 @@ -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 <jmcne...@invisible.ca> @@ -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 @@ pcihost_intr_establish(void *v, pci_intr 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 Index: src/sys/dev/fdt/fdt_intr.c diff -u src/sys/dev/fdt/fdt_intr.c:1.27 src/sys/dev/fdt/fdt_intr.c:1.28 --- src/sys/dev/fdt/fdt_intr.c:1.27 Fri Jan 15 00:38:23 2021 +++ src/sys/dev/fdt/fdt_intr.c Fri Jan 15 17:17:04 2021 @@ -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 <jmcne...@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 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 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, c * 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 { Index: src/sys/dev/fdt/fdtvar.h diff -u src/sys/dev/fdt/fdtvar.h:1.65 src/sys/dev/fdt/fdtvar.h:1.66 --- src/sys/dev/fdt/fdtvar.h:1.65 Fri Jan 15 00:38:23 2021 +++ src/sys/dev/fdt/fdtvar.h Fri Jan 15 17:17:04 2021 @@ -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 <jmcne...@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 *);