From owner-svn-src-projects@FreeBSD.ORG Sat Sep 13 15:49:51 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E170CE9D; Sat, 13 Sep 2014 15:49:51 +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 CD7587D8; Sat, 13 Sep 2014 15:49:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DFnpDu090244; Sat, 13 Sep 2014 15:49:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DFnpcW090243; Sat, 13 Sep 2014 15:49:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409131549.s8DFnpcW090243@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 13 Sep 2014 15:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271520 - 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: Sat, 13 Sep 2014 15:49:52 -0000 Author: ian Date: Sat Sep 13 15:49:51 2014 New Revision: 271520 URL: http://svnweb.freebsd.org/changeset/base/271520 Log: Allow the interrupt resource to be NULL for the root interrupt controller. Modified: projects/arm_intrng/sys/arm/arm/nexus.c Modified: projects/arm_intrng/sys/arm/arm/nexus.c ============================================================================== --- projects/arm_intrng/sys/arm/arm/nexus.c Sat Sep 13 15:48:24 2014 (r271519) +++ projects/arm_intrng/sys/arm/arm/nexus.c Sat Sep 13 15:49:51 2014 (r271520) @@ -279,6 +279,25 @@ nexus_setup_intr(device_t dev, device_t { int irq; + /* + * FDT data for a root interrupt controller may have set up interrupt + * resource data indicating nexus as the parent and irq 0, or it may + * have nothing. We handle the latter by allowing a NULL res pointer + * when the INTR_CONTROLLER flag is set. + */ + if (res == NULL) { +#if defined(ARM_INTRNG) + if (flags & INTR_CONTROLLER) { + arm_setup_irqhandler(child, + filt, intr, arg, 0, flags, cookiep); + return (0); + } +#endif + device_printf(child, "NULL resource pointer " + "in nexus_setup_intr\n"); + return (EDOOFUS); + } + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) flags |= INTR_EXCL;