45 #include <sys/wscons.h>
46 #include <sys/vt_impl.h>
47 #include <sys/note.h>
48 #include <sys/avl.h>
49
50 /* set if console driver is attached */
51 dev_info_t *wc_dip = NULL;
52 /* active virtual console minor number */
53 minor_t vc_active_console = VT_MINOR_INVALID;
54 /*
55 * console_user symbol link minor number.
56 * VT_MINOR_INVALID : /dev/console
57 * N : /dev/vt/N
58 */
59 minor_t vc_cons_user = VT_MINOR_INVALID;
60 /* vc_state_t AVL tree */
61 avl_tree_t vc_avl_root;
62 /* virtual console global lock */
63 kmutex_t vc_lock;
64
65 _NOTE(MUTEX_PROTECTS_DATA(vc_lock, wc_dip vc_avl_root vc_active_console
66 vc_cons_user))
67
68 /*
69 * Called from vt devname part. Checks if dip is attached. If it is,
70 * return its major number.
71 */
72 major_t
73 vt_wc_attached(void)
74 {
75 major_t maj = (major_t)-1;
76
77 mutex_enter(&vc_lock);
78
79 if (wc_dip)
80 maj = ddi_driver_major(wc_dip);
81
82 mutex_exit(&vc_lock);
83
84 return (maj);
85 }
86
87 void
|
45 #include <sys/wscons.h>
46 #include <sys/vt_impl.h>
47 #include <sys/note.h>
48 #include <sys/avl.h>
49
50 /* set if console driver is attached */
51 dev_info_t *wc_dip = NULL;
52 /* active virtual console minor number */
53 minor_t vc_active_console = VT_MINOR_INVALID;
54 /*
55 * console_user symbol link minor number.
56 * VT_MINOR_INVALID : /dev/console
57 * N : /dev/vt/N
58 */
59 minor_t vc_cons_user = VT_MINOR_INVALID;
60 /* vc_state_t AVL tree */
61 avl_tree_t vc_avl_root;
62 /* virtual console global lock */
63 kmutex_t vc_lock;
64
65 /*
66 * Called from vt devname part. Checks if dip is attached. If it is,
67 * return its major number.
68 */
69 major_t
70 vt_wc_attached(void)
71 {
72 major_t maj = (major_t)-1;
73
74 mutex_enter(&vc_lock);
75
76 if (wc_dip)
77 maj = ddi_driver_major(wc_dip);
78
79 mutex_exit(&vc_lock);
80
81 return (maj);
82 }
83
84 void
|