xref: /illumos-gate/usr/src/uts/common/sys/console.h (revision 3db86aab)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_CONSOLE_H
28 #define	_SYS_CONSOLE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Sun private interface for cn driver
38  */
39 #define	_CNIOC		(('C'<<24)|('N'<<16))
40 #define	_CNIOC_MASK	(~0xffff)
41 #define	CONS_GETTERM	(_CNIOC | 0)
42 
43 #define	MAX_TERM_TYPE_LEN	10
44 
45 struct cons_getterm {
46 	uint_t	cn_term_len;
47 	char	*cn_term_type;
48 };
49 
50 #ifdef _KERNEL
51 
52 #include <sys/vnode.h>
53 #include <sys/taskq.h>
54 #include <sys/varargs.h>
55 
56 #ifdef _SYSCALL32
57 struct cons_getterm32 {
58 	uint32_t  cn_term_len;
59 	caddr32_t cn_term_type;
60 };
61 #endif /* _SYSCALL32 */
62 
63 extern void console_get_size(ushort_t *r, ushort_t *c,
64 	ushort_t *x, ushort_t *y);
65 /*PRINTFLIKE1*/
66 extern void console_printf(const char *, ...) __KPRINTFLIKE(1);
67 extern void console_vprintf(const char *, va_list) __KVPRINTFLIKE(1);
68 
69 extern void console_puts(const char *, size_t);
70 
71 extern void console_gets(char *, size_t);
72 extern int console_getc(void);
73 
74 extern int console_enter(int);
75 extern void console_exit(int, int);
76 
77 extern vnode_t *console_vnode;
78 extern taskq_t *console_taskq;
79 
80 /*
81  * PROM interface callback routine
82  */
83 #ifdef _HAVE_TEM_FIRMWARE
84 #include <sys/promif.h>
85 extern ssize_t console_prom_write_cb(promif_redir_arg_t, uchar_t *, size_t);
86 #endif /* _HAVE_TEM_FIRMWARE */
87 
88 #endif	/* _KERNEL */
89 
90 #ifdef	__cplusplus
91 }
92 #endif
93 
94 #endif	/* _SYS_CONSOLE_H */
95