From owner-svn-src-head@FreeBSD.ORG Thu Mar 22 17:47:53 2012 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 8710D106564A; Thu, 22 Mar 2012 17:47:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C238FC24; Thu, 22 Mar 2012 17:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MHlraD034822; Thu, 22 Mar 2012 17:47:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2MHlrKn034819; Thu, 22 Mar 2012 17:47:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203221747.q2MHlrKn034819@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 22 Mar 2012 17:47:53 +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: r233318 - in head/sys/mips: atheros mips 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, 22 Mar 2012 17:47:53 -0000 Author: gonzo Date: Thu Mar 22 17:47:52 2012 New Revision: 233318 URL: http://svn.freebsd.org/changeset/base/233318 Log: Move PMC hook invocation to cpu_intr. The idea is the same as with ast() call but there is no reason to implement it in assembler. Modified: head/sys/mips/atheros/apb.c head/sys/mips/mips/intr_machdep.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Thu Mar 22 17:44:36 2012 (r233317) +++ head/sys/mips/atheros/apb.c Thu Mar 22 17:47:52 2012 (r233318) @@ -348,7 +348,6 @@ apb_filter(void *arg) uint32_t reg, irq; struct thread *td; struct trapframe *tf; - register_t s; reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS); for (irq = 0; irq < APB_NIRQS; irq++) { @@ -373,28 +372,12 @@ apb_filter(void *arg) td = PCPU_GET(curthread); tf = td->td_intr_frame; - s = intr_disable(); + if (pmc_intr) + (*pmc_intr)(PCPU_GET(cpuid), tf); + mips_intrcnt_inc(sc->sc_intr_counter[irq]); - if (pmc_intr) { - /* - * Make sure at least one of counters - * generated this interrupt - */ - if (!(*pmc_intr)(PCPU_GET(cpuid), tf)) { - intr_restore(s); - continue; - } - } - - intr_restore(s); - - if (pmc_hook && (td->td_pflags & TDP_CALLCHAIN)) - pmc_hook(PCPU_GET(curthread), - PMC_FN_USER_CALLCHAIN, tf); - continue; - } /* Ignore timer interrupts */ if (irq != 0) Modified: head/sys/mips/mips/intr_machdep.c ============================================================================== --- head/sys/mips/mips/intr_machdep.c Thu Mar 22 17:44:36 2012 (r233317) +++ head/sys/mips/mips/intr_machdep.c Thu Mar 22 17:47:52 2012 (r233318) @@ -29,10 +29,14 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_hwpmc_hooks.h" + #include #include #include #include +#include +#include #include #include @@ -266,4 +270,9 @@ cpu_intr(struct trapframe *tf) KASSERT(i == 0, ("all interrupts handled")); critical_exit(); + +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif }