diff options
author | jhb <jhb@FreeBSD.org> | 2000-10-25 05:19:40 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-10-25 05:19:40 +0000 |
commit | ff18363a3e5e60f38c8f7a52c7e7f4ea1c8b797f (patch) | |
tree | d0f426694e386a2b666529e1e1ad06938c3d7e83 /sys/dev/sio/sio.c | |
parent | 08451a100d3bc5d4373e28f7acd976df25f3f785 (diff) | |
download | FreeBSD-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/dev/sio/sio.c')
-rw-r--r-- | sys/dev/sio/sio.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 4c403d1..4dc22ea 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -300,7 +300,7 @@ static void siointr1 __P((struct com_s *com)); static void siointr __P((void *arg)); static int commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); -static swihand_t siopoll; +static void siopoll __P((void *)); static int sioprobe __P((device_t dev, int xrid)); static int sio_isa_probe __P((device_t dev)); static void siosettimeout __P((void)); @@ -413,7 +413,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 @@ -1322,9 +1323,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); } com->devs[0] = make_dev(&sio_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "ttyd%r", unit); @@ -1979,7 +1982,7 @@ siointr1(com) } ++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); @@ -1987,10 +1990,10 @@ siointr1(com) if (com->do_timestamp) microtime(&com->timestamp); ++com_events; - schedsofttty(); + 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; @@ -2028,7 +2031,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 */ @@ -2082,7 +2085,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)) { @@ -2257,7 +2261,7 @@ sioioctl(dev, cmd, data, flag, p) /* software interrupt handler for SWI_TTY */ static void -siopoll() +siopoll(void *dummy) { int unit; int intrsave; |