1/*
2 * Copyright (c) 1988 University of Utah.
3 * Copyright (c) 1991 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department.
--- 21 unchanged lines hidden (view full) ---
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/tty_cons.c 130640 2004-06-17 17:16:53Z phk $");
39
40#include "opt_ddb.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/conf.h>
45#include <sys/cons.h>
46#include <sys/fcntl.h>
--- 51 unchanged lines hidden (view full) ---
98static struct cn_device cn_devtab[CNDEVTAB_SIZE];
99static STAILQ_HEAD(, cn_device) cn_devlist =
100 STAILQ_HEAD_INITIALIZER(cn_devlist);
101
102#define CND_INVALID(cnd, td) \
103 (cnd == NULL || cnd->cnd_vp == NULL || \
104 (cnd->cnd_vp->v_type == VBAD && !cn_devopen(cnd, td, 1)))
105
106static dev_t cn_udev_t;
107SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
108 &cn_udev_t, sizeof cn_udev_t, "T,struct cdev *", "");
109
110int cons_avail_mask = 0; /* Bit mask. Each registered low level console
111 * which is currently unavailable for inpit
112 * (i.e., if it is in graphics mode) will have
113 * this bit cleared.
114 */
--- 251 unchanged lines hidden (view full) ---
366 int error;
367 int ocn_mute;
368
369 ocn_mute = cn_mute;
370 error = sysctl_handle_int(oidp, &cn_mute, 0, req);
371 if (error != 0 || req->newptr == NULL)
372 return (error);
373 if (ocn_mute && !cn_mute && cn_is_open)
374 error = cnopen(NULL, openflag, 0, curthread);
375 else if (!ocn_mute && cn_mute && cn_is_open) {
376 error = cnclose(NULL, openflag, 0, curthread);
377 cn_is_open = 1; /* XXX hack */
378 }
379 return (error);
380}
381
382SYSCTL_PROC(_kern, OID_AUTO, consmute, CTLTYPE_INT|CTLFLAG_RW,
383 0, sizeof(cn_mute), sysctl_kern_consmute, "I", "");
384
--- 322 unchanged lines hidden ---
2 * Copyright (c) 1988 University of Utah.
3 * Copyright (c) 1991 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department.
--- 21 unchanged lines hidden (view full) ---
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/tty_cons.c 130640 2004-06-17 17:16:53Z phk $");
39
40#include "opt_ddb.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/conf.h>
45#include <sys/cons.h>
46#include <sys/fcntl.h>
--- 51 unchanged lines hidden (view full) ---
98static struct cn_device cn_devtab[CNDEVTAB_SIZE];
99static STAILQ_HEAD(, cn_device) cn_devlist =
100 STAILQ_HEAD_INITIALIZER(cn_devlist);
101
102#define CND_INVALID(cnd, td) \
103 (cnd == NULL || cnd->cnd_vp == NULL || \
104 (cnd->cnd_vp->v_type == VBAD && !cn_devopen(cnd, td, 1)))
105
106static dev_t cn_udev_t;
107SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
108 &cn_udev_t, sizeof cn_udev_t, "T,struct cdev *", "");
109
110int cons_avail_mask = 0; /* Bit mask. Each registered low level console
111 * which is currently unavailable for inpit
112 * (i.e., if it is in graphics mode) will have
113 * this bit cleared.
114 */
--- 251 unchanged lines hidden (view full) ---
366 int error;
367 int ocn_mute;
368
369 ocn_mute = cn_mute;
370 error = sysctl_handle_int(oidp, &cn_mute, 0, req);
371 if (error != 0 || req->newptr == NULL)
372 return (error);
373 if (ocn_mute && !cn_mute && cn_is_open)
374 error = cnopen(NULL, openflag, 0, curthread);
375 else if (!ocn_mute && cn_mute && cn_is_open) {
376 error = cnclose(NULL, openflag, 0, curthread);
377 cn_is_open = 1; /* XXX hack */
378 }
379 return (error);
380}
381
382SYSCTL_PROC(_kern, OID_AUTO, consmute, CTLTYPE_INT|CTLFLAG_RW,
383 0, sizeof(cn_mute), sysctl_kern_consmute, "I", "");
384
--- 322 unchanged lines hidden ---