Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2022 14:10:27 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fff5fec16b2e - stable/13 - bus.h: rewrite comment describing intr_type
Message-ID:  <202210181410.29IEARnZ001751@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=fff5fec16b2ec42b0cb357fdbb675353e3126f21

commit fff5fec16b2ec42b0cb357fdbb675353e3126f21
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-07 22:21:49 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-18 14:08:21 +0000

    bus.h: rewrite comment describing intr_type
    
    Describe more clearly the purpose of these flags and where they are
    used.
    
    Remove grog's comment about revisiting the flags. At this point it does
    not make sense to change this long-standing API, especially in light of
    2cf7870864ea ("Collapse interrupt thread priorities").
    
    Give a better example of a bus modifying these flags; I did not find any
    existing instance where a bus changes the interrupt's type.
    
    Reviewed by:    imp, markj, jhb
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D36896
    
    (cherry picked from commit af390486010e8fc78c4d715e751cd1175d0752c7)
---
 sys/sys/bus.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 430beaecc6d0..115f20505bae 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -251,17 +251,19 @@ typedef void driver_intr_t(void*);
 
 /**
  * @brief Interrupt type bits.
- * 
- * These flags are used both by newbus interrupt
- * registration (nexus.c) and also in struct intrec, which defines
- * interrupt properties.
  *
- * XXX We should probably revisit this and remove the vestiges of the
- * spls implicit in names like INTR_TYPE_TTY. In the meantime, don't
- * confuse things by renaming them (Grog, 18 July 2000).
+ * These flags may be passed by drivers to bus_setup_intr(9) when
+ * registering a new interrupt handler. The field is overloaded to
+ * specify both the interrupt's type and any special properties.
  *
- * Buses which do interrupt remapping will want to change their type
- * to reflect what sort of devices are underneath.
+ * The INTR_TYPE* bits will be passed to intr_priority(9) to determine
+ * the scheduling priority of the handler's ithread. Historically, each
+ * type was assigned a unique scheduling preference, but now only
+ * INTR_TYPE_CLK receives a default priority higher than other
+ * interrupts. See sys/priority.h.
+ *
+ * Buses may choose to modify or augment these flags as appropriate,
+ * e.g. nexus may apply INTR_EXCL.
  */
 enum intr_type {
 	INTR_TYPE_TTY = 1,



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