xref: /titanic_51/usr/src/uts/common/sys/vt.h (revision ceeba6f9f0adf370c2a0f5c81a0d6ef1ba146cb4)
1aecfc01dSrui zang - Sun Microsystems - Beijing China /*
2aecfc01dSrui zang - Sun Microsystems - Beijing China  * CDDL HEADER START
3aecfc01dSrui zang - Sun Microsystems - Beijing China  *
4aecfc01dSrui zang - Sun Microsystems - Beijing China  * The contents of this file are subject to the terms of the
5aecfc01dSrui zang - Sun Microsystems - Beijing China  * Common Development and Distribution License (the "License").
6aecfc01dSrui zang - Sun Microsystems - Beijing China  * You may not use this file except in compliance with the License.
7aecfc01dSrui zang - Sun Microsystems - Beijing China  *
8aecfc01dSrui zang - Sun Microsystems - Beijing China  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9aecfc01dSrui zang - Sun Microsystems - Beijing China  * or http://www.opensolaris.org/os/licensing.
10aecfc01dSrui zang - Sun Microsystems - Beijing China  * See the License for the specific language governing permissions
11aecfc01dSrui zang - Sun Microsystems - Beijing China  * and limitations under the License.
12aecfc01dSrui zang - Sun Microsystems - Beijing China  *
13aecfc01dSrui zang - Sun Microsystems - Beijing China  * When distributing Covered Code, include this CDDL HEADER in each
14aecfc01dSrui zang - Sun Microsystems - Beijing China  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15aecfc01dSrui zang - Sun Microsystems - Beijing China  * If applicable, add the following below this CDDL HEADER, with the
16aecfc01dSrui zang - Sun Microsystems - Beijing China  * fields enclosed by brackets "[]" replaced with your own identifying
17aecfc01dSrui zang - Sun Microsystems - Beijing China  * information: Portions Copyright [yyyy] [name of copyright owner]
18aecfc01dSrui zang - Sun Microsystems - Beijing China  *
19aecfc01dSrui zang - Sun Microsystems - Beijing China  * CDDL HEADER END
20aecfc01dSrui zang - Sun Microsystems - Beijing China  */
21aecfc01dSrui zang - Sun Microsystems - Beijing China 
22aecfc01dSrui zang - Sun Microsystems - Beijing China /*
23*ceeba6f9Srui zang - Sun Microsystems - Beijing China  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24aecfc01dSrui zang - Sun Microsystems - Beijing China  */
25aecfc01dSrui zang - Sun Microsystems - Beijing China 
26aecfc01dSrui zang - Sun Microsystems - Beijing China #ifndef _SYS_VT_H
27aecfc01dSrui zang - Sun Microsystems - Beijing China #define	_SYS_VT_H
28aecfc01dSrui zang - Sun Microsystems - Beijing China 
29aecfc01dSrui zang - Sun Microsystems - Beijing China #ifdef __cplusplus
30aecfc01dSrui zang - Sun Microsystems - Beijing China extern "C" {
31aecfc01dSrui zang - Sun Microsystems - Beijing China #endif
32aecfc01dSrui zang - Sun Microsystems - Beijing China 
33aecfc01dSrui zang - Sun Microsystems - Beijing China #include <sys/types.h>
34aecfc01dSrui zang - Sun Microsystems - Beijing China 
35aecfc01dSrui zang - Sun Microsystems - Beijing China /*
36aecfc01dSrui zang - Sun Microsystems - Beijing China  * Public IOCTLs supported by the VT, which are shared with
37aecfc01dSrui zang - Sun Microsystems - Beijing China  * other operating systems.
38aecfc01dSrui zang - Sun Microsystems - Beijing China  */
39aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VTIOC		('V'<<8)
40aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_OPENQRY	(VTIOC|1)	/* inquires if this vt already open */
41aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_SETMODE	(VTIOC|2)	/* set vt into auto or process mode */
42aecfc01dSrui zang - Sun Microsystems - Beijing China 
43aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_GETMODE	(VTIOC|3)	/* returns mode vt is currently in */
44aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_RELDISP	(VTIOC|4)	/* tells vt when display released */
45aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_ACTIVATE	(VTIOC|5)	/* activates specified vt */
46aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_WAITACTIVE	(VTIOC|6)	/* wait for vt to be activated */
47aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_GETSTATE	(VTIOC|100)	/* returns active and open vts */
48aecfc01dSrui zang - Sun Microsystems - Beijing China 
49aecfc01dSrui zang - Sun Microsystems - Beijing China /*
50aecfc01dSrui zang - Sun Microsystems - Beijing China  * Solaris specific public IOCTL.
51aecfc01dSrui zang - Sun Microsystems - Beijing China  * Inquires if the vt functionality is available.
52aecfc01dSrui zang - Sun Microsystems - Beijing China  */
53aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_ENABLED	(VTIOC|101)
54aecfc01dSrui zang - Sun Microsystems - Beijing China 
55*ceeba6f9Srui zang - Sun Microsystems - Beijing China /* get/set the target of /dev/vt/console_user symbol link */
56*ceeba6f9Srui zang - Sun Microsystems - Beijing China #define	VT_GET_CONSUSER	(VTIOC|108)
57*ceeba6f9Srui zang - Sun Microsystems - Beijing China #define	VT_SET_CONSUSER	(VTIOC|109)
58*ceeba6f9Srui zang - Sun Microsystems - Beijing China 
59aecfc01dSrui zang - Sun Microsystems - Beijing China struct vt_mode {
60aecfc01dSrui zang - Sun Microsystems - Beijing China 	char	mode;	/* mode to set vt into, VT_AUTO or VT_PROCESS */
61aecfc01dSrui zang - Sun Microsystems - Beijing China 	char	waitv;	/* if != 0, vt hangs on writes when not active */
62aecfc01dSrui zang - Sun Microsystems - Beijing China 	short	relsig;	/* signal to use for release request */
63aecfc01dSrui zang - Sun Microsystems - Beijing China 	short	acqsig;	/* signal to use for display acquired */
64aecfc01dSrui zang - Sun Microsystems - Beijing China 	short	frsig;	/* signal to use for forced release */
65aecfc01dSrui zang - Sun Microsystems - Beijing China };
66aecfc01dSrui zang - Sun Microsystems - Beijing China 
67aecfc01dSrui zang - Sun Microsystems - Beijing China /* vt switching mode */
68aecfc01dSrui zang - Sun Microsystems - Beijing China enum {
69aecfc01dSrui zang - Sun Microsystems - Beijing China 	VT_AUTO	= 0,	/* this vt switching is automatic */
70aecfc01dSrui zang - Sun Microsystems - Beijing China 	VT_PROCESS	/* this vt switching controlled by process */
71aecfc01dSrui zang - Sun Microsystems - Beijing China };
72aecfc01dSrui zang - Sun Microsystems - Beijing China 
73aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_ACKACQ	2	/* ack from v86 acquire routine */
74aecfc01dSrui zang - Sun Microsystems - Beijing China 
75aecfc01dSrui zang - Sun Microsystems - Beijing China /*
76aecfc01dSrui zang - Sun Microsystems - Beijing China  * structure used by VT_GETSTATE ioctl
77aecfc01dSrui zang - Sun Microsystems - Beijing China  */
78aecfc01dSrui zang - Sun Microsystems - Beijing China 
79aecfc01dSrui zang - Sun Microsystems - Beijing China struct vt_stat {
80aecfc01dSrui zang - Sun Microsystems - Beijing China 	unsigned short	v_active;
81aecfc01dSrui zang - Sun Microsystems - Beijing China 	unsigned short	v_signal;
82aecfc01dSrui zang - Sun Microsystems - Beijing China 	unsigned short	v_state;
83aecfc01dSrui zang - Sun Microsystems - Beijing China };
84aecfc01dSrui zang - Sun Microsystems - Beijing China 
85aecfc01dSrui zang - Sun Microsystems - Beijing China /* project private IOCTLs */
86aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_CONFIG	(VTIOC|102)	/* config virtual console number */
87aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_SETDISPINFO	(VTIOC|103)	/* set display number */
88aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_SETDISPLOGIN	(VTIOC|104)	/* set display login */
89aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_GETDISPINFO	(VTIOC|105)	/* get display info */
90aecfc01dSrui zang - Sun Microsystems - Beijing China 
91aecfc01dSrui zang - Sun Microsystems - Beijing China /*
92aecfc01dSrui zang - Sun Microsystems - Beijing China  * setting target console is only used by vtdaemon
93aecfc01dSrui zang - Sun Microsystems - Beijing China  * to set target console while vtdaemon is authenticating
94aecfc01dSrui zang - Sun Microsystems - Beijing China  * for it, which is returned in VT_GETSTATE. At that
95aecfc01dSrui zang - Sun Microsystems - Beijing China  * time, the real active console is the vtdaemon special console,
96aecfc01dSrui zang - Sun Microsystems - Beijing China  * but VT_GETSTATE should not be aware of it. Instead, VT_GETACTIVE
97aecfc01dSrui zang - Sun Microsystems - Beijing China  * is used to get the real active console for vtdaemon.
98aecfc01dSrui zang - Sun Microsystems - Beijing China  */
99aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_SET_TARGET	(VTIOC|106)
100aecfc01dSrui zang - Sun Microsystems - Beijing China #define	VT_GETACTIVE	(VTIOC|107)
101aecfc01dSrui zang - Sun Microsystems - Beijing China 
102aecfc01dSrui zang - Sun Microsystems - Beijing China /*
103*ceeba6f9Srui zang - Sun Microsystems - Beijing China  * Used by cn to convert a VT_SET_CONSUSER to a internal interface
104*ceeba6f9Srui zang - Sun Microsystems - Beijing China  * so that /dev/console and /dev/vt/0 could be differentiated.
105*ceeba6f9Srui zang - Sun Microsystems - Beijing China  */
106*ceeba6f9Srui zang - Sun Microsystems - Beijing China #define	VT_RESET_CONSUSER	(VTIOC|110)
107*ceeba6f9Srui zang - Sun Microsystems - Beijing China 
108*ceeba6f9Srui zang - Sun Microsystems - Beijing China /*
109aecfc01dSrui zang - Sun Microsystems - Beijing China  * structure used by VT_GETDISPINFO
110aecfc01dSrui zang - Sun Microsystems - Beijing China  */
111aecfc01dSrui zang - Sun Microsystems - Beijing China struct vt_dispinfo {
112aecfc01dSrui zang - Sun Microsystems - Beijing China 	pid_t	v_pid;		/* -1 if no display info (auto mode) */
113aecfc01dSrui zang - Sun Microsystems - Beijing China 	int	v_dispnum;	/* display number associated with vt */
114aecfc01dSrui zang - Sun Microsystems - Beijing China 	int	v_login;	/* if the user logged in the display */
115aecfc01dSrui zang - Sun Microsystems - Beijing China };
116aecfc01dSrui zang - Sun Microsystems - Beijing China 
117aecfc01dSrui zang - Sun Microsystems - Beijing China #ifdef __cplusplus
118aecfc01dSrui zang - Sun Microsystems - Beijing China }
119aecfc01dSrui zang - Sun Microsystems - Beijing China #endif
120aecfc01dSrui zang - Sun Microsystems - Beijing China 
121aecfc01dSrui zang - Sun Microsystems - Beijing China #endif /* _SYS_VT_H */
122