FreeBSD kernel kern code
kern_conf.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/bio.h>
#include <sys/devctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/module.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/vnode.h>
#include <sys/queue.h>
#include <sys/poll.h>
#include <sys/sx.h>
#include <sys/ctype.h>
#include <sys/ucred.h>
#include <sys/taskqueue.h>
#include <machine/stdarg.h>
#include <fs/devfs/devfs_int.h>
#include <vm/vm.h>
#include "opt_ddb.h"
Include dependency graph for kern_conf.c:

Go to the source code of this file.

Data Structures

struct  clonedevs
 

Macros

#define dead_open   (d_open_t *)enxio
 
#define dead_close   (d_close_t *)enxio
 
#define dead_read   (d_read_t *)enxio
 
#define dead_write   (d_write_t *)enxio
 
#define dead_ioctl   (d_ioctl_t *)enxio
 
#define dead_poll   (d_poll_t *)enodev
 
#define dead_mmap   (d_mmap_t *)enodev
 
#define dead_dump   (dumper_t *)enxio
 
#define dead_kqfilter   (d_kqfilter_t *)enxio
 
#define dead_mmap_single   (d_mmap_single_t *)enodev
 
#define null_open   (d_open_t *)nullop
 
#define null_close   (d_close_t *)nullop
 
#define no_read   (d_read_t *)enodev
 
#define no_write   (d_write_t *)enodev
 
#define no_ioctl   (d_ioctl_t *)enodev
 
#define no_mmap   (d_mmap_t *)enodev
 
#define no_kqfilter   (d_kqfilter_t *)enodev
 
#define no_mmap_single   (d_mmap_single_t *)enodev
 
#define no_dump   (dumper_t *)enodev
 
#define FIXUP(member, noop, giant)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static MALLOC_DEFINE (M_DEVT, "cdev", "cdev storage")
 
static void destroy_devl (struct cdev *dev)
 
static int destroy_dev_sched_cbl (struct cdev *dev, void(*cb)(void *), void *arg)
 
static void destroy_dev_tq (void *ctx, int pending)
 
static int make_dev_credv (int flags, struct cdev **dres, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, va_list ap)
 
static SLIST_HEAD (free_cdevsw, cdevsw)
 
static void dev_unlock_and_free (void)
 
static void dev_free_devlocked (struct cdev *cdev)
 
static void cdevsw_free_devlocked (struct cdevsw *csw)
 
void dev_unlock (void)
 
void dev_ref (struct cdev *dev)
 
void dev_refl (struct cdev *dev)
 
void dev_rel (struct cdev *dev)
 
struct cdevsw * dev_refthread (struct cdev *dev, int *ref)
 
struct cdevsw * devvn_refthread (struct vnode *vp, struct cdev **devp, int *ref)
 
void dev_relthread (struct cdev *dev, int ref)
 
int nullop (void)
 
int eopnotsupp (void)
 
static int enxio (void)
 
static int enodev (void)
 
static void dead_strategy (struct bio *bp)
 
static void no_strategy (struct bio *bp)
 
static int no_poll (struct cdev *dev __unused, int events, struct thread *td __unused)
 
static int giant_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
 
static int giant_fdopen (struct cdev *dev, int oflags, struct thread *td, struct file *fp)
 
static int giant_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
 
static void giant_strategy (struct bio *bp)
 
static int giant_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
 
static int giant_read (struct cdev *dev, struct uio *uio, int ioflag)
 
static int giant_write (struct cdev *dev, struct uio *uio, int ioflag)
 
static int giant_poll (struct cdev *dev, int events, struct thread *td)
 
static int giant_kqfilter (struct cdev *dev, struct knote *kn)
 
static int giant_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
 
static int giant_mmap_single (struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, vm_object_t *object, int nprot)
 
static void notify (struct cdev *dev, const char *ev, int flags)
 
static void notify_create (struct cdev *dev, int flags)
 
static void notify_destroy (struct cdev *dev)
 
static struct cdev * newdev (struct make_dev_args *args, struct cdev *si)
 
static void fini_cdevsw (struct cdevsw *devsw)
 
static int prep_cdevsw (struct cdevsw *devsw, int flags)
 
static int prep_devname (struct cdev *dev, const char *fmt, va_list ap)
 
void make_dev_args_init_impl (struct make_dev_args *args, size_t sz)
 
