FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <sys/uio.h>
#include <vm/uma.h>
Go to the source code of this file.
Data Structures | |
struct | ttyinq_block |
Macros | |
#define | TTYINQ_QUOTESIZE (TTYINQ_DATASIZE / BMSIZE) |
#define | BMSIZE 32 |
#define | GETBIT(tib, boff) ((tib)->tib_quotes[(boff) / BMSIZE] & (1 << ((boff) % BMSIZE))) |
#define | SETBIT(tib, boff) ((tib)->tib_quotes[(boff) / BMSIZE] |= (1 << ((boff) % BMSIZE))) |
#define | CLRBIT(tib, boff) ((tib)->tib_quotes[(boff) / BMSIZE] &= ~(1 << ((boff) % BMSIZE))) |
#define | TTYINQ_INSERT_TAIL(ti, tib) |
#define | TTYINQ_REMOVE_HEAD(ti) |
#define | TTYINQ_RECYCLE(ti, tib) |
#define | CORRECT_BLOCK(t) |
Functions | |
__FBSDID ("$BSDSUniX$") | |
SYSCTL_INT (_kern, OID_AUTO, tty_inq_flush_secure, CTLFLAG_RW,&ttyinq_flush_secure, 0,"Zero buffers while flushing") | |
void | ttyinq_setsize (struct ttyinq *ti, struct tty *tp, size_t size) |
void | ttyinq_free (struct ttyinq *ti) |
int | ttyinq_read_uio (struct ttyinq *ti, struct tty *tp, struct uio *uio, size_t rlen, size_t flen) |
static __inline void | ttyinq_set_quotes (struct ttyinq_block *tib, size_t offset, size_t length, int value) |
size_t | ttyinq_write (struct ttyinq *ti, const void *buf, size_t nbytes, int quote) |
int | ttyinq_write_nofrag (struct ttyinq *ti, const void *buf, size_t nbytes, int quote) |
void | ttyinq_canonicalize (struct ttyinq *ti) |
size_t | ttyinq_findchar (struct ttyinq *ti, const char *breakc, size_t maxlen, char *lastc) |
void | ttyinq_flush (struct ttyinq *ti) |
int | ttyinq_peekchar (struct ttyinq *ti, char *c, int *quote) |
void | ttyinq_unputchar (struct ttyinq *ti) |
void | ttyinq_reprintpos_set (struct ttyinq *ti) |
void | ttyinq_reprintpos_reset (struct ttyinq *ti) |
static void | ttyinq_line_iterate (struct ttyinq *ti, ttyinq_line_iterator_t *iterator, void *data, unsigned int offset, struct ttyinq_block *tib) |
void | ttyinq_line_iterate_from_linestart (struct ttyinq *ti, ttyinq_line_iterator_t *iterator, void *data) |
void | ttyinq_line_iterate_from_reprintpos (struct ttyinq *ti, ttyinq_line_iterator_t *iterator, void *data) |
static void | ttyinq_startup (void *dummy) |
SYSINIT (ttyinq, SI_SUB_DRIVERS, SI_ORDER_FIRST, ttyinq_startup, NULL) | |
Variables | |
static int | ttyinq_flush_secure = 1 |
static uma_zone_t | ttyinq_zone |
Definition at line 74 of file tty_inq.c.
Referenced by ttyinq_set_quotes().
#define CORRECT_BLOCK | ( | t | ) |
Referenced by ttyinq_read_uio().
Definition at line 70 of file tty_inq.c.
Referenced by ttyinq_findchar(), ttyinq_line_iterate(), and ttyinq_peekchar().
Definition at line 72 of file tty_inq.c.
Referenced by ttyinq_set_quotes().
#define TTYINQ_INSERT_TAIL | ( | ti, | |
tib | |||
) |
Definition at line 86 of file tty_inq.c.
Referenced by ttyinq_setsize().
#define TTYINQ_RECYCLE | ( | ti, | |
tib | |||
) |
Definition at line 108 of file tty_inq.c.
Referenced by ttyinq_read_uio().
#define TTYINQ_REMOVE_HEAD | ( | ti | ) |
Definition at line 101 of file tty_inq.c.
Referenced by ttyinq_free(), and ttyinq_read_uio().
__FBSDID | ( | "$BSDSUniX$" | ) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
tty_inq_flush_secure | , | ||
CTLFLAG_RW | , | ||
& | ttyinq_flush_secure, | ||
0 | , | ||
"Zero buffers while flushing" | |||
) |
SYSINIT | ( | ttyinq | , |
SI_SUB_DRIVERS | , | ||
SI_ORDER_FIRST | , | ||
ttyinq_startup | , | ||
NULL | |||
) |
void ttyinq_canonicalize | ( | struct ttyinq * | ti | ) |
Definition at line 336 of file tty_inq.c.
Referenced by tty_generic_ioctl(), ttydisc_rint(), and ttydisc_rint_bypass().
size_t ttyinq_findchar | ( | struct ttyinq * | ti, |
const char * | breakc, | ||
size_t | maxlen, | ||
char * | lastc | ||
) |
Definition at line 344 of file tty_inq.c.
References GETBIT, and ttyinq_block::tib_data.
Referenced by ttydisc_read_canonical().
void ttyinq_flush | ( | struct ttyinq * | ti | ) |
Definition at line 370 of file tty_inq.c.
References ttyinq_block::tib_data, ttyinq_block::tib_next, and ttyinq_flush_secure.
Referenced by tty_flush(), ttydisc_close(), and ttyinq_free().
void ttyinq_free | ( | struct ttyinq * | ti | ) |
Definition at line 142 of file tty_inq.c.
References ttyinq_flush(), TTYINQ_REMOVE_HEAD, and ttyinq_zone.
Referenced by ttydev_leave().
|
static |
Definition at line 438 of file tty_inq.c.
References GETBIT, ttyinq_block::tib_data, and ttyinq_block::tib_next.
Referenced by ttyinq_line_iterate_from_linestart(), and ttyinq_line_iterate_from_reprintpos().
void ttyinq_line_iterate_from_linestart | ( | struct ttyinq * | ti, |
ttyinq_line_iterator_t * | iterator, | ||
void * | data | ||
) |
Definition at line 464 of file tty_inq.c.
References ttyinq_line_iterate().
Referenced by ttydisc_reprint().
void ttyinq_line_iterate_from_reprintpos | ( | struct ttyinq * | ti, |
ttyinq_line_iterator_t * | iterator, | ||
void * | data | ||
) |
Definition at line 473 of file tty_inq.c.
References ttyinq_line_iterate().
Referenced by ttydisc_recalc_linelength().
int ttyinq_peekchar | ( | struct ttyinq * | ti, |
char * | c, | ||
int * | quote | ||
) |
Definition at line 387 of file tty_inq.c.
References GETBIT, and ttyinq_block::tib_data.
Referenced by ttydisc_rubchar(), and ttydisc_rubword().
int ttyinq_read_uio | ( | struct ttyinq * | ti, |
struct tty * | tp, | ||
struct uio * | uio, | ||
size_t | rlen, | ||
size_t | flen | ||
) |
Definition at line 158 of file tty_inq.c.
References CORRECT_BLOCK, ttyinq_block::tib_data, TTYINQ_RECYCLE, TTYINQ_REMOVE_HEAD, and uiomove().
Referenced by ttydisc_read_canonical(), ttydisc_read_raw_interbyte_timer(), ttydisc_read_raw_no_timer(), and ttydisc_read_raw_read_timer().
void ttyinq_reprintpos_reset | ( | struct ttyinq * | ti | ) |
Definition at line 430 of file tty_inq.c.
Referenced by ttydisc_reprint().
void ttyinq_reprintpos_set | ( | struct ttyinq * | ti | ) |
Definition at line 422 of file tty_inq.c.
Referenced by tty_putchar(), ttydisc_write(), and ttydisc_write_oproc().
|
static |
Definition at line 257 of file tty_inq.c.
References CLRBIT, and SETBIT.
Referenced by ttyinq_write().
void ttyinq_setsize | ( | struct ttyinq * | ti, |
struct tty * | tp, | ||
size_t | size | ||
) |
Definition at line 116 of file tty_inq.c.
References TTYINQ_INSERT_TAIL, and ttyinq_zone.
Referenced by TAILQ_HEAD().
|
static |
Definition at line 482 of file tty_inq.c.
References ttyinq_zone.
void ttyinq_unputchar | ( | struct ttyinq * | ti | ) |
Definition at line 405 of file tty_inq.c.
Referenced by ttydisc_rubchar().
size_t ttyinq_write | ( | struct ttyinq * | ti, |
const void * | buf, | ||
size_t | nbytes, | ||
int | quote | ||
) |
Definition at line 273 of file tty_inq.c.
References buf, ttyinq_block::tib_data, ttyinq_block::tib_next, and ttyinq_set_quotes().
Referenced by ttydisc_rint_bypass(), and ttyinq_write_nofrag().
int ttyinq_write_nofrag | ( | struct ttyinq * | ti, |
const void * | buf, | ||
size_t | nbytes, | ||
int | quote | ||
) |
Definition at line 321 of file tty_inq.c.
References ttyinq_write().
Referenced by ttydisc_rint().
|
static |
Definition at line 64 of file tty_inq.c.
Referenced by ttyinq_flush().
|
static |
Definition at line 84 of file tty_inq.c.
Referenced by ttyinq_free(), ttyinq_setsize(), and ttyinq_startup().