summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/sio.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-25 05:19:40 +0000
committerjhb <jhb@FreeBSD.org>2000-10-25 05:19:40 +0000
commitff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f (patch)
treed0f426694e386a2b666529e1e1ad06938c3d7e83 /sys/pc98/cbus/sio.c
parent08451a100d3bc5d4373e28f7acd976df25f3f785 (diff)
downloadFreeBSD-src-ff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f.zip
FreeBSD-src-ff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f.tar.gz
- Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
Diffstat (limited to 'sys/pc98/cbus/sio.c')
-rw-r--r--sys/pc98/cbus/sio.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 8905654..4477cac 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -533,7 +533,8 @@ static int siocnunit;
#endif
static Port_t siogdbiobase;
static int siogdbunit = -1;
-static bool_t sio_registered;
+static struct intrhand *sio_slow_ih;
+static struct intrhand *sio_fast_ih;
static int sio_timeout;
static int sio_timeouts_until_log;
static struct callout_handle sio_timeout_handle
@@ -2083,9 +2084,11 @@ determined_type: ;
printf(" with a bogus IIR_TXRDY register");
printf("\n");
- if (!sio_registered) {
- register_swi(SWI_TTY, siopoll);
- sio_registered = TRUE;
+ if (sio_fast_ih == NULL) {
+ sio_fast_ih = sinthand_add("tty:sio", &tty_ithd, siopoll,
+ NULL, SWI_TTY, 0);
+ sio_slow_ih = sinthand_add("tty:sio", &clk_ithd, siopoll,
+ NULL, SWI_TTY, 0);
}
make_dev(&sio_cdevsw, unit,
UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit);
@@ -2917,7 +2920,7 @@ more_intr:
}
++com->bytes_in;
if (com->hotchar != 0 && recv_data == com->hotchar)
- setsofttty();
+ sched_swi(sio_fast_ih, SWI_NOSWITCH);
ioptr = com->iptr;
if (ioptr >= com->ibufend)
CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW);
@@ -2926,14 +2929,10 @@ more_intr:
microtime(&com->timestamp);
++com_events;
/* XXX - needs to go away when alpha gets ithreads */
-#ifdef __alpha__
- schedsofttty();
-#else
- setsofttty();
-#endif
+ sched_swi(sio_slow_ih, SWI_DELAY);
#if 0 /* for testing input latency vs efficiency */
if (com->iptr - com->ibuf == 8)
- setsofttty();
+ sched_swi(sio_fast_ih, SWI_NOSWITCH);
#endif
ioptr[0] = recv_data;
ioptr[com->ierroff] = line_status;
@@ -2987,7 +2986,7 @@ cont:
if (!(com->state & CS_CHECKMSR)) {
com_events += LOTS_OF_EVENTS;
com->state |= CS_CHECKMSR;
- setsofttty();
+ sched_swi(sio_fast_ih, SWI_NOSWITCH);
}
/* handle CTS change immediately for crisp flow ctl */
@@ -3089,7 +3088,8 @@ cont:
if (!(com->state & CS_ODONE)) {
com_events += LOTS_OF_EVENTS;
com->state |= CS_ODONE;
- setsofttty(); /* handle at high level ASAP */
+ /* handle at high level ASAP */
+ sched_swi(sio_fast_ih, SWI_NOSWITCH);
}
}
if (COM_IIR_TXRDYBUG(com->flags) && (int_ctl != int_ctl_new)) {
OpenPOWER on IntegriCloud