From owner-svn-src-stable-12@freebsd.org Mon Dec 14 09:49:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7955A4B4D3D; Mon, 14 Dec 2020 09:49:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cvc6X30qsz4fDm; Mon, 14 Dec 2020 09:49:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59F001FB41; Mon, 14 Dec 2020 09:49:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BE9n8Q0078188; Mon, 14 Dec 2020 09:49:08 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BE9n7xL078185; Mon, 14 Dec 2020 09:49:07 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202012140949.0BE9n7xL078185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 14 Dec 2020 09:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368628 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 368628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2020 09:49:08 -0000 Author: mmel Date: Mon Dec 14 09:49:07 2020 New Revision: 368628 URL: https://svnweb.freebsd.org/changeset/base/368628 Log: MFC r367447: Add a method to determine whether given interrupt is per CPU or not. Modified: stable/12/sys/kern/subr_intr.c stable/12/sys/sys/intr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_intr.c ============================================================================== --- stable/12/sys/kern/subr_intr.c Mon Dec 14 04:52:17 2020 (r368627) +++ stable/12/sys/kern/subr_intr.c Mon Dec 14 09:49:07 2020 (r368628) @@ -934,6 +934,21 @@ intr_resolve_irq(device_t dev, intptr_t xref, struct i } } +bool +intr_is_per_cpu(struct resource *res) +{ + u_int res_id; + struct intr_irqsrc *isrc; + + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); + + if (isrc == NULL) + panic("Attempt to get isrc for non-active resource id: %u\n", + res_id); + return ((isrc->isrc_flags & INTR_ISRCF_PPI) != 0); +} + int intr_activate_irq(device_t dev, struct resource *res) { Modified: stable/12/sys/sys/intr.h ============================================================================== --- stable/12/sys/sys/intr.h Mon Dec 14 04:52:17 2020 (r368627) +++ stable/12/sys/sys/intr.h Mon Dec 14 09:49:07 2020 (r368628) @@ -113,6 +113,7 @@ int intr_pic_deregister(device_t, intptr_t); int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int); struct intr_pic *intr_pic_add_handler(device_t, struct intr_pic *, intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t); +bool intr_is_per_cpu(struct resource *); extern device_t intr_irq_root_dev;