Move sysctl machdep.consdev to cons.c

This commit is contained in:
Poul-Henning Kamp 1995-12-09 20:39:47 +00:00
parent ba43d44d3a
commit 162a9e8732
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12701
6 changed files with 22 additions and 48 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.154 1995/12/04 16:47:40 phk Exp $
* $Id: machdep.c,v 1.155 1995/12/07 12:45:32 davidg Exp $
*/
#include "npx.h"
@ -1070,17 +1070,6 @@ sysctl_machdep_adjkerntz SYSCTL_HANDLER_ARGS
SYSCTL_PROC(_machdep, CPU_ADJKERNTZ, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
static int
sysctl_machdep_consdev SYSCTL_HANDLER_ARGS
{
dev_t consdev;
consdev = (cn_tty == NULL ? NODEV : cn_tty->t_dev);
return (sysctl_handle_opaque(oidp, &consdev, sizeof consdev, req));
}
SYSCTL_PROC(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
0, 0, sysctl_machdep_consdev, "T,dev_t", "");
SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set,
CTLFLAG_RW, &disable_rtc_set, 0, "");

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
* $Id: cons.c,v 1.37 1995/12/08 11:13:21 julian Exp $
* $Id: cons.c,v 1.38 1995/12/08 23:20:00 phk Exp $
*/
#include <sys/param.h>
@ -46,9 +46,11 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/tty.h>
#include <machine/cpu.h>
#include <machine/cons.h>
#include <machine/stdarg.h>
@ -83,7 +85,11 @@ static struct cdevsw cn_cdevsw =
cnselect, nommap, NULL, "console", NULL, -1 };
struct tty *constty = 0; /* virtual console output device */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
static dev_t cn_dev_t;
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
int cons_unavail = 0; /* XXX:
* physical console not available for
* input (i.e., it is in graphics mode)
@ -150,14 +156,7 @@ cninit_finish()
cn_phys_open = cdp->d_open;
cdp->d_open = cnopen;
cn_tp = (*cdp->d_devtotty)(cn_tab->cn_dev);
/*
* XXX there are too many tty pointers. cn_tty is only used for
* sysctl(CPU_CONSDEV) (not for tprintf like the above comment
* says). cn_tp in struct consdev hasn't been initialized
* (except statically to NULL) or used (except to initialize
* cn_tty to the wrong value) for a year or two.
*/
cn_tty = cn_tp;
cn_dev_t = cn_tp->t_dev;
}
static int

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
* $Id: cons.h,v 1.11 1995/09/10 21:34:50 bde Exp $
* $Id: cons.h,v 1.12 1995/12/08 11:13:23 julian Exp $
*/
#ifndef _MACHINE_CONS_H_
@ -101,7 +101,6 @@ struct consdev {
#ifdef KERNEL
extern struct consdev constab[];
extern struct consdev *cn_tab;
extern struct tty *cn_tty;
extern int cons_unavail;
struct proc; struct uio;

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.154 1995/12/04 16:47:40 phk Exp $
* $Id: machdep.c,v 1.155 1995/12/07 12:45:32 davidg Exp $
*/
#include "npx.h"
@ -1070,17 +1070,6 @@ sysctl_machdep_adjkerntz SYSCTL_HANDLER_ARGS
SYSCTL_PROC(_machdep, CPU_ADJKERNTZ, adjkerntz, CTLTYPE_INT|CTLFLAG_RW,
&adjkerntz, 0, sysctl_machdep_adjkerntz, "I", "");
static int
sysctl_machdep_consdev SYSCTL_HANDLER_ARGS
{
dev_t consdev;
consdev = (cn_tty == NULL ? NODEV : cn_tty->t_dev);
return (sysctl_handle_opaque(oidp, &consdev, sizeof consdev, req));
}
SYSCTL_PROC(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
0, 0, sysctl_machdep_consdev, "T,dev_t", "");
SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set,
CTLFLAG_RW, &disable_rtc_set, 0, "");

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
* $Id: cons.c,v 1.37 1995/12/08 11:13:21 julian Exp $
* $Id: cons.c,v 1.38 1995/12/08 23:20:00 phk Exp $
*/
#include <sys/param.h>
@ -46,9 +46,11 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/tty.h>
#include <machine/cpu.h>
#include <machine/cons.h>
#include <machine/stdarg.h>
@ -83,7 +85,11 @@ static struct cdevsw cn_cdevsw =
cnselect, nommap, NULL, "console", NULL, -1 };
struct tty *constty = 0; /* virtual console output device */
struct tty *cn_tty; /* XXX: console tty struct for tprintf */
static dev_t cn_dev_t;
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
&cn_dev_t, sizeof cn_dev_t, "T,dev_t", "");
int cons_unavail = 0; /* XXX:
* physical console not available for
* input (i.e., it is in graphics mode)
@ -150,14 +156,7 @@ cninit_finish()
cn_phys_open = cdp->d_open;
cdp->d_open = cnopen;
cn_tp = (*cdp->d_devtotty)(cn_tab->cn_dev);
/*
* XXX there are too many tty pointers. cn_tty is only used for
* sysctl(CPU_CONSDEV) (not for tprintf like the above comment
* says). cn_tp in struct consdev hasn't been initialized
* (except statically to NULL) or used (except to initialize
* cn_tty to the wrong value) for a year or two.
*/
cn_tty = cn_tp;
cn_dev_t = cn_tp->t_dev;
}
static int

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.2 (Berkeley) 5/9/91
* $Id: cons.h,v 1.11 1995/09/10 21:34:50 bde Exp $
* $Id: cons.h,v 1.12 1995/12/08 11:13:23 julian Exp $
*/
#ifndef _MACHINE_CONS_H_
@ -101,7 +101,6 @@ struct consdev {
#ifdef KERNEL
extern struct consdev constab[];
extern struct consdev *cn_tab;
extern struct tty *cn_tty;
extern int cons_unavail;
struct proc; struct uio;