xref: /titanic_41/usr/src/uts/common/sys/vt.h (revision 989f28072d20c73ae0955d6a1e3e2fc74831cb39)
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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef _SYS_VT_H
27 #define	_SYS_VT_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 
35 /*
36  * Public IOCTLs supported by the VT, which are shared with
37  * other operating systems.
38  */
39 #define	VTIOC		('V'<<8)
40 #define	VT_OPENQRY	(VTIOC|1)	/* inquires if this vt already open */
41 #define	VT_SETMODE	(VTIOC|2)	/* set vt into auto or process mode */
42 
43 #define	VT_GETMODE	(VTIOC|3)	/* returns mode vt is currently in */
44 #define	VT_RELDISP	(VTIOC|4)	/* tells vt when display released */
45 #define	VT_ACTIVATE	(VTIOC|5)	/* activates specified vt */
46 #define	VT_WAITACTIVE	(VTIOC|6)	/* wait for vt to be activated */
47 #define	VT_GETSTATE	(VTIOC|100)	/* returns active and open vts */
48 
49 /*
50  * Solaris specific public IOCTL.
51  * Inquires if the vt functionality is available.
52  */
53 #define	VT_ENABLED	(VTIOC|101)
54 
55 /* get/set the target of /dev/vt/console_user symbol link */
56 #define	VT_GET_CONSUSER	(VTIOC|108)
57 #define	VT_SET_CONSUSER	(VTIOC|109)
58 
59 struct vt_mode {
60 	char	mode;	/* mode to set vt into, VT_AUTO or VT_PROCESS */
61 	char	waitv;	/* if != 0, vt hangs on writes when not active */
62 	short	relsig;	/* signal to use for release request */
63 	short	acqsig;	/* signal to use for display acquired */
64 	short	frsig;	/* signal to use for forced release */
65 };
66 
67 /* vt switching mode */
68 enum {
69 	VT_AUTO	= 0,	/* this vt switching is automatic */
70 	VT_PROCESS	/* this vt switching controlled by process */
71 };
72 
73 #define	VT_ACKACQ	2	/* ack from v86 acquire routine */
74 
75 /*
76  * structure used by VT_GETSTATE ioctl
77  */
78 
79 struct vt_stat {
80 	unsigned short	v_active;
81 	unsigned short	v_signal;
82 	unsigned short	v_state;
83 };
84 
85 /* project private IOCTLs */
86 #define	VT_CONFIG	(VTIOC|102)	/* config virtual console number */
87 #define	VT_SETDISPINFO	(VTIOC|103)	/* set display number */
88 #define	VT_SETDISPLOGIN	(VTIOC|104)	/* set display login */
89 #define	VT_GETDISPINFO	(VTIOC|105)	/* get display info */
90 
91 /*
92  * setting target console is only used by vtdaemon
93  * to set target console while vtdaemon is authenticating
94  * for it, which is returned in VT_GETSTATE. At that
95  * time, the real active console is the vtdaemon special console,
96  * but VT_GETSTATE should not be aware of it. Instead, VT_GETACTIVE
97  * is used to get the real active console for vtdaemon.
98  */
99 #define	VT_SET_TARGET	(VTIOC|106)
100 #define	VT_GETACTIVE	(VTIOC|107)
101 
102 /*
103  * Used by cn to convert a VT_SET_CONSUSER to a internal interface
104  * so that /dev/console and /dev/vt/0 could be differentiated.
105  */
106 #define	VT_RESET_CONSUSER	(VTIOC|110)
107 
108 /*
109  * structure used by VT_GETDISPINFO
110  */
111 struct vt_dispinfo {
112 	pid_t	v_pid;		/* -1 if no display info (auto mode) */
113 	int	v_dispnum;	/* display number associated with vt */
114 	int	v_login;	/* if the user logged in the display */
115 };
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* _SYS_VT_H */
122