FreeBSD kernel kern code
tty.c File Reference
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include "opt_compat.h"
#include <sys/param.h>
#include <sys/capability.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/filio.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/poll.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/serial.h>
#include <sys/signal.h>
#include <sys/stat.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <sys/ttycom.h>
#include <sys/ttydefaults.h>
#include <sys/ucred.h>
#include <sys/vnode.h>
#include <machine/stdarg.h>
#include "opt_ddb.h"
Include dependency graph for tty.c:

Go to the source code of this file.

Macros

#define TTYDEFCHARS
 
#define TTYSUP_IFLAG
 
#define TTYSUP_OFLAG   (OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET)
 
#define TTYSUP_LFLAG
 
#define TTYSUP_CFLAG
 
#define TTY_CALLOUT(tp, d)   (dev2unit(d) & TTYUNIT_CALLOUT)
 
#define TTYBUF_MAX   65536
 
#define PATCH_FUNC(x)
 
#define TF_ACTIVITY   (TF_GONE|TF_OPENED|TF_HOOK|TF_OPENCLOSE)
 

Functions

 __FBSDID ("$BSDSUniX$")
 
static MALLOC_DEFINE (M_TTY,"tty","tty device")
 
static void tty_rel_free (struct tty *tp)
 
static TAILQ_HEAD (tty)
 
static int tty_drain (struct tty *tp)
 
static __inline int ttydev_enter (struct tty *tp)
 
static void ttydev_leave (struct tty *tp)
 
static int ttydev_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
 
static int ttydev_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
 
static __inline int tty_is_ctty (struct tty *tp, struct proc *p)
 
int tty_wait_background (struct tty *tp, struct thread *td, int sig)
 
static int ttydev_read (struct cdev *dev, struct uio *uio, int ioflag)
 
static int ttydev_write (struct cdev *dev, struct uio *uio, int ioflag)
 
static int ttydev_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
 
static int ttydev_poll (struct cdev *dev, int events, struct thread *td)
 