static int make_dev_sv (struct make_dev_args *args1, struct cdev **dres, const char *fmt, va_list ap)
 
int make_dev_s (struct make_dev_args *args, struct cdev **dres, const char *fmt,...)
 
struct cdev * make_dev (struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode, const char *fmt,...)
 
struct cdev * make_dev_cred (struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt,...)
 
struct cdev * make_dev_credf (int flags, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt,...)
 
int make_dev_p (int flags, struct cdev **cdev, struct cdevsw *devsw, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt,...)
 
static void dev_dependsl (struct cdev *pdev, struct cdev *cdev)
 
void dev_depends (struct cdev *pdev, struct cdev *cdev)
 
static int make_dev_alias_v (int flags, struct cdev **cdev, struct cdev *pdev, const char *fmt, va_list ap)
 
struct cdev * make_dev_alias (struct cdev *pdev, const char *fmt,...)
 
int make_dev_alias_p (int flags, struct cdev **cdev, struct cdev *pdev, const char *fmt,...)
 
int make_dev_physpath_alias (int flags, struct cdev **cdev, struct cdev *pdev, struct cdev *old_alias, const char *physpath)
 
static void delist_dev_locked (struct cdev *dev)
 
void delist_dev (struct cdev *dev)
 
void destroy_dev (struct cdev *dev)
 
const char * devtoname (struct cdev *dev)
 
int dev_stdclone (char *name, char **namep, const char *stem, int *unit)
 
void clone_setup (struct clonedevs **cdp)
 
int clone_create (struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, int extra)
 
void clone_cleanup (struct clonedevs **cdp)
 
static TAILQ_HEAD (cdev_priv)
 
int destroy_dev_sched_cb (struct cdev *dev, void(*cb)(void *), void *arg)
 
int destroy_dev_sched (struct cdev *dev)
 
void destroy_dev_drain (struct cdevsw *csw)
 
void drain_dev_clone_events (void)
 

Variables

struct mtx devmtx
 
static struct cdev_priv_list cdevp_free_list
 
static struct cdevsw dead_cdevsw
 

Macro Definition Documentation

◆ dead_close

#define dead_close   (d_close_t *)enxio

Definition at line 289 of file kern_conf.c.

◆ dead_dump

#define dead_dump   (dumper_t *)enxio

Definition at line 303 of file kern_conf.c.

◆ dead_ioctl

#define dead_ioctl   (d_ioctl_t *)enxio

Definition at line 292 of file kern_conf.c.

◆ dead_kqfilter

#define dead_kqfilter   (d_kqfilter_t *)enxio

Definition at line 304 of file kern_conf.c.

◆ dead_mmap

#define dead_mmap   (d_mmap_t *)enodev

Definition at line 294 of file kern_conf.c.

◆ dead_mmap_single

#define dead_mmap_single   (d_mmap_single_t *)enodev

Definition at line 305 of file kern_conf.c.

◆ dead_open

#define dead_open   (d_open_t *)enxio

Definition at line 288 of file kern_conf.c.

◆ dead_poll

#define dead_poll   (d_poll_t *)enodev

Definition at line 293 of file kern_conf.c.

◆ dead_read

#define dead_read   (d_read_t *)enxio

Definition at line 290 of file kern_conf.c.

◆ dead_write

#define dead_write   (d_write_t *)enxio

Definition at line 291 of file kern_conf.c.

◆ FIXUP

#define FIXUP (   member,
  noop,
  giant 
)
Value:
do { \
if (devsw->member == NULL) { \
devsw->member = noop; \
} else if (devsw->d_flags & D_NEEDGIANT) \
devsw->member = giant; \
} \
while (0)

◆ no_dump

#define no_dump   (dumper_t *)enodev

Definition at line 348 of file kern_conf.c.

◆ no_ioctl

#define no_ioctl   (d_ioctl_t *)enodev

Definition at line 329 of file kern_conf.c.

◆ no_kqfilter

#define no_kqfilter   (d_kqfilter_t *)enodev

Definition at line 331 of file kern_conf.c.

◆ no_mmap

#define no_mmap   (d_mmap_t *)enodev

Definition at line 330 of file kern_conf.c.

◆ no_mmap_single

#define no_mmap_single   (d_mmap_single_t *)enodev

Definition at line 332 of file kern_conf.c.

◆ no_read

#define no_read   (d_read_t *)enodev

