xref: /illumos-gate/usr/src/boot/sys/sys/tem.h (revision 856f710c9dc323b39da5935194d7928ffb99b67f)
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 /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
27 
28 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
29 /*		All Rights Reserved	*/
30 
31 #ifndef	_SYS_TEM_H
32 #define	_SYS_TEM_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #include <sys/types.h>
39 #include <sys/visual_io.h>
40 
41 typedef uint8_t text_color_t;
42 
43 typedef struct __tem_modechg_cb_arg *tem_modechg_cb_arg_t;
44 typedef void (*tem_modechg_cb_t) (tem_modechg_cb_arg_t arg);
45 typedef	struct __tem_vt_state *tem_vt_state_t;
46 
47 /*
48  * tems_* fuctions mean that they just operate on the common soft state
49  * (tem_state_t), and tem_* functions mean that they operate on the
50  * per-tem structure (tem_vt_state).
51  */
52 int	tems_cls(struct vis_consclear *);
53 void	tems_display(struct vis_consdisplay *);
54 void	tems_copy(struct vis_conscopy *);
55 void	tems_cursor(struct vis_conscursor *);
56 
57 int	tem_initialized(tem_vt_state_t);
58 
59 tem_vt_state_t tem_init(void);
60 
61 int	tem_info_init(struct console *);
62 void	tem_write(tem_vt_state_t, uint8_t *, ssize_t);
63 void	tem_get_size(uint16_t *, uint16_t *, uint16_t *, uint16_t *);
64 void	tem_save_state(void);
65 void	tem_register_modechg_cb(tem_modechg_cb_t, tem_modechg_cb_arg_t);
66 void	tem_activate(tem_vt_state_t, boolean_t);
67 void	tem_switch(tem_vt_state_t, tem_vt_state_t);
68 void	tem_get_colors(tem_vt_state_t, text_color_t *, text_color_t *);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _SYS_TEM_H */
75