xref: /titanic_51/usr/src/uts/common/sys/zcons.h (revision 9d5056ea37dd689d393cb1715ae29551bc0eba2e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*9d5056eaSjv227347  * Common Development and Distribution License (the "License").
6*9d5056eaSjv227347  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*9d5056eaSjv227347  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _SYS_ZCONS_H
277c478bd9Sstevel@tonic-gate #define	_SYS_ZCONS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/types.h>
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * Minor node name of the global zone side (often called the "master" side)
377c478bd9Sstevel@tonic-gate  * of the zcons driver.
387c478bd9Sstevel@tonic-gate  */
397c478bd9Sstevel@tonic-gate #define	ZCONS_MASTER_NAME	"masterconsole"
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * Minor node name of the non-global zone side (often called the "slave"
437c478bd9Sstevel@tonic-gate  * side) of the zcons driver.  We name it "zoneconsole" since that nameo
447c478bd9Sstevel@tonic-gate  * will show up in 'ps' output, and will make some sense to the global zone
457c478bd9Sstevel@tonic-gate  * user.  Inside the zone, it will simply show up as "console" due to the
467c478bd9Sstevel@tonic-gate  * links we create.
477c478bd9Sstevel@tonic-gate  */
487c478bd9Sstevel@tonic-gate #define	ZCONS_SLAVE_NAME	"zoneconsole"
497c478bd9Sstevel@tonic-gate 
50*9d5056eaSjv227347 /*
51*9d5056eaSjv227347  * ZC_IOC forms the base for all zcons ioctls.
52*9d5056eaSjv227347  */
53*9d5056eaSjv227347 #define	ZC_IOC		(('Z' << 24) | ('o' << 16) | ('n' << 8))
54*9d5056eaSjv227347 
55*9d5056eaSjv227347 /*
56*9d5056eaSjv227347  * These ioctls instruct the master side of the console to hold or release
57*9d5056eaSjv227347  * a reference to the slave side's vnode.  They are meant to be issued by
58*9d5056eaSjv227347  * zoneadmd after the console device node is created and before it is destroyed
59*9d5056eaSjv227347  * so that the slave's STREAMS anchor, ptem, is preserved when ttymon starts
60*9d5056eaSjv227347  * popping STREAMS modules from within the associated zone.  This guarantees
61*9d5056eaSjv227347  * that the zone slave console will always have terminal semantics while the
62*9d5056eaSjv227347  * zone is running.
63*9d5056eaSjv227347  *
64*9d5056eaSjv227347  * A more detailed description can be found in uts/common/io/zcons.c.
65*9d5056eaSjv227347  */
66*9d5056eaSjv227347 #define	ZC_HOLDSLAVE	(ZC_IOC | 0)	/* get and save slave side reference */
67*9d5056eaSjv227347 #define	ZC_RELEASESLAVE	(ZC_IOC | 1)	/* release slave side reference */
68*9d5056eaSjv227347 
697c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
707c478bd9Sstevel@tonic-gate }
717c478bd9Sstevel@tonic-gate #endif
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #endif	/* _SYS_ZCONS_H */
74