xref: /illumos-gate/usr/src/uts/common/sys/tty.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SunOS 4.0 2.13 */
31 
32 #include <sys/stream.h>
33 #include <sys/termios.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 typedef struct tty_common {
40 	int	t_flags;
41 	queue_t	*t_readq;	/* stream's read queue */
42 	queue_t	*t_writeq;	/* stream's write queue */
43 	tcflag_t t_iflag;	/* copy of iflag from tty modes */
44 	tcflag_t t_cflag;	/* copy of cflag from tty modes */
45 	uchar_t	t_stopc;	/* copy of c_cc[VSTOP] from tty modes */
46 	uchar_t	t_startc;	/* copy of c_cc[VSTART] from tty modes */
47 	struct winsize t_size;	/* screen/page size */
48 	mblk_t	*t_iocpending;	/* ioctl reply pending successful allocation */
49 	kmutex_t t_excl;	/* keeps struct consistent */
50 } tty_common_t;
51 
52 #define	TS_XCLUDE	0x00000001	/* tty is open for exclusive use */
53 #define	TS_SOFTCAR	0x00000002	/* force carrier on */
54 
55 #ifdef	_KERNEL
56 extern void	ttycommon_close(tty_common_t *);
57 extern void	ttycommon_qfull(tty_common_t *, queue_t *);
58 extern size_t	ttycommon_ioctl(tty_common_t *, queue_t *, mblk_t *, int *);
59 #endif	/* _KERNEL */
60 
61 #ifdef	__cplusplus
62 }
63 #endif
64 
65 #endif /* _SYS_TTY_H */
66