FreeBSD kernel kern code
tty_outq.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <sys/uio.h>
#include <vm/uma.h>
Include dependency graph for tty_outq.c:

Go to the source code of this file.

Data Structures

struct  ttyoutq_block
 

Macros

#define TTYOUTQ_INSERT_TAIL(to, tob)
 
#define TTYOUTQ_REMOVE_HEAD(to)
 
#define TTYOUTQ_RECYCLE(to, tob)
 

Functions

 __FBSDID ("$FreeBSD$")
 
void ttyoutq_flush (struct ttyoutq *to)
 
int ttyoutq_setsize (struct ttyoutq *to, struct tty *tp, size_t size)
 
void ttyoutq_free (struct ttyoutq *to)
 
size_t ttyoutq_read (struct ttyoutq *to, void *buf, size_t len)
 
int ttyoutq_read_uio (struct ttyoutq *to, struct tty *tp, struct uio *uio)
 
size_t ttyoutq_write (struct ttyoutq *to, const void *buf, size_t nbytes)
 
int ttyoutq_write_nofrag (struct ttyoutq *to, const void *buf, size_t nbytes)
 
static void ttyoutq_startup (void *dummy)
 
 SYSINIT (ttyoutq, SI_SUB_DRIVERS, SI_ORDER_FIRST, ttyoutq_startup, NULL)
 

Variables

static uma_zone_t ttyoutq_zone
 

Macro Definition Documentation

◆ TTYOUTQ_INSERT_TAIL

#define TTYOUTQ_INSERT_TAIL (   to,
  tob 
)
Value:
do { \
if (to->to_end == 0) { \
tob->tob_next = to->to_firstblock; \
to->to_firstblock = tob; \
} else { \
tob->tob_next = to->to_lastblock->tob_next; \
to->to_lastblock->tob_next = tob; \
} \
to->to_nblocks++; \
} while (0)

Definition at line 63 of file tty_outq.c.

◆ TTYOUTQ_RECYCLE

#define TTYOUTQ_RECYCLE (   to,
  tob 
)
Value:
do { \
if (to->to_quota <= to->to_nblocks) \
uma_zfree(ttyoutq_zone, tob); \
} while (0)
static uma_zone_t ttyoutq_zone
Definition: tty_outq.c:61
#define TTYOUTQ_INSERT_TAIL(to, tob)
Definition: tty_outq.c:63

Definition at line 79 of file tty_outq.c.

◆ TTYOUTQ_REMOVE_HEAD

#define TTYOUTQ_REMOVE_HEAD (   to)
Value:
do { \
to->to_firstblock = to->to_firstblock->tob_next; \
to->to_nblocks--; \
} while (0)

Definition at line 74 of file tty_outq.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ SYSINIT()

SYSINIT ( ttyoutq  ,
SI_SUB_DRIVERS  ,
SI_ORDER_FIRST  ,
ttyoutq_startup  ,
NULL   
)

◆ ttyoutq_flush()

void ttyoutq_flush ( struct ttyoutq *  to)

Definition at line 87 of file tty_outq.c.

Referenced by tty_flush(), and ttyoutq_free().

Here is the caller graph for this function:

◆ ttyoutq_free()

void ttyoutq_free ( struct ttyoutq *  to)

Definition at line 127 of file tty_outq.c.

References ttyoutq_flush(), TTYOUTQ_REMOVE_HEAD, and ttyoutq_zone.

Referenced by tty_dealloc(), and ttydev_leave().

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

◆ ttyoutq_read()

size_t ttyoutq_read ( struct ttyoutq *  to,
void *  buf,
size_t  len 
)

Definition at line 143 of file tty_outq.c.

References buf, ttyoutq_block::tob_data, TTYOUTQ_RECYCLE, and TTYOUTQ_REMOVE_HEAD.

Referenced by ttydisc_getc().

Here is the caller graph for this function:

◆ ttyoutq_read_uio()

int ttyoutq_read_uio ( struct ttyoutq *  to,
struct tty *  tp,
struct uio *  uio 
)

Definition at line 204 of file tty_outq.c.

References ttyoutq_block::tob_data, TTYOUTQ_RECYCLE, TTYOUTQ_REMOVE_HEAD, and uiomove().

Referenced by ttydisc_getc_uio().

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

◆ ttyoutq_setsize()

int ttyoutq_setsize ( struct ttyoutq *  to,
struct tty *  tp,
size_t  size 
)

Definition at line 95 of file tty_outq.c.

References TTYOUTQ_INSERT_TAIL, and ttyoutq_zone.

◆ ttyoutq_startup()

static void ttyoutq_startup ( void *  dummy)
static

Definition at line 340 of file tty_outq.c.

References ttyoutq_zone.

◆ ttyoutq_write()

size_t ttyoutq_write ( struct ttyoutq *  to,
const void *  buf,
size_t  nbytes 
)

Definition at line 280 of file tty_outq.c.

References buf, nbytes, ttyoutq_block::tob_data, and ttyoutq_block::tob_next.

Referenced by ttydisc_write(), and ttyoutq_write_nofrag().

Here is the caller graph for this function:

◆ ttyoutq_write_nofrag()

int ttyoutq_write_nofrag ( struct ttyoutq *  to,
const void *  buf,
size_t  nbytes 
)

Definition at line 325 of file tty_outq.c.

References buf, nbytes, and ttyoutq_write().

Referenced by tty_hiwat_in_block(), tty_hiwat_in_unblock(), ttydisc_echo_force(), ttydisc_rint(), ttydisc_rubchar(), and ttydisc_write_oproc().

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

Variable Documentation

◆ ttyoutq_zone

uma_zone_t ttyoutq_zone
static

Definition at line 61 of file tty_outq.c.

Referenced by ttyoutq_free(), ttyoutq_setsize(), and ttyoutq_startup().