Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 2020 09:49:07 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
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
Message-ID:  <202012140949.0BE9n7xL078185@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012140949.0BE9n7xL078185>