git: 05b727fee550 - main - Downgrade tty_intr_event from a global

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Wed, 12 Oct 2022 16:46:28 UTC
The branch main has been updated by mhorne:

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

commit 05b727fee550598bfae5754783f9decfdeeb3c3d
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-12 16:36:08 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-12 16:46:12 +0000

    Downgrade tty_intr_event from a global
    
    It can be static within uart_tty.c. It is an open question whether there
    remains any real benefit to having uart instances share a swi thread.
    
    Reviewed by:    imp, markj, jhb
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D36938
---
 share/man/man9/swi.9    | 13 +++----------
 sys/dev/uart/uart_tty.c |  3 +++
 sys/kern/kern_intr.c    |  1 -
 sys/sys/interrupt.h     |  1 -
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/share/man/man9/swi.9 b/share/man/man9/swi.9
index 0dfc924325d6..cba8e7dd6742 100644
--- a/share/man/man9/swi.9
+++ b/share/man/man9/swi.9
@@ -35,7 +35,6 @@
 .In sys/param.h
 .In sys/bus.h
 .In sys/interrupt.h
-.Vt "extern struct intr_event *tty_intr_event" ;
 .Vt "extern struct intr_event *clk_intr_event" ;
 .Ft int
 .Fo swi_add
@@ -148,16 +147,10 @@ On platforms allowing IPI sending from NMI context it immediately wakes
 via the IPI, otherwise it works just like SWI_DELAY.
 .El
 .Pp
-The
-.Va tty_intr_event
-and
 .Va clk_intr_event
-variables contain pointers to the software interrupt handlers for the tty and
-clock software interrupts, respectively.
-.Va tty_intr_event
-is used to hang tty software interrupt handlers off of the same thread.
-.Va clk_intr_event
-is used to hang delayed handlers off of the clock interrupt, and is invoked
+is a pointer to the
+.Vt struct intr_event
+used to hang delayed handlers off of the clock interrupt, and is invoked
 directly by
 .Xr hardclock 9 .
 .Sh RETURN VALUES
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index ad7052289f0b..482a392cdb27 100644
--- a/sys/dev/uart/uart_tty.c
+++ b/sys/dev/uart/uart_tty.c
@@ -77,6 +77,9 @@ CONSOLE_DRIVER(
 
 static struct uart_devinfo uart_console;
 
+/* TTY swi(9) event. Allows all uart soft handlers to share one ithread. */
+static struct intr_event *tty_intr_event;
+
 static void
 uart_cnprobe(struct consdev *cp)
 {
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 07515214c9c5..bcd5dc82864e 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -89,7 +89,6 @@ struct	intr_entropy {
 };
 
 struct	intr_event *clk_intr_event;
-struct	intr_event *tty_intr_event;
 struct proc *intrproc;
 
 static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads");
diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h
index edef36e68fc7..ec4f0d214ff9 100644
--- a/sys/sys/interrupt.h
+++ b/sys/sys/interrupt.h
@@ -153,7 +153,6 @@ struct intr_event {
 struct proc;
 
 extern struct	intr_event *clk_intr_event;
-extern struct	intr_event *tty_intr_event;
 
 /* Counts and names for statistics (defined in MD code). */
 extern u_long 	*intrcnt;	/* counts for each device and stray */