xref: /titanic_50/usr/src/uts/common/sys/console.h (revision aecfc01d1bad84e66649703f7fc2926ef70b34ba)
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
5fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6fea9cb91Slq150181  * 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  */
21fea9cb91Slq150181 
227c478bd9Sstevel@tonic-gate /*
23*aecfc01dSrui zang - Sun Microsystems - Beijing China  * Copyright 2008 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 #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
34fea9cb91Slq150181 /*
35fea9cb91Slq150181  * Sun private interface for cn driver
36fea9cb91Slq150181  */
37fea9cb91Slq150181 #define	_CNIOC		(('C'<<24)|('N'<<16))
38fea9cb91Slq150181 #define	_CNIOC_MASK	(~0xffff)
39fea9cb91Slq150181 #define	CONS_GETTERM	(_CNIOC | 0)
40fea9cb91Slq150181 
41fea9cb91Slq150181 #define	MAX_TERM_TYPE_LEN	10
42fea9cb91Slq150181 
43fea9cb91Slq150181 struct cons_getterm {
44fea9cb91Slq150181 	uint_t	cn_term_len;
45fea9cb91Slq150181 	char	*cn_term_type;
46fea9cb91Slq150181 };
47fea9cb91Slq150181 
487c478bd9Sstevel@tonic-gate #ifdef _KERNEL
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #include <sys/vnode.h>
517c478bd9Sstevel@tonic-gate #include <sys/taskq.h>
527c478bd9Sstevel@tonic-gate #include <sys/varargs.h>
537c478bd9Sstevel@tonic-gate 
54fea9cb91Slq150181 #ifdef _SYSCALL32
55fea9cb91Slq150181 struct cons_getterm32 {
56fea9cb91Slq150181 	uint32_t  cn_term_len;
57fea9cb91Slq150181 	caddr32_t cn_term_type;
58fea9cb91Slq150181 };
59fea9cb91Slq150181 #endif /* _SYSCALL32 */
60fea9cb91Slq150181 
617c478bd9Sstevel@tonic-gate extern void console_get_size(ushort_t *r, ushort_t *c,
627c478bd9Sstevel@tonic-gate 	ushort_t *x, ushort_t *y);
637c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
647c478bd9Sstevel@tonic-gate extern void console_printf(const char *, ...) __KPRINTFLIKE(1);
657c478bd9Sstevel@tonic-gate extern void console_vprintf(const char *, va_list) __KVPRINTFLIKE(1);
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate extern void console_puts(const char *, size_t);
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate extern void console_gets(char *, size_t);
707c478bd9Sstevel@tonic-gate extern int console_getc(void);
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate extern int console_enter(int);
737c478bd9Sstevel@tonic-gate extern void console_exit(int, int);
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate extern vnode_t *console_vnode;
767c478bd9Sstevel@tonic-gate extern taskq_t *console_taskq;
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
817c478bd9Sstevel@tonic-gate }
827c478bd9Sstevel@tonic-gate #endif
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #endif	/* _SYS_CONSOLE_H */
85