Definition at line 327 of file kern_conf.c.

◆ no_write

#define no_write   (d_write_t *)enodev

Definition at line 328 of file kern_conf.c.

◆ null_close

#define null_close   (d_close_t *)nullop

Definition at line 326 of file kern_conf.c.

◆ null_open

#define null_open   (d_open_t *)nullop

Definition at line 325 of file kern_conf.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ cdevsw_free_devlocked()

static void cdevsw_free_devlocked ( struct cdevsw *  csw)
static

Definition at line 127 of file kern_conf.c.

Referenced by fini_cdevsw(), and prep_cdevsw().

Here is the caller graph for this function:

◆ clone_cleanup()

void clone_cleanup ( struct clonedevs **  cdp)

Definition at line 1399 of file kern_conf.c.

References destroy_devl(), dev_unlock_and_free(), and free().

Here is the call graph for this function:

◆ clone_create()

int clone_create ( struct clonedevs **  cdp,
struct cdevsw *  csw,
int *  up,
struct cdev **  dp,
int  extra 
)

Definition at line 1312 of file kern_conf.c.

References dev_unlock(), dev_unlock_and_free(), newdev(), panic(), prep_cdevsw(), and printf().

Here is the call graph for this function:

◆ clone_setup()

void clone_setup ( struct clonedevs **  cdp)

Definition at line 1304 of file kern_conf.c.

References malloc().

Here is the call graph for this function:

◆ dead_strategy()

static void dead_strategy ( struct bio *  bp)
static

Definition at line 297 of file kern_conf.c.

References biofinish().

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delist_dev()

void delist_dev ( struct cdev *  dev)

Definition at line 1229 of file kern_conf.c.

References delist_dev_locked(), and dev_unlock().

Here is the call graph for this function:

◆ delist_dev_locked()

static void delist_dev_locked ( struct cdev *  dev)
static

Definition at line 1200 of file kern_conf.c.

References child, delist_dev_locked(), dev_refl(), dev_unlock(), and notify_destroy().

Referenced by delist_dev(), and delist_dev_locked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_dev()

void destroy_dev ( struct cdev *  dev)

Definition at line 1239 of file kern_conf.c.

References destroy_devl(), and dev_unlock_and_free().

Referenced by make_dev_physpath_alias(), and tty_makedevf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_dev_drain()

void destroy_dev_drain ( struct cdevsw *  csw)

Definition at line 1501 of file kern_conf.c.

References dev_unlock(), devmtx, and hz.

Here is the call graph for this function:

◆ destroy_dev_sched()

int destroy_dev_sched ( struct cdev *  dev)

Definition at line 1494 of file kern_conf.c.

References destroy_dev_sched_cb().

Referenced by ptsdrv_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_dev_sched_cb()

int destroy_dev_sched_cb ( struct cdev *  dev,
void(*)(void *)  cb,
void *  arg 
)

Definition at line 1486 of file kern_conf.c.

References destroy_dev_sched_cbl().

Referenced by destroy_dev_sched(), and tty_rel_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_dev_sched_cbl()

static int destroy_dev_sched_cbl ( struct cdev *  dev,
void(*)(void *)  cb,
void *  arg 
)
static

Definition at line 1465 of file kern_conf.c.

References dev_refl(), dev_unlock(), and taskqueue_enqueue().

Referenced by destroy_dev_sched_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy_dev_tq()

static void destroy_dev_tq ( void *  ctx,
int  pending 
)
static

◆ destroy_devl()

static void destroy_devl ( struct cdev *  dev)
static

Definition at line 1098 of file kern_conf.c.

References dead_cdevsw, destroy_devl(), dev_free_devlocked(), dev_refl(), dev_unlock(), devmtx, devtoname(), fini_cdevsw(), hz, notify_destroy(), printf(), and wakeup().

Referenced by clone_cleanup(), destroy_dev(), and destroy_devl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dev_depends()

void dev_depends ( struct cdev *  pdev,
struct cdev *  cdev 
)

Definition at line 957 of file kern_conf.c.

References dev_dependsl(), and dev_unlock().

Referenced by tty_makedevf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dev_dependsl()

static void dev_dependsl ( struct cdev *  pdev,
struct cdev *  cdev 
)
static

Definition at line 948 of file kern_conf.c.

Referenced by dev_depends(), and make_dev_alias_v().

Here is the caller graph for this function:

◆ dev_free_devlocked()

