summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-01-13 20:20:30 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-01-13 20:20:30 +0000
commitdbe2b9af311c7e4f0eab402a7cc948a3d2206c91 (patch)
tree56f10666e506451e007723746efa7ff073440bd7 /sys/arch
parent03bf653387a8bf3c826b11ba4985b2e3a1df669d (diff)
Add a machdep.cputype sysctl, which returns the processor type (0 for 88100,
1 for 88110), for userland to have an easy way to figure out.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/aviion/aviion/machdep.c4
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c4
-rw-r--r--sys/arch/m88k/include/cpu.h6
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c4
4 files changed, 13 insertions, 5 deletions
diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c
index 7616fa13df4..ef2caa2556e 100644
--- a/sys/arch/aviion/aviion/machdep.c
+++ b/sys/arch/aviion/aviion/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.21 2007/12/31 09:23:53 martin Exp $ */
+/* $OpenBSD: machdep.c,v 1.22 2008/01/13 20:20:27 miod Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
*
@@ -716,6 +716,8 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
consdev = NODEV;
return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
sizeof consdev));
+ case CPU_CPUTYPE:
+ return (sysctl_rdint(oldp, oldlenp, newp, cputyp));
default:
return (EOPNOTSUPP);
}
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index e2239984816..27e47324e77 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.54 2007/12/31 09:23:53 martin Exp $ */
+/* $OpenBSD: machdep.c,v 1.55 2008/01/13 20:20:29 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -964,6 +964,8 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
consdev = NODEV;
return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
sizeof consdev));
+ case CPU_CPUTYPE:
+ return (sysctl_rdint(oldp, oldlenp, newp, cputyp));
default:
return (EOPNOTSUPP);
}
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h
index 29e266e5b22..aa3acd6438b 100644
--- a/sys/arch/m88k/include/cpu.h
+++ b/sys/arch/m88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.33 2007/12/15 19:34:33 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.34 2008/01/13 20:20:29 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -45,11 +45,13 @@
* CTL_MACHDEP definitions.
*/
#define CPU_CONSDEV 1 /* dev_t: console terminal device */
-#define CPU_MAXID 2 /* number of valid machdep ids */
+#define CPU_CPUTYPE 2 /* int: cpu type */
+#define CPU_MAXID 3 /* number of valid machdep ids */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "console_device", CTLTYPE_STRUCT }, \
+ { "cputype", CTLTYPE_INT }, \
}
#ifdef _KERNEL
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index a0f475a6219..9ea695747f5 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.208 2008/01/13 20:18:56 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.209 2008/01/13 20:20:29 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -876,6 +876,8 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
consdev = NODEV;
return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
sizeof consdev));
+ case CPU_CPUTYPE:
+ return (sysctl_rdint(oldp, oldlenp, newp, cputyp));
default:
return (EOPNOTSUPP);
}