kern_conf.c (49982) | kern_conf.c (50092) |
---|---|
1/*- 2 * Parts Copyright (c) 1995 Terrence R. Lambert 3 * Copyright (c) 1995 Julian R. Elischer 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/*- 2 * Parts Copyright (c) 1995 Terrence R. Lambert 3 * Copyright (c) 1995 Julian R. Elischer 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $Id: kern_conf.c,v 1.57 1999/08/15 09:32:47 phk Exp $ | 33 * $Id: kern_conf.c,v 1.58 1999/08/17 20:25:50 billf Exp $ |
34 */ 35 | 34 */ 35 |
36#include "opt_devfs.h" 37 |
|
36#include <sys/param.h> 37#include <sys/kernel.h> 38#include <sys/systm.h> 39#include <sys/module.h> 40#include <sys/malloc.h> 41#include <sys/conf.h> 42#include <sys/vnode.h> 43#include <sys/queue.h> 44#include <machine/stdarg.h> | 38#include <sys/param.h> 39#include <sys/kernel.h> 40#include <sys/systm.h> 41#include <sys/module.h> 42#include <sys/malloc.h> 43#include <sys/conf.h> 44#include <sys/vnode.h> 45#include <sys/queue.h> 46#include <machine/stdarg.h> |
47#ifdef DEVFS 48#include <sys/devfsext.h> 49#endif /* DEVFS */ |
|
45 | 50 |
51 |
|
46#define cdevsw_ALLOCSTART (NUMCDEVSW/2) 47 48struct cdevsw *cdevsw[NUMCDEVSW]; 49 50static int bmaj2cmaj[NUMCDEVSW]; 51 52MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage"); 53 --- 247 unchanged lines hidden (view full) --- 301 int i; 302 303 dev = makedev(devsw->d_maj, minor); 304 va_start(ap, fmt); 305 i = kvprintf(fmt, NULL, dev->si_name, 32, ap); 306 dev->si_name[i] = '\0'; 307 va_end(ap); 308 dev->si_devsw = devsw; | 52#define cdevsw_ALLOCSTART (NUMCDEVSW/2) 53 54struct cdevsw *cdevsw[NUMCDEVSW]; 55 56static int bmaj2cmaj[NUMCDEVSW]; 57 58MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage"); 59 --- 247 unchanged lines hidden (view full) --- 307 int i; 308 309 dev = makedev(devsw->d_maj, minor); 310 va_start(ap, fmt); 311 i = kvprintf(fmt, NULL, dev->si_name, 32, ap); 312 dev->si_name[i] = '\0'; 313 va_end(ap); 314 dev->si_devsw = devsw; |
315 316#ifdef DEVFS 317 dev->si_devfs = devfs_add_devswf(devsw, minor, DV_CHR, 318 uid, gid, perms, dev->si_name); 319 /* XXX HACK .. name may not start in 'r' */ 320 if ((devsw->d_bmaj != -1) 321 && (*dev->si_name == 'r') 322 && ((devsw->d_flags & D_TYPEMASK) == D_DISK)) { 323 dev->si_devfs = devfs_add_devswf(devsw, minor, DV_BLK, 324 uid, gid, perms, dev->si_name + 1); 325 } 326#endif /* DEVFS */ |
|
309 return (dev); 310} 311 312char * 313devtoname(dev_t dev) 314{ 315 316 return (dev->si_name); 317} 318 | 327 return (dev); 328} 329 330char * 331devtoname(dev_t dev) 332{ 333 334 return (dev->si_name); 335} 336 |