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