summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMartin Reindl <martin@cvs.openbsd.org>2006-01-04 15:41:30 +0000
committerMartin Reindl <martin@cvs.openbsd.org>2006-01-04 15:41:30 +0000
commit70fb1a7c30e59538f42539695dc536e30b1a5651 (patch)
treed004b891fd3bac1e56ef7756619216ad3c2512be /sys/arch
parent410176bee9f338cc497eed73ce1988a54e565093 (diff)
add sysctl machdep.console_device support
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/vax/include/cpu.h14
-rw-r--r--sys/arch/vax/vax/machdep.c35
2 files changed, 40 insertions, 9 deletions
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h
index f0d7fdec67a..8e2cee19909 100644
--- a/sys/arch/vax/include/cpu.h
+++ b/sys/arch/vax/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.18 2006/01/02 18:09:25 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.19 2006/01/04 15:41:29 martin Exp $ */
/* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */
/*
@@ -135,4 +135,16 @@ void findcpu(void);
int kdbrint(int);
#endif
#endif /* _KERNEL */
+
+/*
+ * CTL_MACHDEP definitions.
+ */
+#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_MAXID 2 /* number of valid machdep ids */
+
+#define CTL_MACHDEP_NAMES { \
+ { 0, 0 }, \
+ { "console_device", CTLTYPE_STRUCT }, \
+}
+
#endif /* _VAX_CPU_H_ */
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index 3c53c95c0db..8e996fe4731 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.75 2006/01/02 18:15:55 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.76 2006/01/04 15:41:29 martin Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -320,14 +320,33 @@ cpu_dumpconf()
}
int
-cpu_sysctl(a, b, c, d, e, f, g)
- int *a;
- u_int b;
- void *c, *e;
- size_t *d, f;
- struct proc *g;
+cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
+ int *name;
+ u_int namelen;
+ void *oldp;
+ size_t *oldlenp;
+ void *newp;
+ size_t newlen;
+ struct proc *p;
{
- return (EOPNOTSUPP);
+ dev_t consdev;
+
+ /* all sysctl names at this level are terminal */
+ if (namelen != 1)
+ return (ENOTDIR); /* overloaded */
+
+ switch (name[0]) {
+ case CPU_CONSDEV:
+ if (cn_tab != NULL)
+ consdev = cn_tab->cn_dev;
+ else
+ consdev = NODEV;
+ return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
+ sizeof consdev));
+ default:
+ return (EOPNOTSUPP);
+ }
+ /* NOTREACHED */
}
void