Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / arch / mips64 / kernel / proc.c
blob766540e2c8c81198f3bb71b4251f538ed69900e8
1 /* $Id: proc.c,v 1.1 1999/09/28 22:25:51 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Copyright (C) 1995, 1996, 1999 Ralf Baechle
9 * XXX Rewrite this mess.
11 #include <linux/delay.h>
12 #include <linux/kernel.h>
13 #include <linux/sched.h>
14 #include <linux/smp.h>
15 #include <asm/bootinfo.h>
16 #include <asm/mipsregs.h>
17 #include <asm/processor.h>
18 #include <asm/watch.h>
20 unsigned long unaligned_instructions;
21 unsigned int vced_count, vcei_count;
24 * BUFFER is PAGE_SIZE bytes long.
26 * Currently /proc/cpuinfo is being abused to print data about the
27 * number of date/instruction cacheflushes.
29 int get_cpuinfo(char *buffer, char **start, off_t offset, int count)
31 char fmt [64];
32 struct cpuinfo_mips *c = cpu_data;
33 size_t len = 0;
34 int n;
36 for (n = 0; n < smp_num_cpus; n++, c++) {
37 len += sprintf(buffer + len, "processor\t\t: %d\n", n);
38 len += sprintf(buffer + len, "vendor_id\t\t: MIPS\n");
39 len += sprintf(buffer + len, "model name\t\t: R10000\n");
40 /* len += sprintf(buffer + len, "cpu model\t\t: %s V%d.%d\n",
41 cpu_name[mips_cputype <= CPU_LAST ?
42 mips_cputype :
43 CPU_UNKNOWN],
44 (version >> 4) & 0x0f,
45 version & 0x0f);
46 len += sprintf(buffer + len, "system type\t\t: %s %s\n",
47 mach_group_names[mips_machgroup],
48 mach_group_to_name[mips_machgroup][mips_machtype]);
50 len += sprintf(buffer + len, "BogoMIPS\t\t: %lu.%02lu\n",
51 (loops_per_sec + 2500) / 500000,
52 ((loops_per_sec + 2500) / 5000) % 100);
53 /* len += sprintf(buffer + len, "Number of cpus\t\t: %d\n", smp_num_cpus);*/
54 #if defined (__MIPSEB__)
55 len += sprintf(buffer + len, "byteorder\t\t: big endian\n");
56 #endif
57 #if defined (__MIPSEL__)
58 len += sprintf(buffer + len, "byteorder\t\t: little endian\n");
59 #endif
60 len += sprintf(buffer + len, "unaligned accesses\t: %lu\n",
61 unaligned_instructions);
62 len += sprintf(buffer + len, "wait instruction\t: %s\n",
63 wait_available ? "yes" : "no");
64 len += sprintf(buffer + len, "microsecond timers\t: %s\n",
65 cyclecounter_available ? "yes" : "no");
66 len += sprintf(buffer + len, "extra interrupt vector\t: %s\n",
67 dedicated_iv_available ? "yes" : "no");
68 len += sprintf(buffer + len, "hardware watchpoint\t: %s\n",
69 watch_available ? "yes" : "no");
71 sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
72 vce_available ? "%d" : "not available");
73 len += sprintf(buffer + len, fmt, 'D', vced_count);
74 len += sprintf(buffer + len, fmt, 'I', vcei_count);
75 len += sprintf(buffer + len, "\n");
77 if (len < offset)
78 offset -= len, len = 0;
79 else if (len >= offset + count)
80 goto leave_loop;
83 leave_loop:
84 *start = buffer + offset;
85 len -= offset;
86 if (len < 0)
87 len = 0;
88 return len > count ? count : len;
92 void init_irq_proc(void)
94 /* Nothing, for now. */