diff options
author | julian <julian@FreeBSD.org> | 1995-12-08 11:19:42 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-12-08 11:19:42 +0000 |
commit | 1900eea896e2aaeae8a9fa8affa5fded2068c9b4 (patch) | |
tree | 5150d199464d64c1021f91b2c2f112d48546a8bf /sys/kern/tty_tty.c | |
parent | aaf9d7f10ecc63adae1dc4f55cfd31a2926c605a (diff) | |
download | FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.zip FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.tar.gz |
Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)
If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)
pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
Diffstat (limited to 'sys/kern/tty_tty.c')
-rw-r--r-- | sys/kern/tty_tty.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index a970e03..d34536c 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_tty.c,v 1.6 1995/11/29 10:48:30 julian Exp $ + * $Id: tty_tty.c,v 1.7 1995/11/29 14:40:38 julian Exp $ */ /* @@ -45,19 +45,28 @@ #include <sys/tty.h> #include <sys/vnode.h> #include <sys/file.h> - -#ifdef JREMOD #include <sys/kernel.h> #ifdef DEVFS #include <sys/devfsext.h> #endif /*DEVFS*/ + +static d_open_t cttyopen; +static d_read_t cttyread; +static d_write_t cttywrite; +static d_ioctl_t cttyioctl; +static d_select_t cttyselect; + #define CDEV_MAJOR 1 -#endif /*JREMOD*/ +struct cdevsw ctty_cdevsw = + { cttyopen, nullclose, cttyread, cttywrite, /*1*/ + cttyioctl, nullstop, nullreset, nodevtotty,/* tty */ + cttyselect, nommap, NULL, "ctty", NULL, -1 }; + #define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL) /*ARGSUSED*/ -int +static int cttyopen(dev, flag, mode, p) dev_t dev; int flag, mode; @@ -88,7 +97,7 @@ cttyopen(dev, flag, mode, p) } /*ARGSUSED*/ -int +static int cttyread(dev, uio, flag) dev_t dev; struct uio *uio; @@ -106,7 +115,7 @@ cttyread(dev, uio, flag) } /*ARGSUSED*/ -int +static int cttywrite(dev, uio, flag) dev_t dev; struct uio *uio; @@ -124,7 +133,7 @@ cttywrite(dev, uio, flag) } /*ARGSUSED*/ -int +static int cttyioctl(dev, cmd, addr, flag, p) dev_t dev; int cmd; @@ -149,7 +158,7 @@ cttyioctl(dev, cmd, addr, flag, p) } /*ARGSUSED*/ -int +static int cttyselect(dev, flag, p) dev_t dev; int flag; @@ -162,15 +171,11 @@ cttyselect(dev, flag, p) return (VOP_SELECT(ttyvp, flag, FREAD|FWRITE, NOCRED, p)); } -#ifdef JREMOD -struct cdevsw ctty_cdevsw = - { cttyopen, nullclose, cttyread, cttywrite, /*1*/ - cttyioctl, nullstop, nullreset, nodevtotty,/* tty */ - cttyselect, nommap, NULL }; - static ctty_devsw_installed = 0; +static void *ctty_devfs_token; -static void ctty_drvinit(void *unused) +static void +ctty_drvinit(void *unused) { dev_t dev; @@ -179,18 +184,12 @@ static void ctty_drvinit(void *unused) cdevsw_add(&dev,&ctty_cdevsw,NULL); ctty_devsw_installed = 1; #ifdef DEVFS - { - int x; -/* default for a simple device with no probe routine (usually delete this) */ - x=devfs_add_devsw( -/* path name devsw minor type uid gid perm*/ - "/", "tty", major(dev), 0, DV_CHR, 0, 0, 0600); - } + ctty_devfs_token = devfs_add_devsw( "/", "tty", + &ctty_cdevsw, 0, DV_CHR, 0, 0, 0600); #endif } } SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctty_drvinit,NULL) -#endif /* JREMOD */ |