git: b34de75d61c2 - stable/13 - Downgrade tty_intr_event from a global

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Wed, 19 Oct 2022 13:50:34 UTC
The branch stable/13 has been updated by mhorne:

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

commit b34de75d61c29e047fc6beaa04f99f96ec64de8a
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-12 16:36:08 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-19 13:46:46 +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
    
    (cherry picked from commit 05b727fee550598bfae5754783f9decfdeeb3c3d)
---
 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 b921004c21ff..449ae224bbe0 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -87,7 +87,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 f099e73e80d9..5feb3ebc9b1f 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 */