summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-05-25 22:07:19 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-05-25 22:07:19 +0000
commit1d8271666d0bc69b7c8c1cfb481e5ed5e752b974 (patch)
treec3d7e371de8ed949a4fdf2a18324bdf3c89fb953
parent2aa523fe3d7c46ff8614fed0e0860a2511fa5973 (diff)
Add 3 sysctl machdep variables: cpuspeed, machineid, and mmuid.
-rw-r--r--sys/arch/hp300/hp300/machdep.c10
-rw-r--r--sys/arch/hp300/include/cpu.h10
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index 80b1fb83a81..4e63da343fe 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.48 2001/05/23 15:12:06 millert Exp $ */
+/* $OpenBSD: machdep.c,v 1.49 2001/05/25 22:07:18 millert Exp $ */
/* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */
/*
@@ -789,7 +789,7 @@ identifycpu()
#if !defined(HP433)
case HP_433:
#endif
- panic("SPU type not configured");
+ panic("SPU type not configured for machineid %d", machineid);
default:
break;
}
@@ -826,6 +826,12 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
consdev = NODEV;
return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev,
sizeof consdev));
+ case CPU_CPUSPEED:
+ return (sysctl_rdint(oldp, oldlenp, newp, cpuspeed));
+ case CPU_MACHINEID:
+ return (sysctl_rdint(oldp, oldlenp, newp, machineid));
+ case CPU_MMUID:
+ return (sysctl_rdint(oldp, oldlenp, newp, mmuid));
default:
return (EOPNOTSUPP);
}
diff --git a/sys/arch/hp300/include/cpu.h b/sys/arch/hp300/include/cpu.h
index b3193f5bc80..49dbd4f47aa 100644
--- a/sys/arch/hp300/include/cpu.h
+++ b/sys/arch/hp300/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.11 2001/05/11 23:24:57 millert Exp $ */
+/* $OpenBSD: cpu.h,v 1.12 2001/05/25 22:07:17 millert Exp $ */
/* $NetBSD: cpu.h,v 1.28 1998/02/13 07:41:51 scottr Exp $ */
/*
@@ -118,11 +118,17 @@ extern int astpending; /* need to trap before returning to user mode */
* CTL_MACHDEP definitions.
*/
#define CPU_CONSDEV 1 /* dev_t: console terminal device */
-#define CPU_MAXID 2 /* number of valid machdep ids */
+#define CPU_CPUSPEED 2 /* CPU speed in Mhz */
+#define CPU_MACHINEID 3 /* machine id (HP_XXX) */
+#define CPU_MMUID 4 /* mmu id (MMUID_*) */
+#define CPU_MAXID 5 /* number of valid machdep ids */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "console_device", CTLTYPE_STRUCT }, \
+ { "cpuspeed", CTLTYPE_INT }, \
+ { "machineid", CTLTYPE_INT }, \
+ { "mmuid", CTLTYPE_INT }, \
}
/*