static void dev_free_devlocked ( struct cdev *  cdev)
static

Definition at line 115 of file kern_conf.c.

References cdevp_free_list.

Referenced by destroy_devl(), and newdev().

Here is the caller graph for this function:

◆ dev_ref()

void dev_ref ( struct cdev *  dev)

Definition at line 142 of file kern_conf.c.

References devmtx.

◆ dev_refl()

void dev_refl ( struct cdev *  dev)

Definition at line 152 of file kern_conf.c.

Referenced by ctty_clone(), delist_dev_locked(), destroy_dev_sched_cbl(), destroy_devl(), and make_dev_sv().

Here is the caller graph for this function:

◆ dev_refthread()

struct cdevsw * dev_refthread ( struct cdev *  dev,
int *  ref 
)

Definition at line 179 of file kern_conf.c.

Referenced by giant_close(), giant_fdopen(), giant_ioctl(), giant_kqfilter(), giant_mmap(), giant_mmap_single(), giant_open(), giant_poll(), giant_read(), giant_strategy(), and giant_write().

Here is the caller graph for this function:

◆ dev_rel()

void dev_rel ( struct cdev *  dev)

Definition at line 160 of file kern_conf.c.

References dev_unlock(), devtoname(), and flag.

Here is the call graph for this function:

◆ dev_relthread()

void dev_relthread ( struct cdev *  dev,
int  ref 
)

◆ dev_stdclone()

int dev_stdclone ( char *  name,
char **  namep,
const char *  stem,
int *  unit 
)

Definition at line 1256 of file kern_conf.c.

References name.

◆ dev_unlock()

void dev_unlock ( void  )

◆ dev_unlock_and_free()

static void dev_unlock_and_free ( void  )
static

Definition at line 84 of file kern_conf.c.

References cdevp_free_list, devmtx, and free().

Referenced by clone_cleanup(), clone_create(), destroy_dev(), and make_dev_sv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ devtoname()

const char * devtoname ( struct cdev *  dev)

Definition at line 1249 of file kern_conf.c.

Referenced by destroy_devl(), dev_rel(), disk_err(), make_dev_sv(), newdev(), and physio().

Here is the caller graph for this function:

◆ devvn_refthread()

struct cdevsw * devvn_refthread ( struct vnode *  vp,
struct cdev **  devp,
int *  ref 
)

Definition at line 205 of file kern_conf.c.

Referenced by aio_qbio(), and ttyhook_register().

Here is the caller graph for this function:

◆ drain_dev_clone_events()

void drain_dev_clone_events ( void  )

Definition at line 1512 of file kern_conf.c.

◆ enodev()

static int enodev ( void  )
static

Definition at line 281 of file kern_conf.c.

◆ enxio()

static int enxio ( void  )
static

Definition at line 275 of file kern_conf.c.

◆ eopnotsupp()

int eopnotsupp ( void  )

Definition at line 268 of file kern_conf.c.

◆ fini_cdevsw()

static void fini_cdevsw ( struct cdevsw *  devsw)
static

Definition at line 614 of file kern_conf.c.

References cdevsw_free_devlocked().

Referenced by destroy_devl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_close()

static int giant_close ( struct cdev *  dev,
int  fflag,
int  devtype,
struct thread *  td 
)
static

Definition at line 383 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_fdopen()

static int giant_fdopen ( struct cdev *  dev,
int  oflags,
struct thread *  td,
struct file *  fp 
)
static

Definition at line 367 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_ioctl()

static int giant_ioctl ( struct cdev *  dev,
u_long  cmd,
caddr_t  data,
int  fflag,
struct thread *  td 
)
static

Definition at line 418 of file kern_conf.c.

References data, dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_kqfilter()

static int giant_kqfilter ( struct cdev *  dev,
struct knote kn 
)
static

Definition at line 482 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_mmap()

static int giant_mmap ( struct cdev *  dev,
vm_ooffset_t  offset,
vm_paddr_t *  paddr,
int  nprot,
vm_memattr_t *  memattr 
)
static

Definition at line 498 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_mmap_single()

static int giant_mmap_single ( struct cdev *  dev,
vm_ooffset_t *  offset,
vm_size_t  size,
vm_object_t *  object,
int  nprot 
)
static

Definition at line 516 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_open()

static int giant_open ( struct cdev *  dev,
int  oflags,
int  devtype,
struct thread *  td 
)
static

