vt_impl.h revision aecfc01d1bad84e66649703f7fc2926ef70b34ba
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_VT_IMPL_H
#define _SYS_VT_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct vc_waitactive_msg {
int wa_msg_minor; /* minor number from which msg comes */
int wa_wait_minor; /* which node we are waiting for */
/* virtual console soft state associated with each vt */
typedef struct vc_state {
char vc_waitv;
int vc_relsig;
int vc_acqsig;
int vc_flags;
int vc_dispnum;
int vc_login;
#ifdef _HAVE_TEM_FIRMWARE
int vc_pendc; /* pending output character */
#endif /* _HAVE_TEM_FIRMWARE */
/*
* vc_state_lock is currently only used to protect vc_flags,
* more precisely, the state change of vc_state_t.
* The existence of this lock is because wc_modechg_cb().
* wc_modechg_cb() is a callback function which may result in
* multiple threads accessing vc_flags regardless the STREAMS
* periemters of wc module.
* Since wc_modechg_cb() only conducts read access to vc_flags,
* we only need to hold this lock when writing to vc_flags in
* wc module (except wc_modechg_cb()).
* See locking policy in wscons.c for more info.
*/
} vc_state_t;
#define VC_DEFAULT_COUNT 16
/* Invalid VT minor number */
/* Argument to vt_minor2vc to get the softstate of the active VT */
#define VT_ACTIVE VT_MINOR_INVALID
/*
* VC_INSTANCES_COUNT should be regarded as reading access to vc_avl_root
*/
extern dev_info_t *wc_dip;
extern avl_tree_t vc_avl_root;
extern minor_t vc_active_console;
extern minor_t vc_last_console;
major_t vt_wc_attached(void);
void vt_getactive(char *, int);
void vt_attach(void);
void vt_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VT_IMPL_H */