From owner-svn-src-projects@FreeBSD.ORG Sun Sep 21 19:34:29 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2580B7D4; Sun, 21 Sep 2014 19:34:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EE2EC4; Sun, 21 Sep 2014 19:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LJYSWN063794; Sun, 21 Sep 2014 19:34:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LJYSUH063793; Sun, 21 Sep 2014 19:34:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409211934.s8LJYSUH063793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Sep 2014 19:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271935 - projects/arm_intrng/sys/arm/arm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 19:34:29 -0000 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);