1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Introduce the makebdev() function, it does the same as the makedev()

function for now, but that will change.
This commit is contained in:
Poul-Henning Kamp 1999-06-01 18:56:26 +00:00
parent 4065a35af3
commit 6fcd8a7c93
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=47680
6 changed files with 33 additions and 25 deletions

View File

@ -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 @@ setrootbyname(char *name)
}
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);
}

View File

@ -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 @@ setrootbyname(char *name)
}
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);
}

View File

@ -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>
@ -190,6 +190,12 @@ minor(dev_t x)
return(i & 0xffff00ff);
}
dev_t
makebdev(int x, int y)
{
return (makedev(x, y));
}
dev_t
makedev(int x, int y)
{

View File

@ -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

View File

@ -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_ */

View File

@ -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_ */