diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cy/cy.c | 31 | ||||
-rw-r--r-- | sys/dev/cy/cy_isa.c | 31 | ||||
-rw-r--r-- | sys/dev/rc/rc.c | 13 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 26 |
4 files changed, 55 insertions, 46 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 8b49cfa..3cd2b6f 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -133,7 +133,7 @@ #define siosetwater cysetwater #define comstop cystop #define siowrite cywrite -#define sio_registered cy_registered +#define sio_irec cy_irec #define sio_timeout cy_timeout #define sio_timeout_handle cy_timeout_handle #define sio_timeouts_until_log cy_timeouts_until_log @@ -391,7 +391,7 @@ static struct cdevsw sio_cdevsw = { static int comconsole = -1; static speed_t comdefaultrate = TTYDEF_SPEED; static u_int com_events; /* input chars + weighted output completions */ -static bool_t sio_registered; +static struct intrhand *sio_ih; static int sio_timeout; static int sio_timeouts_until_log; static struct callout_handle sio_timeout_handle @@ -607,10 +607,10 @@ cyattach_common(cy_iobase, cy_align) com_addr(unit) = com; splx(s); - if (!sio_registered) { + if (sio_ih == NULL) cdevsw_add(&sio_cdevsw); - register_swi(SWI_TTY, siopoll); - sio_registered = TRUE; + sio_ih = sinthand_add("tty:sio", &tty_ithd, siopoll, NULL, + SWI_TTY, 0); } make_dev(&sio_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter, @@ -1174,7 +1174,8 @@ siointr(unit) #ifndef SOFT_HOTCHAR if (line_status & CD1400_RDSR_SPECIAL && com->hotchar != 0) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); + #endif #if 1 /* XXX "intelligent" PFO error handling would break O error handling */ if (line_status & (LSR_PE|LSR_FE|LSR_BI)) { @@ -1201,7 +1202,7 @@ siointr(unit) ++com->bytes_in; #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr = com->iptr; if (ioptr >= com->ibufend) @@ -1251,7 +1252,7 @@ siointr(unit) if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = 0; @@ -1266,7 +1267,7 @@ siointr(unit) #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif } while (--count != 0); } else { @@ -1291,7 +1292,7 @@ siointr(unit) #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = 0; @@ -1356,7 +1357,7 @@ cont: if (!(com->state & CS_CHECKMSR)) { com_events += LOTS_OF_EVENTS; com->state |= CS_CHECKMSR; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } #ifdef SOFT_CTS_OFLOW @@ -1487,7 +1488,7 @@ cont: if (!(com->state & CS_ODONE)) { com_events += LOTS_OF_EVENTS; com->state |= CS_ODONE; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } break; case ETC_BREAK_ENDED: @@ -1501,7 +1502,7 @@ cont: if (!(com->extra_state & CSE_ODONE)) { com_events += LOTS_OF_EVENTS; com->extra_state |= CSE_ODONE; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } cd_outb(iobase, CD1400_SRER, cy_align, com->intr_enable @@ -1559,7 +1560,7 @@ cont: com->state |= CS_ODONE; /* handle at high level ASAP */ - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } } } @@ -1579,7 +1580,7 @@ terminate_tx_service: /* ensure an edge for the next interrupt */ cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0); - schedsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); COM_UNLOCK(); } diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index 8b49cfa..3cd2b6f 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -133,7 +133,7 @@ #define siosetwater cysetwater #define comstop cystop #define siowrite cywrite -#define sio_registered cy_registered +#define sio_irec cy_irec #define sio_timeout cy_timeout #define sio_timeout_handle cy_timeout_handle #define sio_timeouts_until_log cy_timeouts_until_log @@ -391,7 +391,7 @@ static struct cdevsw sio_cdevsw = { static int comconsole = -1; static speed_t comdefaultrate = TTYDEF_SPEED; static u_int com_events; /* input chars + weighted output completions */ -static bool_t sio_registered; +static struct intrhand *sio_ih; static int sio_timeout; static int sio_timeouts_until_log; static struct callout_handle sio_timeout_handle @@ -607,10 +607,10 @@ cyattach_common(cy_iobase, cy_align) com_addr(unit) = com; splx(s); - if (!sio_registered) { + if (sio_ih == NULL) cdevsw_add(&sio_cdevsw); - register_swi(SWI_TTY, siopoll); - sio_registered = TRUE; + sio_ih = sinthand_add("tty:sio", &tty_ithd, siopoll, NULL, + SWI_TTY, 0); } make_dev(&sio_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "ttyc%r%r", adapter, @@ -1174,7 +1174,8 @@ siointr(unit) #ifndef SOFT_HOTCHAR if (line_status & CD1400_RDSR_SPECIAL && com->hotchar != 0) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); + #endif #if 1 /* XXX "intelligent" PFO error handling would break O error handling */ if (line_status & (LSR_PE|LSR_FE|LSR_BI)) { @@ -1201,7 +1202,7 @@ siointr(unit) ++com->bytes_in; #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr = com->iptr; if (ioptr >= com->ibufend) @@ -1251,7 +1252,7 @@ siointr(unit) if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = 0; @@ -1266,7 +1267,7 @@ siointr(unit) #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif } while (--count != 0); } else { @@ -1291,7 +1292,7 @@ siointr(unit) #ifdef SOFT_HOTCHAR if (com->hotchar != 0 && recv_data == com->hotchar) - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); #endif ioptr[0] = recv_data; ioptr[com->ierroff] = 0; @@ -1356,7 +1357,7 @@ cont: if (!(com->state & CS_CHECKMSR)) { com_events += LOTS_OF_EVENTS; com->state |= CS_CHECKMSR; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } #ifdef SOFT_CTS_OFLOW @@ -1487,7 +1488,7 @@ cont: if (!(com->state & CS_ODONE)) { com_events += LOTS_OF_EVENTS; com->state |= CS_ODONE; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } break; case ETC_BREAK_ENDED: @@ -1501,7 +1502,7 @@ cont: if (!(com->extra_state & CSE_ODONE)) { com_events += LOTS_OF_EVENTS; com->extra_state |= CSE_ODONE; - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } cd_outb(iobase, CD1400_SRER, cy_align, com->intr_enable @@ -1559,7 +1560,7 @@ cont: com->state |= CS_ODONE; /* handle at high level ASAP */ - setsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); } } } @@ -1579,7 +1580,7 @@ terminate_tx_service: /* ensure an edge for the next interrupt */ cy_outb(cy_iobase, CY_CLEAR_INTR, cy_align, 0); - schedsofttty(); + sched_swi(sio_ih, SWI_NOSWITCH); COM_UNLOCK(); } diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index 22c82c2..fc35bd5 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -172,6 +172,8 @@ static int rc_rcsrt[16] = { TTY_BI|TTY_PE|TTY_FE|TTY_OE }; +static struct intrhand *rc_ih; + /* Static prototypes */ static ointhand2_t rcintr; static void rc_hwreset __P((int, int, unsigned int)); @@ -268,7 +270,8 @@ rcattach(dvp) rcb->rcb_probed = RC_ATTACHED; if (!rc_started) { cdevsw_add(&rc_cdevsw); - register_swi(SWI_TTY, rcpoll); + rc_ih = sinthand_add("tty:rc", &tty_ithd, rcpoll, NULL, + SWI_TTY, 0); rc_wakeup((void *)NULL); rc_started = 1; } @@ -362,7 +365,7 @@ rcintr(unit) optr++; rc_scheduled_event++; if (val != 0 && val == rc->rc_hotchar) - setsofttty(); + sched_swi(rc_ih, SWI_NOSWITCH); } } else { /* Store also status data */ @@ -393,7 +396,7 @@ rcintr(unit) && (rc->rc_tp->t_iflag & INPCK)))) val = 0; else if (val != 0 && val == rc->rc_hotchar) - setsofttty(); + sched_swi(rc_ih, SWI_NOSWITCH); optr[0] = val; optr[INPUT_FLAGS_SHIFT] = iack; optr++; @@ -440,7 +443,7 @@ rcintr(unit) if ((iack & MCR_CDchg) && !(rc->rc_flags & RC_MODCHG)) { rc_scheduled_event += LOTS_OF_EVENTS; rc->rc_flags |= RC_MODCHG; - setsofttty(); + sched_swi(rc_ih, SWI_NOSWITCH); } goto more_intrs; } @@ -481,7 +484,7 @@ rcintr(unit) if (!(rc->rc_flags & RC_DOXXFER)) { rc_scheduled_event += LOTS_OF_EVENTS; rc->rc_flags |= RC_DOXXFER; - setsofttty(); + sched_swi(rc_ih, SWI_NOSWITCH); } } } 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; |