Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/m68k/m68k moved from x86k/x68k
details: https://anonhg.NetBSD.org/src/rev/2831d9f94b36
branches: trunk
changeset: 571285:2831d9f94b36
user: christos <christos%NetBSD.org@localhost>
date: Tue Nov 16 01:21:45 2004 +0000
description:
moved from x86k/x68k
diffstat:
sys/arch/m68k/m68k/procfs_machdep.c | 87 +++++++++++++++++++++++++++++++++++++
1 files changed, 87 insertions(+), 0 deletions(-)
diffs (91 lines):
diff -r 2a9a2acbf105 -r 2831d9f94b36 sys/arch/m68k/m68k/procfs_machdep.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/m68k/m68k/procfs_machdep.c Tue Nov 16 01:21:45 2004 +0000
@@ -0,0 +1,87 @@
+/* $NetBSD: procfs_machdep.c,v 1.1 2004/11/16 01:21:45 christos Exp $ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.1 2004/11/16 01:21:45 christos Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mount.h>
+#include <sys/vnode.h>
+#include <miscfs/procfs/procfs.h>
+
+#include <m68k/m68k.h>
+
+/*
+ * Linux-style /proc/cpuinfo.
+ * Only used when procfs is mounted with -o linux.
+ */
+int
+procfs_getcpuinfstr(char *buf, int *len)
+{
+ *len = 0;
+ const char *cpu, *mmu, *fpu;
+
+ switch (cputype) {
+ case CPU_68020:
+ cpu = "68020";
+ break;
+ case CPU_68030:
+ cpu = "68030";
+ break;
+ case CPU_68040:
+ cpu = "68040";
+ break;
+ case CPU_68060:
+ cpu = "68060";
+ break;
+ default:
+ cpu = "680x0";
+ break;
+ }
+
+ switch (mmutype) {
+ case MMU_68851:
+ mmu = "68851";
+ break;
+ case MMU_68030:
+ mmu = "68030";
+ break;
+ case MMU_68040:
+ mmu = "68040";
+ break;
+ case MMU_68060:
+ mmu = "68060";
+ break;
+ default:
+ mmu = "unknown";
+ break;
+ }
+
+ switch (fputype) {
+ case FPU_NONE:
+ fpu = "none(soft float)";
+ break;
+ case FPU_68881:
+ fpu = "68881";
+ break;
+ case FPU_68882:
+ fpu = "68882";
+ break;
+ default:
+ fpu = "none";
+ break;
+ }
+
+ *len = snprintf(buf, sizeof(buf),
+ /* as seen in Linux 2.4.27 */
+ "CPU:\t\t%s\n"
+ "MMU:\t\t%s\n"
+ "FPU:\t\t%s\n",
+ /*
+ * in Linux m68k /proc/cpuinfo there are also "Clocking",
+ * "BogoMips" and "Calibration".
+ */
+ cpu, mmu, fpu);
+
+ return 0;
+}
Home |
Main Index |
Thread Index |
Old Index