Date: Sun, 21 Sep 2014 19:34:28 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271935 - projects/arm_intrng/sys/arm/arm Message-ID: <201409211934.s8LJYSUH063793@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sun Sep 21 19:34:28 2014 New Revision: 271935 URL: http://svnweb.freebsd.org/changeset/base/271935 Log: Automatically allocate an ic_intrs array for nexus when it registers; nexus isn't described in the fdt data which usually triggers allocation. Modified: projects/arm_intrng/sys/arm/arm/intrng.c Modified: projects/arm_intrng/sys/arm/arm/intrng.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 19:31:19 2014 (r271934) +++ projects/arm_intrng/sys/arm/arm/intrng.c Sun Sep 21 19:34:28 2014 (r271935) @@ -309,6 +309,21 @@ arm_register_pic(device_t dev, int flags ic->ic_dev = dev; ic->ic_node = node; + /* + * Normally ic_intrs is allocated by arm_fdt_map_irq(), but the nexus + * root isn't described by fdt data. If the node is -1 and the ic_intrs + * array hasn't yet been allocated, we're dealing with nexus, allocate a + * single entry for irq 0. + */ + if (node == -1 && ic->ic_intrs == NULL) { + ic->ic_intrs = malloc(sizeof(struct arm_intr_handler), M_INTRNG, + M_WAITOK | M_ZERO); + ic->ic_maxintrs = 1; + ih = &ic->ic_intrs[0]; + ih->ih_pic = ic; + ih->ih_ncells = 0; + } + debugf("device %s node %08x slot %d\n", device_get_nameunit(dev), ic->ic_node, i);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409211934.s8LJYSUH063793>