aboutsummaryrefslogtreecommitdiff
path: root/arch/v850/kernel/procfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/v850/kernel/procfs.c
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/v850/kernel/procfs.c')
-rw-r--r--arch/v850/kernel/procfs.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/v850/kernel/procfs.c b/arch/v850/kernel/procfs.c
new file mode 100644
index 00000000000..e6f9d060ad5
--- /dev/null
+++ b/arch/v850/kernel/procfs.c
@@ -0,0 +1,67 @@
+/*
+ * arch/v850/kernel/procfs.c -- Introspection functions for /proc filesystem
+ *
+ * Copyright (C) 2001,02 NEC Corporation
+ * Copyright (C) 2001,02 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file COPYING in the main directory of this
+ * archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include "mach.h"
+
+static int cpuinfo_print (struct seq_file *m, void *v)
+{
+ extern unsigned long loops_per_jiffy;
+
+ seq_printf (m, "CPU-Family: v850\nCPU-Arch: %s\n", CPU_ARCH);
+
+#ifdef CPU_MODEL_LONG
+ seq_printf (m, "CPU-Model: %s (%s)\n", CPU_MODEL, CPU_MODEL_LONG);
+#else
+ seq_printf (m, "CPU-Model: %s\n", CPU_MODEL);
+#endif
+
+#ifdef CPU_CLOCK_FREQ
+ seq_printf (m, "CPU-Clock: %ld (%ld MHz)\n",
+ (long)CPU_CLOCK_FREQ,
+ (long)CPU_CLOCK_FREQ / 1000000);
+#endif
+
+ seq_printf (m, "BogoMips: %lu.%02lu\n",
+ loops_per_jiffy/(500000/HZ),
+ (loops_per_jiffy/(5000/HZ)) % 100);
+
+#ifdef PLATFORM_LONG
+ seq_printf (m, "Platform: %s (%s)\n", PLATFORM, PLATFORM_LONG);
+#elif defined (PLATFORM)
+ seq_printf (m, "Platform: %s\n", PLATFORM);
+#endif
+
+ return 0;
+}
+
+static void *cpuinfo_start (struct seq_file *m, loff_t *pos)
+{
+ return *pos < NR_CPUS ? ((void *) 0x12345678) : NULL;
+}
+
+static void *cpuinfo_next (struct seq_file *m, void *v, loff_t *pos)
+{
+ ++*pos;
+ return cpuinfo_start (m, pos);
+}
+
+static void cpuinfo_stop (struct seq_file *m, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+ .start = cpuinfo_start,
+ .next = cpuinfo_next,
+ .stop = cpuinfo_stop,
+ .show = cpuinfo_print
+};