xref: /titanic_54/usr/src/uts/common/sys/console.h (revision fea9cb91bd8e12d84069b4dab1268363668b4bff)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6*fea9cb91Slq150181  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*fea9cb91Slq150181 
227c478bd9Sstevel@tonic-gate /*
23*fea9cb91Slq150181  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_CONSOLE_H
287c478bd9Sstevel@tonic-gate #define	_SYS_CONSOLE_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
36*fea9cb91Slq150181 /*
37*fea9cb91Slq150181  * Sun private interface for cn driver
38*fea9cb91Slq150181  */
39*fea9cb91Slq150181 #define	_CNIOC		(('C'<<24)|('N'<<16))
40*fea9cb91Slq150181 #define	_CNIOC_MASK	(~0xffff)
41*fea9cb91Slq150181 #define	CONS_GETTERM	(_CNIOC | 0)
42*fea9cb91Slq150181 
43*fea9cb91Slq150181 #define	MAX_TERM_TYPE_LEN	10
44*fea9cb91Slq150181 
45*fea9cb91Slq150181 struct cons_getterm {
46*fea9cb91Slq150181 	uint_t	cn_term_len;
47*fea9cb91Slq150181 	char	*cn_term_type;
48*fea9cb91Slq150181 };
49*fea9cb91Slq150181 
507c478bd9Sstevel@tonic-gate #ifdef _KERNEL
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate #include <sys/vnode.h>
537c478bd9Sstevel@tonic-gate #include <sys/taskq.h>
547c478bd9Sstevel@tonic-gate #include <sys/varargs.h>
557c478bd9Sstevel@tonic-gate 
56*fea9cb91Slq150181 #ifdef _SYSCALL32
57*fea9cb91Slq150181 struct cons_getterm32 {
58*fea9cb91Slq150181 	uint32_t  cn_term_len;
59*fea9cb91Slq150181 	caddr32_t cn_term_type;
60*fea9cb91Slq150181 };
61*fea9cb91Slq150181 #endif /* _SYSCALL32 */
62*fea9cb91Slq150181 
637c478bd9Sstevel@tonic-gate extern void console_get_size(ushort_t *r, ushort_t *c,
647c478bd9Sstevel@tonic-gate 	ushort_t *x, ushort_t *y);
657c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
667c478bd9Sstevel@tonic-gate extern void console_printf(const char *, ...) __KPRINTFLIKE(1);
677c478bd9Sstevel@tonic-gate extern void console_vprintf(const char *, va_list) __KVPRINTFLIKE(1);
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate extern void console_puts(const char *, size_t);
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate extern void console_gets(char *, size_t);
727c478bd9Sstevel@tonic-gate extern int console_getc(void);
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate extern int console_enter(int);
757c478bd9Sstevel@tonic-gate extern void console_exit(int, int);
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate extern vnode_t *console_vnode;
787c478bd9Sstevel@tonic-gate extern taskq_t *console_taskq;
797c478bd9Sstevel@tonic-gate 
80*fea9cb91Slq150181 /*
81*fea9cb91Slq150181  * PROM interface callback routine
82*fea9cb91Slq150181  */
83*fea9cb91Slq150181 #ifdef _HAVE_TEM_FIRMWARE
84*fea9cb91Slq150181 #include <sys/promif.h>
85*fea9cb91Slq150181 extern ssize_t console_prom_write_cb(promif_redir_arg_t, uchar_t *, size_t);
86*fea9cb91Slq150181 #endif /* _HAVE_TEM_FIRMWARE */
87*fea9cb91Slq150181 
887c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
897c478bd9Sstevel@tonic-gate 
907c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
917c478bd9Sstevel@tonic-gate }
927c478bd9Sstevel@tonic-gate #endif
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #endif	/* _SYS_CONSOLE_H */
95