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 2008 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 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /* 35 * Sun private interface for cn driver 36 */ 37 #define _CNIOC (('C'<<24)|('N'<<16)) 38 #define _CNIOC_MASK (~0xffff) 39 #define CONS_GETTERM (_CNIOC | 0) 40 #define CONS_GETDEV (_CNIOC | 1) 41 42 #define MAX_TERM_TYPE_LEN 10 43 44 struct cons_getterm { 45 uint_t cn_term_len; 46 char *cn_term_type; 47 }; 48 49 struct cons_getdev { 50 dev_t cnd_rconsdev; 51 }; 52 53 #ifdef _KERNEL 54 55 #include <sys/vnode.h> 56 #include <sys/taskq.h> 57 #include <sys/varargs.h> 58 59 #ifdef _SYSCALL32 60 struct cons_getterm32 { 61 uint32_t cn_term_len; 62 caddr32_t cn_term_type; 63 }; 64 65 struct cons_getdev32 { 66 dev32_t cnd_rconsdev; 67 }; 68 #endif /* _SYSCALL32 */ 69 70 extern void console_get_size(ushort_t *r, ushort_t *c, 71 ushort_t *x, ushort_t *y); 72 /*PRINTFLIKE1*/ 73 extern void console_printf(const char *, ...) __KPRINTFLIKE(1); 74 extern void console_vprintf(const char *, va_list) __KVPRINTFLIKE(1); 75 76 extern void console_puts(const char *, size_t); 77 78 extern void console_gets(char *, size_t); 79 extern int console_getc(void); 80 81 extern int console_enter(int); 82 extern void console_exit(int, int); 83 84 extern vnode_t *console_vnode; 85 extern taskq_t *console_taskq; 86 87 #endif /* _KERNEL */ 88 89 #ifdef __cplusplus 90 } 91 #endif 92 93 #endif /* _SYS_CONSOLE_H */ 94