xref: /illumos-gate/usr/src/uts/common/sys/tty.h (revision 2d6eb4a5)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1987-1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SYS_TTY_H
28 #define	_SYS_TTY_H
29 
30 #include <sys/stream.h>
31 #include <sys/termios.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 typedef struct tty_common {
38 	int	t_flags;
39 	queue_t	*t_readq;	/* stream's read queue */
40 	queue_t	*t_writeq;	/* stream's write queue */
41 	tcflag_t t_iflag;	/* copy of iflag from tty modes */
42 	tcflag_t t_cflag;	/* copy of cflag from tty modes */
43 	uchar_t	t_stopc;	/* copy of c_cc[VSTOP] from tty modes */
44 	uchar_t	t_startc;	/* copy of c_cc[VSTART] from tty modes */
45 	struct winsize t_size;	/* screen/page size */
46 	mblk_t	*t_iocpending;	/* ioctl reply pending successful allocation */
47 	kmutex_t t_excl;	/* keeps struct consistent */
48 } tty_common_t;
49 
50 #define	TS_XCLUDE	0x00000001	/* tty is open for exclusive use */
51 #define	TS_SOFTCAR	0x00000002	/* force carrier on */
52 
53 #ifdef	_KERNEL
54 extern void	ttycommon_close(tty_common_t *);
55 extern void	ttycommon_qfull(tty_common_t *, queue_t *);
56 extern size_t	ttycommon_ioctl(tty_common_t *, queue_t *, mblk_t *, int *);
57 #endif	/* _KERNEL */
58 
59 #ifdef	__cplusplus
60 }
61 #endif
62 
63 #endif /* _SYS_TTY_H */
64