diff options
author | Bruce Evans <bde@FreeBSD.org> | 1998-08-11 17:01:32 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1998-08-11 17:01:32 +0000 |
commit | 92971f1fd7525cb747e2c4bb7ba9dc292e106cda (patch) | |
tree | ad96d8366740ccc303f3315f2fe056a6ff7418e9 /sys/dev/sio | |
parent | 87917d807d18e8bcb91253c97a957851cd682f34 (diff) | |
download | src-92971f1fd7525cb747e2c4bb7ba9dc292e106cda.tar.gz src-92971f1fd7525cb747e2c4bb7ba9dc292e106cda.zip |
Register tty software interrupt handlers at run time using register_swi()
instead of at compile time using ifdefs.
Use _swi_null instead of dummycamisr. CAM and dpt should call
register_swi() instead of hacking on ihandlers[] directly.
Notes
Notes:
svn path=/head/; revision=38246
Diffstat (limited to 'sys/dev/sio')
-rw-r--r-- | sys/dev/sio/sio.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 5a7c340cab8c..de9407bcd36e 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.208 1998/06/24 09:23:32 phk Exp $ + * $Id: sio.c,v 1.209 1998/07/15 12:18:14 bde Exp $ */ #include "opt_comconsole.h" @@ -70,6 +70,7 @@ #include <sys/conf.h> #include <sys/dkstat.h> #include <sys/fcntl.h> +#include <sys/interrupt.h> #include <sys/kernel.h> #include <sys/syslog.h> #include <sys/sysctl.h> @@ -78,6 +79,7 @@ #endif #include <machine/clock.h> +#include <machine/ipl.h> #include <i386/isa/isa.h> #include <i386/isa/isa_device.h> @@ -301,19 +303,6 @@ struct com_s { #endif }; -/* - * XXX public functions in drivers should be declared in headers produced - * by `config', not here. - */ - -/* Interrupt handling entry point. */ -void siopoll __P((void)); - -/* Device switch entry points. */ -#define sioreset noreset -#define siommap nommap -#define siostrategy nostrategy - #ifdef COM_ESP static int espattach __P((struct isa_device *isdp, struct com_s *com, Port_t esp_port)); @@ -325,6 +314,7 @@ static void comhardclose __P((struct com_s *com)); static void siointr1 __P((struct com_s *com)); 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 int sioprobe __P((struct isa_device *dev)); static void siosettimeout __P((void)); static void comstart __P((struct tty *tp)); @@ -366,6 +356,7 @@ static int comconsole = -1; static volatile speed_t comdefaultrate = CONSPEED; static u_int com_events; /* input chars + weighted output completions */ static Port_t siocniobase; +static bool_t siopoll_registered; static int sio_timeout; static int sio_timeouts_until_log; static struct callout_handle sio_timeout_handle @@ -1102,6 +1093,10 @@ determined_type: ; unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR, UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); #endif + if (!siopoll_registered) { + register_swi(SWI_TTY, siopoll); + siopoll_registered = TRUE; + } com->id_flags = isdp->id_flags; /* Heritate id_flags for later */ return (1); } @@ -1877,7 +1872,7 @@ sioioctl(dev, cmd, data, flag, p) return (0); } -void +static void siopoll() { int unit; |