Blame view

arch/mips/kernel/proc.c 3.2 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
   *  Copyright (C) 1995, 1996, 2001  Ralf Baechle
4194318c3   Ralf Baechle   Cleanup decoding ...
3
4
   *  Copyright (C) 2001, 2004  MIPS Technologies, Inc.
   *  Copyright (C) 2004  Maciej W. Rozycki
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
   */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
7
8
9
10
11
12
13
14
  #include <linux/delay.h>
  #include <linux/kernel.h>
  #include <linux/sched.h>
  #include <linux/seq_file.h>
  #include <asm/bootinfo.h>
  #include <asm/cpu.h>
  #include <asm/cpu-features.h>
  #include <asm/mipsregs.h>
  #include <asm/processor.h>
487d70d0b   Gabor Juhos   MIPS: Add generic...
15
  #include <asm/mips_machine.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
17
  
  unsigned int vced_count, vcei_count;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18
19
  static int show_cpuinfo(struct seq_file *m, void *v)
  {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
20
  	unsigned long n = (unsigned long) v - 1;
31aa36658   Karl-Johan Karlsson   [MIPS] Show actua...
21
22
  	unsigned int version = cpu_data[n].processor_id;
  	unsigned int fp_vers = cpu_data[n].fpu_id;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
23
  	char fmt [64];
654f57bfb   David Daney   MIPS: Probe watch...
24
  	int i;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25
26
27
28
29
30
31
32
33
  
  #ifdef CONFIG_SMP
  	if (!cpu_isset(n, cpu_online_map))
  		return 0;
  #endif
  
  	/*
  	 * For the first processor also print the system type
  	 */
487d70d0b   Gabor Juhos   MIPS: Add generic...
34
  	if (n == 0) {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
35
36
  		seq_printf(m, "system type\t\t: %s
  ", get_system_type());
487d70d0b   Gabor Juhos   MIPS: Add generic...
37
38
39
40
41
  		if (mips_get_machine_name())
  			seq_printf(m, "machine\t\t\t: %s
  ",
  				   mips_get_machine_name());
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
42
43
44
45
46
  
  	seq_printf(m, "processor\t\t: %ld
  ", n);
  	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s
  ",
e04582b7b   Atsushi Nemoto   [MIPS] Make sure ...
47
  	        cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
e47c659b5   Johannes Dickgreber   MIPS: show_cpuinf...
48
  	seq_printf(m, fmt, __cpu_name[n],
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
49
50
  	                           (version >> 4) & 0x0f, version & 0x0f,
  	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
5636919b5   Ralf Baechle   MIPS: Outline ude...
51
52
  	seq_printf(m, "BogoMIPS\t\t: %u.%02u
  ",
0ac354801   Ralf Baechle   On multiprocessor...
53
54
  	              cpu_data[n].udelay_val / (500000/HZ),
  	              (cpu_data[n].udelay_val / (5000/HZ)) % 100);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
56
57
58
59
  	seq_printf(m, "wait instruction\t: %s
  ", cpu_wait ? "yes" : "no");
  	seq_printf(m, "microsecond timers\t: %s
  ",
  	              cpu_has_counter ? "yes" : "no");
31aa36658   Karl-Johan Karlsson   [MIPS] Show actua...
60
61
  	seq_printf(m, "tlb_entries\t\t: %d
  ", cpu_data[n].tlbsize);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
62
63
64
  	seq_printf(m, "extra interrupt vector\t: %s
  ",
  	              cpu_has_divec ? "yes" : "no");
654f57bfb   David Daney   MIPS: Probe watch...
65
66
67
68
69
70
71
72
73
74
75
76
  	seq_printf(m, "hardware watchpoint\t: %s",
  		   cpu_has_watch ? "yes, " : "no
  ");
  	if (cpu_has_watch) {
  		seq_printf(m, "count: %d, address/irw mask: [",
  			   cpu_data[n].watch_reg_count);
  		for (i = 0; i < cpu_data[n].watch_reg_count; i++)
  			seq_printf(m, "%s0x%04x", i ? ", " : "" ,
  				   cpu_data[n].watch_reg_masks[i]);
  		seq_printf(m, "]
  ");
  	}
e027802e9   Ralf Baechle   Display presence ...
77
78
  	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s
  ",
4194318c3   Ralf Baechle   Cleanup decoding ...
79
80
81
  		      cpu_has_mips16 ? " mips16" : "",
  		      cpu_has_mdmx ? " mdmx" : "",
  		      cpu_has_mips3d ? " mips3d" : "",
e027802e9   Ralf Baechle   Display presence ...
82
83
84
85
  		      cpu_has_smartmips ? " smartmips" : "",
  		      cpu_has_dsp ? " dsp" : "",
  		      cpu_has_mipsmt ? " mt" : ""
  		);
f6771dbb2   Ralf Baechle   [MIPS] Fix shadow...
86
87
88
  	seq_printf(m, "shadow register sets\t: %d
  ",
  		       cpu_data[n].srsets);
e77c32fe2   David Daney   MIPS: Probe for p...
89
90
91
  	seq_printf(m, "kscratch registers\t: %d
  ",
  		   hweight8(cpu_data[n].kscratch_mask));
0ab7aefc4   Ralf Baechle   [MIPS] MT: Schedu...
92
93
  	seq_printf(m, "core\t\t\t: %d
  ", cpu_data[n].core);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
94
95
96
97
98
99
  
  	sprintf(fmt, "VCE%%c exceptions\t\t: %s
  ",
  	        cpu_has_vce ? "%u" : "not available");
  	seq_printf(m, fmt, 'D', vced_count);
  	seq_printf(m, fmt, 'I', vcei_count);
17256052f   Martin Michlmayr   [MIPS] Separate C...
100
101
  	seq_printf(m, "
  ");
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
  
  	return 0;
  }
  
  static void *c_start(struct seq_file *m, loff_t *pos)
  {
  	unsigned long i = *pos;
  
  	return i < NR_CPUS ? (void *) (i + 1) : NULL;
  }
  
  static void *c_next(struct seq_file *m, void *v, loff_t *pos)
  {
  	++*pos;
  	return c_start(m, pos);
  }
  
  static void c_stop(struct seq_file *m, void *v)
  {
  }
12323cacc   Jan Engelhardt   [MIPS]: constify ...
122
  const struct seq_operations cpuinfo_op = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
123
124
125
126
127
  	.start	= c_start,
  	.next	= c_next,
  	.stop	= c_stop,
  	.show	= show_cpuinfo,
  };