Definition at line 351 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_poll()

static int giant_poll ( struct cdev *  dev,
int  events,
struct thread *  td 
)
static

Definition at line 466 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_read()

static int giant_read ( struct cdev *  dev,
struct uio *  uio,
int  ioflag 
)
static

Definition at line 434 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_strategy()

static void giant_strategy ( struct bio *  bp)
static

Definition at line 399 of file kern_conf.c.

References biofinish(), dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ giant_write()

static int giant_write ( struct cdev *  dev,
struct uio *  uio,
int  ioflag 
)
static

Definition at line 450 of file kern_conf.c.

References dev_refthread(), dev_relthread(), and Giant.

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev()

struct cdev * make_dev ( struct cdevsw *  devsw,
int  unit,
uid_t  uid,
gid_t  gid,
int  mode,
const char *  fmt,
  ... 
)

Definition at line 877 of file kern_conf.c.

References make_dev_credv(), mode, and res.

Here is the call graph for this function:

◆ make_dev_alias()

struct cdev * make_dev_alias ( struct cdev *  pdev,
const char *  fmt,
  ... 
)

Definition at line 1007 of file kern_conf.c.

References make_dev_alias_v(), and res.

Referenced by fildesc_drvinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_alias_p()

int make_dev_alias_p ( int  flags,
struct cdev **  cdev,
struct cdev *  pdev,
const char *  fmt,
  ... 
)

Definition at line 1023 of file kern_conf.c.

References flags, make_dev_alias_v(), and res.

Referenced by make_dev_physpath_alias().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_alias_v()

static int make_dev_alias_v ( int  flags,
struct cdev **  cdev,
struct cdev *  pdev,
const char *  fmt,
va_list  ap 
)
static

Definition at line 966 of file kern_conf.c.

References clean_unrhdrl(), dev_dependsl(), dev_unlock(), flags, notify_create(), panic(), and prep_devname().

Referenced by make_dev_alias(), and make_dev_alias_p().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_args_init_impl()

void make_dev_args_init_impl ( struct make_dev_args *  args,
size_t  sz 
)

Definition at line 771 of file kern_conf.c.

◆ make_dev_cred()

struct cdev * make_dev_cred ( struct cdevsw *  devsw,
int  unit,
struct ucred *  cr,
uid_t  uid,
gid_t  gid,
int  mode,
const char *  fmt,
  ... 
)

Definition at line 894 of file kern_conf.c.

References make_dev_credv(), mode, and res.

Here is the call graph for this function:

◆ make_dev_credf()

struct cdev * make_dev_credf ( int  flags,
struct cdevsw *  devsw,
int  unit,
struct ucred *  cr,
uid_t  uid,
gid_t  gid,
int  mode,
const char *  fmt,
  ... 
)

Definition at line 911 of file kern_conf.c.

References flags, make_dev_credv(), mode, and res.

Referenced by ctty_drvinit(), devctl2_init(), devinit(), devstat_alloc(), fildesc_drvinit(), log_drvinit(), and ttyconsdev_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_credv()

static int make_dev_credv ( int  flags,
struct cdev **  dres,
struct cdevsw *  devsw,
int  unit,
struct ucred *  cr,
uid_t  uid,
gid_t  gid,
int  mode,
const char *  fmt,
va_list  ap 
)
static

Definition at line 859 of file kern_conf.c.

References flags, make_dev_sv(), and mode.

Referenced by make_dev(), make_dev_cred(), make_dev_credf(), and make_dev_p().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_p()

int make_dev_p ( int  flags,
struct cdev **  cdev,
struct cdevsw *  devsw,
struct ucred *  cr,
uid_t  uid,
gid_t  gid,
int  mode,
const char *  fmt,
  ... 
)

Definition at line 930 of file kern_conf.c.

References flags, make_dev_credv(), mode, and res.

Referenced by reroot_conf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_physpath_alias()

int make_dev_physpath_alias ( int  flags,
struct cdev **  cdev,
struct cdev *  pdev,
struct cdev *  old_alias,
const char *  physpath 
)

Definition at line 1036 of file kern_conf.c.

References destroy_dev(), flags, free(), make_dev_alias_p(), malloc(), and sprintf().

Here is the call graph for this function:

◆ make_dev_s()

int make_dev_s ( struct make_dev_args *  args,
struct cdev **  dres,
const char *  fmt,
  ... 
)