static int ttydev_mmap (struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
 
static void tty_kqops_read_detach (struct knote *kn)
 
static int tty_kqops_read_event (struct knote *kn, long hint)
 
static void tty_kqops_write_detach (struct knote *kn)
 
static int tty_kqops_write_event (struct knote *kn, long hint)
 
static int ttydev_kqfilter (struct cdev *dev, struct knote *kn)
 
static int ttyil_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
 
static int ttyil_close (struct cdev *dev, int flag, int mode, struct thread *td)
 
static int ttyil_rdwr (struct cdev *dev, struct uio *uio, int ioflag)
 
static int ttyil_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
 
static void tty_init_termios (struct tty *tp)
 
void tty_init_console (struct tty *tp, speed_t s)
 
static int ttydevsw_defopen (struct tty *tp)
 
static void ttydevsw_defclose (struct tty *tp)
 
static void ttydevsw_defoutwakeup (struct tty *tp)
 
static void ttydevsw_definwakeup (struct tty *tp)
 
static int ttydevsw_defioctl (struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
 
static int ttydevsw_defcioctl (struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td)
 
static int ttydevsw_defparam (struct tty *tp, struct termios *t)
 
static int ttydevsw_defmodem (struct tty *tp, int sigon, int sigoff)
 
static int ttydevsw_defmmap (struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
 
static void ttydevsw_defpktnotify (struct tty *tp, char event)
 
static void ttydevsw_deffree (void *softc)
 
struct tty * tty_alloc (struct ttydevsw *tsw, void *sc)
 
struct tty * tty_alloc_mutex (struct ttydevsw *tsw, void *sc, struct mtx *mutex)
 
static void tty_dealloc (void *arg)
 
void tty_rel_pgrp (struct tty *tp, struct pgrp *pg)
 
void tty_rel_sess (struct tty *tp, struct session *sess)
 
void tty_rel_gone (struct tty *tp)
 
static void tty_to_xtty (struct tty *tp, struct xtty *xt)
 
static int sysctl_kern_ttys (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_kern, OID_AUTO, ttys, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_ttys,"S,xtty","List of TTYs")
 
void tty_makedev (struct tty *tp, struct ucred *cred, const char *fmt,...)
 
void tty_signal_sessleader (struct tty *tp, int sig)
 
void tty_signal_pgrp (struct tty *tp, int sig)
 
void tty_wakeup (struct tty *tp, int flags)
 
int tty_wait (struct tty *tp, struct cv *cv)
 
int tty_timedwait (struct tty *tp, struct cv *cv, int hz)
 
void tty_flush (struct tty *tp, int flags)
 
void tty_set_winsize (struct tty *tp, const struct winsize *wsz)
 
static int tty_generic_ioctl (struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td)
 
int tty_ioctl (struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td)
 
dev_t tty_udev (struct tty *tp)
 
int tty_checkoutq (struct tty *tp)
 
void tty_hiwat_in_block (struct tty *tp)
 
void tty_hiwat_in_unblock (struct tty *tp)
 
static int ttyhook_defrint (struct tty *tp, char c, int flags)
 
int ttyhook_register (struct tty **rtp, struct proc *p, int fd, struct ttyhook *th, void *softc)
 
void ttyhook_unregister (struct tty *tp)
 
static int ttyconsdev_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
 
static int ttyconsdev_write (struct cdev *dev, struct uio *uio, int ioflag)
 
static void ttyconsdev_init (void *unused)
 
 SYSINIT (tty, SI_SUB_DRIVERS, SI_ORDER_FIRST, ttyconsdev_init, NULL)
 
void ttyconsdev_select (const char *name)
 

Variables

static struct filterops tty_kqops_read
 
static struct filterops tty_kqops_write
 
static struct cdevsw ttydev_cdevsw
 
static struct cdevsw ttyil_cdevsw
 
static struct cdevsw ttyconsdev_cdevsw
 

Macro Definition Documentation

#define PATCH_FUNC (   x)
Value:
do { \
if (tsw->tsw_ ## x == NULL) \
tsw->tsw_ ## x = ttydevsw_def ## x; \
} while (0)

Referenced by tty_alloc_mutex().

#define TF_ACTIVITY   (TF_GONE|TF_OPENED|TF_HOOK|TF_OPENCLOSE)

Referenced by tty_rel_free().

#define TTY_CALLOUT (   tp,
 
)    (dev2unit(d) & TTYUNIT_CALLOUT)

Referenced by ttydev_ioctl(), and ttydev_open().

#define TTYBUF_MAX   65536

Referenced by TAILQ_HEAD().

#define TTYDEFCHARS

Definition at line 62 of file tty.c.

#define TTYSUP_CFLAG
Value:
(CIGNORE|CSIZE|CSTOPB|CREAD|PARENB|PARODD|\
HUPCL|CLOCAL|CCTS_OFLOW|CRTS_IFLOW|CDTR_IFLOW|\
CDSR_OFLOW|CCAR_OFLOW)

Referenced by tty_generic_ioctl().

#define TTYSUP_IFLAG
Value:
(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\
INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL)

Referenced by tty_generic_ioctl().

#define TTYSUP_LFLAG
Value:
(ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\
ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\
FLUSHO|NOKERNINFO|NOFLSH)

Referenced by tty_generic_ioctl().

#define TTYSUP_OFLAG   (OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET)

Referenced by tty_generic_ioctl().

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static MALLOC_DEFINE ( M_TTY  ,
"tty"  ,
"tty device  
)
static
static int sysctl_kern_ttys ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 1138 of file tty.c.

References free(), malloc(), and tty_to_xtty().

Here is the call graph for this function:

SYSCTL_PROC ( _kern  ,
OID_AUTO  ,
ttys  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
,
sysctl_kern_ttys  ,
S,
xtty"  ,
"List of TTYs"   
)
SYSINIT ( tty  ,
SI_SUB_DRIVERS  ,
SI_ORDER_FIRST  ,
ttyconsdev_init  ,
NULL   
)
static TAILQ_HEAD ( tty  )
static

Definition at line 74 of file tty.c.

References TTYBUF_MAX, ttyinq_setsize(), and ttyoutq_setsize().

Here is the call graph for this function:

struct tty* tty_alloc ( struct ttydevsw *  tsw,
void *  sc 
)

Definition at line 955 of file tty.c.

References tty_alloc_mutex().

Referenced by pts_alloc(), pts_alloc_external(), and terminal_maketty().

Here is the call graph for this function:

Here is the caller graph for this function:

struct tty* tty_alloc_mutex ( struct ttydevsw *  tsw,
void *  sc,
struct mtx *  mutex 
)

Definition at line 962 of file tty.c.

References cv_init(), free(), knlist_init_mtx(), malloc(), mtx_init(), PATCH_FUNC, and tty_init_termios().

Referenced by tty_alloc().

Here is the call graph for this function:

Here is the caller graph for this function:

int tty_checkoutq ( struct tty *  tp)

Definition at line 1767 of file tty.c.

Referenced by tprintf(), and tty_info().

Here is the caller graph for this function:

static void tty_dealloc ( void *  arg)
static

Definition at line 1017 of file tty.c.

References cv_destroy(), free(), knlist_destroy(), mtx_destroy(), and seldrain().

Referenced by tty_rel_free().

Here is the call graph for this function:

Here is the caller graph for this function:

static int tty_drain ( struct tty *  tp)
static

Definition at line 126 of file tty.c.

References tty_wait().

Referenced by tty_generic_ioctl(), and ttydev_leave().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_flush ( struct tty *  tp,
int  flags 
)

Definition at line 1368 of file tty.c.

References tty_hiwat_in_unblock(), tty_wakeup(), ttyinq_flush(), and ttyoutq_flush().

Referenced by tty_generic_ioctl(), ttydisc_modem(), and ttydisc_rint().

Here is the call graph for this function:

Here is the caller graph for this function:

static int tty_generic_ioctl ( struct tty *  tp,
u_long  cmd,
void *  data,
int  fflag,
struct thread *  td 
)
static
void tty_hiwat_in_block ( struct tty *  tp)

Definition at line 1775 of file tty.c.

References ttyoutq_write_nofrag().

Referenced by ttydisc_rint(), and ttydisc_rint_bypass().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_hiwat_in_unblock ( struct tty *  tp)

Definition at line 1795 of file tty.c.

References ttyoutq_write_nofrag().

Referenced by tty_flush(), and ttydisc_read().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_init_console ( struct tty *  tp,
speed_t  s 
)

Definition at line 840 of file tty.c.

static void tty_init_termios ( struct tty *  tp)
static

Definition at line 824 of file tty.c.

Referenced by tty_alloc_mutex().

Here is the caller graph for this function:

int tty_ioctl ( struct tty *  tp,
u_long  cmd,
void *  data,
int  fflag,
struct thread *  td 
)

Definition at line 1741 of file tty.c.

References tty_generic_ioctl().

Referenced by ptsdev_ioctl(), tty_ioctl_compat(), and ttydev_ioctl().

Here is the call graph for this function:

Here is the caller graph for this function:

static __inline int tty_is_ctty ( struct tty *  tp,
struct proc *  p 
)
static

Definition at line 357 of file tty.c.

Referenced by tty_generic_ioctl(), and tty_wait_background().

Here is the caller graph for this function:

static void tty_kqops_read_detach ( struct knote kn)
static

Definition at line 631 of file tty.c.

References knlist_remove().

Here is the call graph for this function:

static int tty_kqops_read_event ( struct knote kn,
long  hint 
)
static

Definition at line 639 of file tty.c.

static void tty_kqops_write_detach ( struct knote kn)
static

Definition at line 655 of file tty.c.

References knlist_remove().

Here is the call graph for this function:

static int tty_kqops_write_event ( struct knote kn,
long  hint 
)
static

Definition at line 663 of file tty.c.

void tty_makedev ( struct tty *  tp,
struct ucred *  cred,
const char *  fmt,
  ... 
)

Definition at line 1176 of file tty.c.

References dev_depends(), make_dev_cred(), mode, name, vsnrprintf(), and wakeup().

Referenced by pts_alloc(), pts_alloc_external(), and terminal_maketty().

Here is the call graph for this function:

Here is the caller graph for this function:

static void tty_rel_free ( struct tty *  tp)
static

Definition at line 1048 of file tty.c.

References destroy_dev_sched_cb(), TF_ACTIVITY, and tty_dealloc().

Referenced by tty_rel_gone(), tty_rel_sess(), ttydev_leave(), and ttyhook_unregister().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_rel_gone ( struct tty *  tp)

Definition at line 1097 of file tty.c.

References tty_rel_free(), tty_wakeup(), and ttydisc_modem().

Referenced by ptsdev_close().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_rel_pgrp ( struct tty *  tp,
struct pgrp *  pg 
)

Definition at line 1071 of file tty.c.

Referenced by pgdelete().

Here is the caller graph for this function:

void tty_rel_sess ( struct tty *  tp,
struct session *  sess 
)

Definition at line 1083 of file tty.c.

References tty_rel_free().

Referenced by sess_release().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_set_winsize ( struct tty *  tp,
const struct winsize *  wsz 
)

Definition at line 1385 of file tty.c.

References tty_signal_pgrp().

Referenced by terminal_sync_ttysize(), and tty_generic_ioctl().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_signal_pgrp ( struct tty *  tp,
int  sig 
)

Definition at line 1283 of file tty.c.

References pgsignal(), and tty_info().

Referenced by exit1(), ptsdev_ioctl(), tty_set_winsize(), and ttydisc_rint().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_signal_sessleader ( struct tty *  tp,
int  sig 
)

Definition at line 1264 of file tty.c.

References kern_psignal().

Referenced by ttydisc_modem().

Here is the call graph for this function:

Here is the caller graph for this function:

int tty_timedwait ( struct tty *  tp,
struct cv *  cv,
int  hz 
)

Definition at line 1346 of file tty.c.

Referenced by ttydisc_read_raw_read_timer().

Here is the caller graph for this function:

static void tty_to_xtty ( struct tty *  tp,
struct xtty *  xt 
)
static

Definition at line 1118 of file tty.c.

Referenced by sysctl_kern_ttys().

Here is the caller graph for this function:

dev_t tty_udev ( struct tty *  tp)

Definition at line 1758 of file tty.c.

Referenced by acct_process(), fill_kinfo_proc_only(), fill_pts_info(), ptsdev_stat(), and sysctl_kern_proc().

Here is the caller graph for this function:

int tty_wait ( struct tty *  tp,
struct cv *  cv 
)
int tty_wait_background ( struct tty *  tp,
struct thread *  td,
int  sig 
)

Definition at line 365 of file tty.c.

References pgsignal(), tty_is_ctty(), and tty_wait().

Referenced by ttydev_ioctl(), ttydev_write(), ttydisc_read_canonical(), ttydisc_read_raw_interbyte_timer(), ttydisc_read_raw_no_timer(), and ttydisc_read_raw_read_timer().

Here is the call graph for this function:

Here is the caller graph for this function:

void tty_wakeup ( struct tty *  tp,
int  flags 
)

Definition at line 1306 of file tty.c.

References pgsigio(), and selwakeup().

Referenced by tty_flush(), tty_generic_ioctl(), tty_rel_gone(), ttydev_close(), ttydisc_rint_done(), and ttydisc_wakeup_watermark().

Here is the call graph for this function:

Here is the caller graph for this function:

static void ttyconsdev_init ( void *  unused)
static

Definition at line 1994 of file tty.c.

References make_dev_credf().

Here is the call graph for this function:

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

Definition at line 1940 of file tty.c.

References ttydev_open().

Here is the call graph for this function:

void ttyconsdev_select ( const char *  name)

Definition at line 2004 of file tty.c.

References name.

Referenced by cnadd(), cnremove(), and cnselect().

Here is the caller graph for this function:

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

Definition at line 1966 of file tty.c.

References log_console(), and ttydev_write().

Here is the call graph for this function:

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

Definition at line 318 of file tty.c.

References tty_wakeup(), and ttydev_leave().

Here is the call graph for this function:

static __inline int ttydev_enter ( struct tty *  tp)
static

Definition at line 159 of file tty.c.

Referenced by ttydev_ioctl(), ttydev_kqfilter(), ttydev_mmap(), ttydev_poll(), ttydev_read(), and ttydev_write().

Here is the caller graph for this function:

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

Definition at line 486 of file tty.c.

References TTY_CALLOUT, tty_ioctl(), tty_wait_background(), and ttydev_enter().

Here is the call graph for this function:

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

Definition at line 690 of file tty.c.

References knlist_add(), tty_kqops_read, tty_kqops_write, and ttydev_enter().

Here is the call graph for this function:

static void ttydev_leave ( struct tty *  tp)
static

Definition at line 173 of file tty.c.

References constty_clear(), funsetown(), tty_drain(), tty_rel_free(), ttydisc_close(), ttyinq_free(), and ttyoutq_free().

Referenced by ttydev_close(), and ttydev_open().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 609 of file tty.c.

References ttydev_enter().

Here is the call graph for this function:

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

Definition at line 220 of file tty.c.

References priv_check(), TTY_CALLOUT, tty_wait(), ttydev_leave(), and ttydisc_open().

Referenced by ttyconsdev_open().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 572 of file tty.c.

References selrecord(), and ttydev_enter().

Here is the call graph for this function:

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

Definition at line 428 of file tty.c.

References ttydev_enter(), and ttydisc_read().

Here is the call graph for this function:

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

Definition at line 449 of file tty.c.

References cv_signal(), tty_wait(), tty_wait_background(), ttydev_enter(), and ttydisc_write().

Referenced by ttyconsdev_write().

Here is the call graph for this function:

Here is the caller graph for this function:

static int ttydevsw_defcioctl ( struct tty *  tp,
int  unit,
u_long  cmd,
caddr_t  data,
struct thread *  td 
)
static

Definition at line 892 of file tty.c.

static void ttydevsw_defclose ( struct tty *  tp)
static

Definition at line 868 of file tty.c.

static void ttydevsw_deffree ( void *  softc)
static

Definition at line 942 of file tty.c.

References panic().

Here is the call graph for this function:

static void ttydevsw_definwakeup ( struct tty *  tp)
static

Definition at line 880 of file tty.c.

static int ttydevsw_defioctl ( struct tty *  tp,
u_long  cmd,
caddr_t  data,
struct thread *  td 
)
static

Definition at line 885 of file tty.c.

static int ttydevsw_defmmap ( struct tty *  tp,
vm_ooffset_t  offset,
vm_paddr_t *  paddr,
int  nprot,
vm_memattr_t *  memattr 
)
static

Definition at line 929 of file tty.c.

static int ttydevsw_defmodem ( struct tty *  tp,
int  sigon,
int  sigoff 
)
static

Definition at line 921 of file tty.c.

static int ttydevsw_defopen ( struct tty *  tp)
static

Definition at line 861 of file tty.c.

static void ttydevsw_defoutwakeup ( struct tty *  tp)
static

Definition at line 873 of file tty.c.

References panic().

Here is the call graph for this function:

static int ttydevsw_defparam ( struct tty *  tp,
struct termios *  t 
)
static

Definition at line 899 of file tty.c.

static void ttydevsw_defpktnotify ( struct tty *  tp,
char  event 
)
static

Definition at line 937 of file tty.c.

static int ttyhook_defrint ( struct tty *  tp,
char  c,
int  flags 
)
static

Definition at line 1822 of file tty.c.

Referenced by ttyhook_register().

Here is the caller graph for this function:

int ttyhook_register ( struct tty **  rtp,
struct proc *  p,
int  fd,
struct ttyhook *  th,
void *  softc 
)

Definition at line 1832 of file tty.c.

References badfileops, cap_funwrap(), dev_relthread(), devvn_refthread(), fget_unlocked(), ttydisc_optimize(), and ttyhook_defrint().

Here is the call graph for this function:

void ttyhook_unregister ( struct tty *  tp)

Definition at line 1918 of file tty.c.

References tty_rel_free(), and ttydisc_optimize().

Here is the call graph for this function:

static int ttyil_close ( struct cdev *  dev,
int  flag,
int  mode,
struct thread *  td 
)
static

Definition at line 757 of file tty.c.

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

Definition at line 769 of file tty.c.

References priv_check().

Here is the call graph for this function:

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

Definition at line 738 of file tty.c.

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

Definition at line 763 of file tty.c.

Variable Documentation

struct filterops tty_kqops_read
static
Initial value:
= {
.f_isfd = 1,
.f_detach = tty_kqops_read_detach,
}
static int tty_kqops_read_event(struct knote *kn, long hint)
Definition: tty.c:639
static void tty_kqops_read_detach(struct knote *kn)
Definition: tty.c:631

Definition at line 678 of file tty.c.

Referenced by ttydev_kqfilter().

struct filterops tty_kqops_write
static
Initial value:
= {
.f_isfd = 1,
}
static int tty_kqops_write_event(struct knote *kn, long hint)
Definition: tty.c:663
static void tty_kqops_write_detach(struct knote *kn)
Definition: tty.c:655

Definition at line 683 of file tty.c.

Referenced by ttydev_kqfilter().

struct cdevsw ttyconsdev_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_open = ttyconsdev_open,
.d_close = ttydev_close,
.d_read = ttydev_read,
.d_write = ttyconsdev_write,
.d_ioctl = ttydev_ioctl,
.d_kqfilter = ttydev_kqfilter,
.d_poll = ttydev_poll,
.d_mmap = ttydev_mmap,
.d_name = "ttyconsdev",
.d_flags = D_TTY,
}
static int ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
Definition: tty.c:318
static int ttyconsdev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
Definition: tty.c:1940
static int ttydev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
Definition: tty.c:609
static int ttydev_kqfilter(struct cdev *dev, struct knote *kn)
Definition: tty.c:690
static int ttyconsdev_write(struct cdev *dev, struct uio *uio, int ioflag)
Definition: tty.c:1966
static int ttydev_poll(struct cdev *dev, int events, struct thread *td)
Definition: tty.c:572
static int ttydev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
Definition: tty.c:486
static int ttydev_read(struct cdev *dev, struct uio *uio, int ioflag)
Definition: tty.c:428

Definition at line 1979 of file tty.c.

struct cdevsw ttydev_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_open = ttydev_open,
.d_close = ttydev_close,
.d_read = ttydev_read,
.d_write = ttydev_write,
.d_ioctl = ttydev_ioctl,
.d_kqfilter = ttydev_kqfilter,
.d_poll = ttydev_poll,
.d_mmap = ttydev_mmap,
.d_name = "ttydev",
.d_flags = D_TTY,
}
static int ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
Definition: tty.c:318
static int ttydev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr)
Definition: tty.c:609
static int ttydev_kqfilter(struct cdev *dev, struct knote *kn)
Definition: tty.c:690
static int ttydev_write(struct cdev *dev, struct uio *uio, int ioflag)
Definition: tty.c:449
static int ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
Definition: tty.c:220
static int ttydev_poll(struct cdev *dev, int events, struct thread *td)
Definition: tty.c:572
static int ttydev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
Definition: tty.c:486
static int ttydev_read(struct cdev *dev, struct uio *uio, int ioflag)
Definition: tty.c:428

Definition at line 719 of file tty.c.

struct cdevsw ttyil_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_open = ttyil_open,
.d_close = ttyil_close,
.d_read = ttyil_rdwr,
.d_write = ttyil_rdwr,
.d_ioctl = ttyil_ioctl,
.d_name = "ttyil",
.d_flags = D_TTY,
}
static int ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
Definition: tty.c:738
static int ttyil_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
Definition: tty.c:769
static int ttyil_close(struct cdev *dev, int flag, int mode, struct thread *td)
Definition: tty.c:757
static int ttyil_rdwr(struct cdev *dev, struct uio *uio, int ioflag)
Definition: tty.c:763

Definition at line 812 of file tty.c.