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/vm/vm_swap.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/vm/vm_swap.c')
-rw-r--r-- | sys/vm/vm_swap.c | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index c91b10e..db7b2ad 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.27 1995/11/29 14:41:20 julian Exp $ + * $Id: vm_swap.c,v 1.28 1995/12/07 12:48:28 davidg Exp $ */ #include <sys/param.h> @@ -45,21 +45,26 @@ #include <sys/vnode.h> #include <sys/file.h> #include <sys/rlist.h> - +#include <sys/kernel.h> #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/vm_extern.h> #include <miscfs/specfs/specdev.h> -#ifdef JREMOD -#include <sys/kernel.h> -#ifdef DEVFS -#include <sys/devfsext.h> -#endif /*DEVFS*/ + #define CDEV_MAJOR 4 #define BDEV_MAJOR 1 -#endif /*JREMOD */ + +struct bdevsw sw_bdevsw = + { noopen, noclose, swstrategy, noioc, /*1*/ + nodump, zerosize, NULL, "sw", NULL, -1 }; + +struct cdevsw sw_cdevsw = + { nullopen, nullclose, rawread, rawwrite, /*4*/ + noioc, nostop, noreset, nodevtotty,/* swap */ + noselect, nommap, swstrategy, "sw", NULL, -1 }; + /* * Indirect driver for multi-controller paging. @@ -264,45 +269,20 @@ swaponvp(p, vp, dev, nblks) return (0); } -#ifdef JREMOD -struct bdevsw sw_bdevsw = - { noopen, noclose, swstrategy, noioc, /*1*/ - nodump, zerosize, 0 }; - -struct cdevsw sw_cdevsw = - { nullopen, nullclose, rawread, rawwrite, /*4*/ - noioc, nostop, noreset, nodevtotty,/* swap */ - noselect, nommap, swstrategy }; - static sw_devsw_installed = 0; static void sw_drvinit(void *unused) { dev_t dev; - dev_t dev_chr; if( ! sw_devsw_installed ) { dev = makedev(CDEV_MAJOR,0); cdevsw_add(&dev,&sw_cdevsw,NULL); - dev_chr = dev; dev = makedev(BDEV_MAJOR,0); bdevsw_add(&dev,&sw_bdevsw,NULL); sw_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*/ - "/", "rsw", major(dev_chr), 0, DV_CHR, 0, 0, 0600); - x=devfs_add_devsw( - "/", "sw", major(dev), 0, DV_BLK, 0, 0, 0600); - } -#endif } } SYSINIT(swdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sw_drvinit,NULL) -#endif /* JREMOD */ - |