Definition at line 846 of file kern_conf.c.

References make_dev_sv(), and res.

Referenced by kcov_init(), and tty_makedevf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_dev_sv()

static int make_dev_sv ( struct make_dev_args *  args1,
struct cdev **  dres,
const char *  fmt,
va_list  ap 
)
static

Definition at line 779 of file kern_conf.c.

References clean_unrhdrl(), crhold(), dev_refl(), dev_unlock(), dev_unlock_and_free(), devtoname(), newdev(), notify_create(), panic(), prep_cdevsw(), prep_devname(), and res.

Referenced by make_dev_credv(), and make_dev_s().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_DEVT  ,
"cdev"  ,
"cdev storage"   
)
static

◆ newdev()

static struct cdev * newdev ( struct make_dev_args *  args,
struct cdev *  si 
)
static

Definition at line 568 of file kern_conf.c.

References dev_free_devlocked(), and devtoname().

Referenced by clone_create(), and make_dev_sv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ no_poll()

static int no_poll ( struct cdev *dev  __unused,
int  events,
struct thread *td  __unused 
)
static

Definition at line 342 of file kern_conf.c.

References poll_no_poll().

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ no_strategy()

static void no_strategy ( struct bio *  bp)
static

Definition at line 335 of file kern_conf.c.

References biofinish().

Referenced by prep_cdevsw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notify()

static void notify ( struct cdev *  dev,
const char *  ev,
int  flags 
)
static

Definition at line 534 of file kern_conf.c.

References data, devctl_notify(), ev, flags, free(), and malloc().

Referenced by notify_create(), and notify_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notify_create()

static void notify_create ( struct cdev *  dev,
int  flags 
)
static

Definition at line 554 of file kern_conf.c.

References flags, and notify().

Referenced by make_dev_alias_v(), and make_dev_sv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notify_destroy()

static void notify_destroy ( struct cdev *  dev)
static

Definition at line 561 of file kern_conf.c.

References notify().

Referenced by delist_dev_locked(), and destroy_devl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nullop()

int nullop ( void  )

Definition at line 261 of file kern_conf.c.

◆ prep_cdevsw()

◆ prep_devname()

static int prep_devname ( struct cdev *  dev,
const char *  fmt,
va_list  ap 
)
static

Definition at line 715 of file kern_conf.c.

References vsnrprintf().

Referenced by make_dev_alias_v(), and make_dev_sv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SLIST_HEAD()

static SLIST_HEAD ( free_cdevsw  ,
cdevsw   
)
static

Definition at line 67 of file kern_conf.c.

◆ TAILQ_HEAD()

static TAILQ_HEAD ( cdev_priv  )
static

Definition at line 1429 of file kern_conf.c.

Variable Documentation

◆ cdevp_free_list

struct cdev_priv_list cdevp_free_list
static
Initial value:
=
TAILQ_HEAD_INITIALIZER(cdevp_free_list)
static struct cdev_priv_list cdevp_free_list
Definition: kern_conf.c:65

Definition at line 65 of file kern_conf.c.

Referenced by dev_free_devlocked(), and dev_unlock_and_free().

◆ dead_cdevsw

struct cdevsw dead_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_open = dead_open,
.d_close = dead_close,
.d_read = dead_read,
.d_write = dead_write,
.d_ioctl = dead_ioctl,
.d_poll = dead_poll,
.d_mmap = dead_mmap,
.d_strategy = dead_strategy,
.d_name = "dead",
.d_dump = dead_dump,
.d_kqfilter = dead_kqfilter,
.d_mmap_single = dead_mmap_single
}
#define dead_poll
Definition: kern_conf.c:293
#define dead_mmap
Definition: kern_conf.c:294
#define dead_dump
Definition: kern_conf.c:303
#define dead_ioctl
Definition: kern_conf.c:292
#define dead_kqfilter
Definition: kern_conf.c:304
#define dead_open
Definition: kern_conf.c:288
static void dead_strategy(struct bio *bp)
Definition: kern_conf.c:297
#define dead_write
Definition: kern_conf.c:291
#define dead_read
Definition: kern_conf.c:290
#define dead_close
Definition: kern_conf.c:289
#define dead_mmap_single
Definition: kern_conf.c:305

Definition at line 307 of file kern_conf.c.

Referenced by destroy_devl().

◆ devmtx

struct mtx devmtx