From owner-svn-src-head@FreeBSD.ORG Thu Dec 24 12:27:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 209591065670; Thu, 24 Dec 2009 12:27:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 100188FC15; Thu, 24 Dec 2009 12:27:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOCRMkc030242; Thu, 24 Dec 2009 12:27:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOCRM9t030240; Thu, 24 Dec 2009 12:27:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912241227.nBOCRM9t030240@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Dec 2009 12:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200938 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 12:27:23 -0000 Author: marius Date: Thu Dec 24 12:27:22 2009 New Revision: 200938 URL: http://svn.freebsd.org/changeset/base/200938 Log: - Don't check for a valid interrupt controller on every interrupt in intr_execute_handlers(). If we managed to get here without an associated interrupt controller we have way bigger problems. While at it predict stray vector interrupts as false as they are rather unlikely. - Don't blindly call the clear function of an interrupt controller when adding a handler in inthand_add() as interrupt controllers like the one driven by upa(4) are auto-clearing and thus provide NULL instead. Modified: head/sys/sparc64/sparc64/intr_machdep.c Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Thu Dec 24 12:26:13 2009 (r200937) +++ head/sys/sparc64/sparc64/intr_machdep.c Thu Dec 24 12:27:22 2009 (r200938) @@ -276,7 +276,7 @@ intr_execute_handlers(void *cookie) struct intr_vector *iv; iv = cookie; - if (iv->iv_ic == NULL || intr_event_handle(iv->iv_event, NULL) != 0) + if (__predict_false(intr_event_handle(iv->iv_event, NULL) != 0)) intr_stray_vector(iv); } @@ -377,7 +377,8 @@ inthand_add(const char *name, int vec, d #endif ic->ic_enable(iv); /* Ensure the interrupt is cleared, it might have triggered before. */ - ic->ic_clear(iv); + if (ic->ic_clear != NULL) + ic->ic_clear(iv); sx_xunlock(&intr_table_lock); return (0); }