File: /usr/src/linux/arch/mips64/kernel/proc.c

1     /*
2      * This file is subject to the terms and conditions of the GNU General Public
3      * License.  See the file "COPYING" in the main directory of this archive
4      * for more details.
5      *
6      * Copyright (C) 1995, 1996, 1999, 2001 Ralf Baechle
7      * Copyright (C) 2001 MIPS Technologies, Inc.
8      */
9     #include <linux/delay.h>
10     #include <linux/kernel.h>
11     #include <linux/sched.h>
12     #include <linux/smp.h>
13     #include <asm/bootinfo.h>
14     #include <asm/mipsregs.h>
15     #include <asm/processor.h>
16     #include <asm/watch.h>
17     
18     extern unsigned long unaligned_instructions;
19     unsigned int vced_count, vcei_count;
20     
21     /*
22      * BUFFER is PAGE_SIZE bytes long.
23      *
24      * Currently /proc/cpuinfo is being abused to print data about the
25      * number of date/instruction cacheflushes.
26      */
27     int get_cpuinfo(char *buffer)
28     {
29     	char fmt [64];
30     	size_t len;
31     
32     	len = sprintf(buffer, "cpu\t\t\t: MIPS\n");
33     #if 0
34     	len += sprintf(buffer + len, "cpu model\t\t: %s V%d.%d\n",
35     	               cpu_name[mips_cputype <= CPU_LAST ?
36     	                        mips_cputype :
37     	                        CPU_UNKNOWN],
38     	               (version >> 4) & 0x0f,
39     	               version & 0x0f);
40     	len += sprintf(buffer + len, "system type\t\t: %s %s\n",
41     		       mach_group_names[mips_machgroup],
42     		       mach_group_to_name[mips_machgroup][mips_machtype]);
43     #endif
44     	len += sprintf(buffer + len, "BogoMIPS\t\t: %lu.%02lu\n",
45     		       (loops_per_jiffy + 2500) / (500000/HZ),
46     	               ((loops_per_jiffy + 2500) / (5000/HZ)) % 100);
47     	len += sprintf(buffer + len, "Number of cpus\t\t: %d\n", smp_num_cpus);
48     #if defined (__MIPSEB__)
49     	len += sprintf(buffer + len, "byteorder\t\t: big endian\n");
50     #endif
51     #if defined (__MIPSEL__)
52     	len += sprintf(buffer + len, "byteorder\t\t: little endian\n");
53     #endif
54     	len += sprintf(buffer + len, "unaligned accesses\t: %lu\n",
55     		       unaligned_instructions);
56     	len += sprintf(buffer + len, "wait instruction\t: %s\n",
57     	               wait_available ? "yes" : "no");
58     	len += sprintf(buffer + len, "microsecond timers\t: %s\n",
59     	               cyclecounter_available ? "yes" : "no");
60     	len += sprintf(buffer + len, "extra interrupt vector\t: %s\n",
61     	               dedicated_iv_available ? "yes" : "no");
62     	len += sprintf(buffer + len, "hardware watchpoint\t: %s\n",
63     	               watch_available ? "yes" : "no");
64     
65     	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
66     	        vce_available ? "%d" : "not available");
67     	len += sprintf(buffer + len, fmt, 'D', vced_count);
68     	len += sprintf(buffer + len, fmt, 'I', vcei_count);
69     
70     	return len;
71     }
72     
73     void init_irq_proc(void)
74     {
75     	/* Nothing, for now.  */
76     }
77