svn commit: r271935 - projects/arm_intrng/sys/arm/arm
Ian Lepore
ian at FreeBSD.org
Sun Sep 21 19:34:29 UTC 2014
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);
More information about the svn-src-projects
mailing list