diff options
author | phk <phk@FreeBSD.org> | 1999-06-01 18:56:26 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-06-01 18:56:26 +0000 |
commit | a6b150ee302f4f0c2992587f09851072b40aaa39 (patch) | |
tree | 0f00a280cf192732bc7224beff8e08c4b4b6940d /sys | |
parent | 91a6d42ba0db00e8c993ea7b50fa1cf1543e21f1 (diff) | |
download | FreeBSD-src-a6b150ee302f4f0c2992587f09851072b40aaa39.zip FreeBSD-src-a6b150ee302f4f0c2992587f09851072b40aaa39.tar.gz |
Introduce the makebdev() function, it does the same as the makedev()
function for now, but that will change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 14 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 14 | ||||
-rw-r--r-- | sys/kern/kern_conf.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_aio.c | 4 | ||||
-rw-r--r-- | sys/sys/conf.h | 9 | ||||
-rw-r--r-- | sys/sys/linedisc.h | 9 |
6 files changed, 33 insertions, 25 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 9175d60..1118fcb 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.123 1999/05/24 00:30:49 jb Exp $ + * $Id: autoconf.c,v 1.124 1999/05/31 11:25:39 phk Exp $ */ /* @@ -158,7 +158,7 @@ find_cdrom_root() for (j = 0 ; try_cdrom[j].name ; j++) { if (try_cdrom[j].major >= NUMCDEVSW) continue; - rootdev = makedev(try_cdrom[j].major, i * 8); + rootdev = makebdev(try_cdrom[j].major, i * 8); bd = bdevsw(rootdev); if (bd == NULL || bd->d_open == NULL) continue; @@ -434,7 +434,7 @@ setroot() if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) return; majdev = B_TYPE(bootdev); - dev = makedev(majdev, 0); + dev = makebdev(majdev, 0); if (bdevsw(dev) == NULL) return; unit = B_UNIT(bootdev); @@ -457,7 +457,7 @@ setroot() mindev = dkmakeminor(unit, slice, part); } - newrootdev = makedev(majdev, mindev); + newrootdev = makebdev(majdev, mindev); rootdevs[0] = newrootdev; sname = dsname(bdevsw(newrootdev)->d_name, unit, slice, part, partname); rootdevnames[0] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); @@ -524,7 +524,7 @@ setrootbyname(char *name) unit = *cp - '0'; *cp++ = '\0'; for (bd = 0; bd < NUMCDEVSW; bd++) { - dev = makedev(bd, 0); + dev = makebdev(bd, 0); if (bdevsw(dev) != NULL && strcmp(bdevsw(dev)->d_name, name) == 0) goto gotit; @@ -547,7 +547,7 @@ gotit: } printf("driver=%s, unit=%d, slice=%d, part=%d\n", name, unit, slice, part); - rootdev = makedev(bd, dkmakeminor(unit, slice, part)); + rootdev = makebdev(bd, dkmakeminor(unit, slice, part)); return 0; } @@ -567,7 +567,7 @@ setconf() printf("use one of:\n"); for (i = 0; i < NUMCDEVSW; i++) { - dev = makedev(i, 0); + dev = makebdev(i, 0); if (bdevsw(dev) != NULL) printf(" %s", bdevsw(dev)->d_name); } diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 9175d60..1118fcb 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.123 1999/05/24 00:30:49 jb Exp $ + * $Id: autoconf.c,v 1.124 1999/05/31 11:25:39 phk Exp $ */ /* @@ -158,7 +158,7 @@ find_cdrom_root() for (j = 0 ; try_cdrom[j].name ; j++) { if (try_cdrom[j].major >= NUMCDEVSW) continue; - rootdev = makedev(try_cdrom[j].major, i * 8); + rootdev = makebdev(try_cdrom[j].major, i * 8); bd = bdevsw(rootdev); if (bd == NULL || bd->d_open == NULL) continue; @@ -434,7 +434,7 @@ setroot() if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) return; majdev = B_TYPE(bootdev); - dev = makedev(majdev, 0); + dev = makebdev(majdev, 0); if (bdevsw(dev) == NULL) return; unit = B_UNIT(bootdev); @@ -457,7 +457,7 @@ setroot() mindev = dkmakeminor(unit, slice, part); } - newrootdev = makedev(majdev, mindev); + newrootdev = makebdev(majdev, mindev); rootdevs[0] = newrootdev; sname = dsname(bdevsw(newrootdev)->d_name, unit, slice, part, partname); rootdevnames[0] = malloc(strlen(sname) + 2, M_DEVBUF, M_NOWAIT); @@ -524,7 +524,7 @@ setrootbyname(char *name) unit = *cp - '0'; *cp++ = '\0'; for (bd = 0; bd < NUMCDEVSW; bd++) { - dev = makedev(bd, 0); + dev = makebdev(bd, 0); if (bdevsw(dev) != NULL && strcmp(bdevsw(dev)->d_name, name) == 0) goto gotit; @@ -547,7 +547,7 @@ gotit: } printf("driver=%s, unit=%d, slice=%d, part=%d\n", name, unit, slice, part); - rootdev = makedev(bd, dkmakeminor(unit, slice, part)); + rootdev = makebdev(bd, dkmakeminor(unit, slice, part)); return 0; } @@ -567,7 +567,7 @@ setconf() printf("use one of:\n"); for (i = 0; i < NUMCDEVSW; i++) { - dev = makedev(i, 0); + dev = makebdev(i, 0); if (bdevsw(dev) != NULL) printf(" %s", bdevsw(dev)->d_name); } diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index b09b04c..b8f8586 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_conf.c,v 1.40 1999/05/18 13:14:43 luoqi Exp $ + * $Id: kern_conf.c,v 1.41 1999/05/31 11:27:28 phk Exp $ */ #include <sys/param.h> @@ -191,6 +191,12 @@ minor(dev_t x) } dev_t +makebdev(int x, int y) +{ + return (makedev(x, y)); +} + +dev_t makedev(int x, int y) { #ifdef DEVT_FASCIST diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 658edb1..04d9de4 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -13,7 +13,7 @@ * bad that happens because of using this software isn't the responsibility * of the author. This software is distributed AS-IS. * - * $Id: vfs_aio.c,v 1.49 1999/05/08 06:39:46 phk Exp $ + * $Id: vfs_aio.c,v 1.50 1999/05/09 13:13:52 phk Exp $ */ /* @@ -981,7 +981,7 @@ aio_qphysio(p, aiocbe) return -1; } - dev = makedev(bdev->d_bmaj, minor(vp->v_rdev)); + dev = makebdev(bdev->d_bmaj, minor(vp->v_rdev)); /* * Physical I/O is charged directly to the process, so we don't have diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 5790303..ad96a24 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 - * $Id: conf.h,v 1.57 1999/05/30 16:53:40 phk Exp $ + * $Id: conf.h,v 1.58 1999/05/31 11:29:08 phk Exp $ */ #ifndef _SYS_CONF_H_ @@ -218,15 +218,16 @@ static moduledata_t name##_mod = { \ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+cmaj*256+bmaj) -int devsw_module_handler __P((struct module *mod, int what, void *arg)); +struct cdevsw *bdevsw __P((dev_t dev)); int cdevsw_add __P((struct cdevsw *new)); dev_t chrtoblk __P((dev_t dev)); +struct cdevsw *devsw __P((dev_t dev)); +int devsw_module_handler __P((struct module *mod, int what, void *arg)); int iskmemdev __P((dev_t dev)); int iszerodev __P((dev_t dev)); +dev_t makebdev __P((int maj, int min)); void setconf __P((void)); -struct cdevsw *bdevsw __P((dev_t dev)); -struct cdevsw *devsw __P((dev_t dev)); #endif /* KERNEL */ #endif /* !_SYS_CONF_H_ */ diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index 5790303..ad96a24 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 - * $Id: conf.h,v 1.57 1999/05/30 16:53:40 phk Exp $ + * $Id: conf.h,v 1.58 1999/05/31 11:29:08 phk Exp $ */ #ifndef _SYS_CONF_H_ @@ -218,15 +218,16 @@ static moduledata_t name##_mod = { \ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+cmaj*256+bmaj) -int devsw_module_handler __P((struct module *mod, int what, void *arg)); +struct cdevsw *bdevsw __P((dev_t dev)); int cdevsw_add __P((struct cdevsw *new)); dev_t chrtoblk __P((dev_t dev)); +struct cdevsw *devsw __P((dev_t dev)); +int devsw_module_handler __P((struct module *mod, int what, void *arg)); int iskmemdev __P((dev_t dev)); int iszerodev __P((dev_t dev)); +dev_t makebdev __P((int maj, int min)); void setconf __P((void)); -struct cdevsw *bdevsw __P((dev_t dev)); -struct cdevsw *devsw __P((dev_t dev)); #endif /* KERNEL */ #endif /* !_SYS_CONF_H_ */ |