xref: /linux/arch/mips/kernel/proc.c (revision e1a534f5)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  *  Copyright (C) 1995, 1996, 2001  Ralf Baechle
44194318cSRalf Baechle  *  Copyright (C) 2001, 2004  MIPS Technologies, Inc.
54194318cSRalf Baechle  *  Copyright (C) 2004	Maciej W. Rozycki
61da177e4SLinus Torvalds  */
71da177e4SLinus Torvalds #include <linux/delay.h>
81da177e4SLinus Torvalds #include <linux/kernel.h>
91da177e4SLinus Torvalds #include <linux/sched.h>
101da177e4SLinus Torvalds #include <linux/seq_file.h>
111da177e4SLinus Torvalds #include <asm/bootinfo.h>
121da177e4SLinus Torvalds #include <asm/cpu.h>
131da177e4SLinus Torvalds #include <asm/cpu-features.h>
14bdc92d74SRalf Baechle #include <asm/idle.h>
151da177e4SLinus Torvalds #include <asm/mipsregs.h>
161da177e4SLinus Torvalds #include <asm/processor.h>
179169a5d0SJohn Crispin #include <asm/prom.h>
181da177e4SLinus Torvalds 
191da177e4SLinus Torvalds unsigned int vced_count, vcei_count;
201da177e4SLinus Torvalds 
21d6d3c9afSRalf Baechle /*
2201fde9a0SIlya Lipnitskiy  * No lock; only written during early bootup by CPU 0.
2301fde9a0SIlya Lipnitskiy  */
24d6d3c9afSRalf Baechle static RAW_NOTIFIER_HEAD(proc_cpuinfo_chain);
25d6d3c9afSRalf Baechle 
register_proc_cpuinfo_notifier(struct notifier_block * nb)26d6d3c9afSRalf Baechle int __ref register_proc_cpuinfo_notifier(struct notifier_block *nb)
27d6d3c9afSRalf Baechle {
28d6d3c9afSRalf Baechle 	return raw_notifier_chain_register(&proc_cpuinfo_chain, nb);
29d6d3c9afSRalf Baechle }
30d6d3c9afSRalf Baechle 
proc_cpuinfo_notifier_call_chain(unsigned long val,void * v)31d6d3c9afSRalf Baechle int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v)
32d6d3c9afSRalf Baechle {
33d6d3c9afSRalf Baechle 	return raw_notifier_call_chain(&proc_cpuinfo_chain, val, v);
34d6d3c9afSRalf Baechle }
35d6d3c9afSRalf Baechle 
show_cpuinfo(struct seq_file * m,void * v)361da177e4SLinus Torvalds static int show_cpuinfo(struct seq_file *m, void *v)
371da177e4SLinus Torvalds {
38d6d3c9afSRalf Baechle 	struct proc_cpuinfo_notifier_args proc_cpuinfo_notifier_args;
391da177e4SLinus Torvalds 	unsigned long n = (unsigned long) v - 1;
4031aa3665SKarl-Johan Karlsson 	unsigned int version = cpu_data[n].processor_id;
4131aa3665SKarl-Johan Karlsson 	unsigned int fp_vers = cpu_data[n].fpu_id;
421da177e4SLinus Torvalds 	char fmt[64];
43654f57bfSDavid Daney 	int i;
441da177e4SLinus Torvalds 
451da177e4SLinus Torvalds #ifdef CONFIG_SMP
460b5f9c00SRusty Russell 	if (!cpu_online(n))
471da177e4SLinus Torvalds 		return 0;
481da177e4SLinus Torvalds #endif
491da177e4SLinus Torvalds 
501da177e4SLinus Torvalds 	/*
511da177e4SLinus Torvalds 	 * For the first processor also print the system type
521da177e4SLinus Torvalds 	 */
53487d70d0SGabor Juhos 	if (n == 0) {
541da177e4SLinus Torvalds 		seq_printf(m, "system type\t\t: %s\n", get_system_type());
55487d70d0SGabor Juhos 		if (mips_get_machine_name())
56487d70d0SGabor Juhos 			seq_printf(m, "machine\t\t\t: %s\n",
57487d70d0SGabor Juhos 				   mips_get_machine_name());
58487d70d0SGabor Juhos 	}
591da177e4SLinus Torvalds 
601da177e4SLinus Torvalds 	seq_printf(m, "processor\t\t: %ld\n", n);
611da177e4SLinus Torvalds 	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
62e04582b7SAtsushi Nemoto 		      cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
63e47c659bSJohannes Dickgreber 	seq_printf(m, fmt, __cpu_name[n],
641da177e4SLinus Torvalds 		      (version >> 4) & 0x0f, version & 0x0f,
651da177e4SLinus Torvalds 		      (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
665636919bSRalf Baechle 	seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
670ac35480SRalf Baechle 		      cpu_data[n].udelay_val / (500000/HZ),
680ac35480SRalf Baechle 		      (cpu_data[n].udelay_val / (5000/HZ)) % 100);
691da177e4SLinus Torvalds 	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
701da177e4SLinus Torvalds 	seq_printf(m, "microsecond timers\t: %s\n",
711da177e4SLinus Torvalds 		      cpu_has_counter ? "yes" : "no");
7231aa3665SKarl-Johan Karlsson 	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
731da177e4SLinus Torvalds 	seq_printf(m, "extra interrupt vector\t: %s\n",
741da177e4SLinus Torvalds 		      cpu_has_divec ? "yes" : "no");
75654f57bfSDavid Daney 	seq_printf(m, "hardware watchpoint\t: %s",
76654f57bfSDavid Daney 		      cpu_has_watch ? "yes, " : "no\n");
77654f57bfSDavid Daney 	if (cpu_has_watch) {
78654f57bfSDavid Daney 		seq_printf(m, "count: %d, address/irw mask: [",
79654f57bfSDavid Daney 		      cpu_data[n].watch_reg_count);
80654f57bfSDavid Daney 		for (i = 0; i < cpu_data[n].watch_reg_count; i++)
81654f57bfSDavid Daney 			seq_printf(m, "%s0x%04x", i ? ", " : "",
82654f57bfSDavid Daney 				cpu_data[n].watch_reg_masks[i]);
831ad964aeSIlya Lipnitskiy 		seq_puts(m, "]\n");
84654f57bfSDavid Daney 	}
8541315b6eSAaro Koskinen 
861ad964aeSIlya Lipnitskiy 	seq_puts(m, "isa\t\t\t:");
87e5f5a5b0SMaciej W. Rozycki 	if (cpu_has_mips_1)
881ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips1");
89a96102beSSteven J. Hill 	if (cpu_has_mips_2)
901ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips2");
91a96102beSSteven J. Hill 	if (cpu_has_mips_3)
921ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips3");
93a96102beSSteven J. Hill 	if (cpu_has_mips_4)
941ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips4");
95a96102beSSteven J. Hill 	if (cpu_has_mips_5)
961ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips5");
97a96102beSSteven J. Hill 	if (cpu_has_mips32r1)
981ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips32r1");
99a96102beSSteven J. Hill 	if (cpu_has_mips32r2)
1001ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips32r2");
101ab7c01fdSSerge Semin 	if (cpu_has_mips32r5)
1021ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips32r5");
103515a6393SMarkos Chandras 	if (cpu_has_mips32r6)
1041ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips32r6");
105a96102beSSteven J. Hill 	if (cpu_has_mips64r1)
1061ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips64r1");
107a96102beSSteven J. Hill 	if (cpu_has_mips64r2)
1081ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips64r2");
109ab7c01fdSSerge Semin 	if (cpu_has_mips64r5)
1101ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips64r5");
111515a6393SMarkos Chandras 	if (cpu_has_mips64r6)
1121ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips64r6");
1131ad964aeSIlya Lipnitskiy 	seq_puts(m, "\n");
114981ef0deSRalf Baechle 
1151ad964aeSIlya Lipnitskiy 	seq_puts(m, "ASEs implemented\t:");
11601fde9a0SIlya Lipnitskiy 	if (cpu_has_mips16)
1171ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips16");
11801fde9a0SIlya Lipnitskiy 	if (cpu_has_mips16e2)
1191ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips16e2");
12001fde9a0SIlya Lipnitskiy 	if (cpu_has_mdmx)
1211ad964aeSIlya Lipnitskiy 		seq_puts(m, " mdmx");
12201fde9a0SIlya Lipnitskiy 	if (cpu_has_mips3d)
1231ad964aeSIlya Lipnitskiy 		seq_puts(m, " mips3d");
12401fde9a0SIlya Lipnitskiy 	if (cpu_has_smartmips)
1251ad964aeSIlya Lipnitskiy 		seq_puts(m, " smartmips");
12601fde9a0SIlya Lipnitskiy 	if (cpu_has_dsp)
1271ad964aeSIlya Lipnitskiy 		seq_puts(m, " dsp");
12801fde9a0SIlya Lipnitskiy 	if (cpu_has_dsp2)
1291ad964aeSIlya Lipnitskiy 		seq_puts(m, " dsp2");
13001fde9a0SIlya Lipnitskiy 	if (cpu_has_dsp3)
1311ad964aeSIlya Lipnitskiy 		seq_puts(m, " dsp3");
13201fde9a0SIlya Lipnitskiy 	if (cpu_has_mipsmt)
1331ad964aeSIlya Lipnitskiy 		seq_puts(m, " mt");
13401fde9a0SIlya Lipnitskiy 	if (cpu_has_mmips)
1351ad964aeSIlya Lipnitskiy 		seq_puts(m, " micromips");
13601fde9a0SIlya Lipnitskiy 	if (cpu_has_vz)
1371ad964aeSIlya Lipnitskiy 		seq_puts(m, " vz");
13801fde9a0SIlya Lipnitskiy 	if (cpu_has_msa)
1391ad964aeSIlya Lipnitskiy 		seq_puts(m, " msa");
14001fde9a0SIlya Lipnitskiy 	if (cpu_has_eva)
1411ad964aeSIlya Lipnitskiy 		seq_puts(m, " eva");
14201fde9a0SIlya Lipnitskiy 	if (cpu_has_htw)
1431ad964aeSIlya Lipnitskiy 		seq_puts(m, " htw");
14401fde9a0SIlya Lipnitskiy 	if (cpu_has_xpa)
1451ad964aeSIlya Lipnitskiy 		seq_puts(m, " xpa");
14601fde9a0SIlya Lipnitskiy 	if (cpu_has_loongson_mmi)
1471ad964aeSIlya Lipnitskiy 		seq_puts(m, " loongson-mmi");
14801fde9a0SIlya Lipnitskiy 	if (cpu_has_loongson_cam)
1491ad964aeSIlya Lipnitskiy 		seq_puts(m, " loongson-cam");
15001fde9a0SIlya Lipnitskiy 	if (cpu_has_loongson_ext)
1511ad964aeSIlya Lipnitskiy 		seq_puts(m, " loongson-ext");
15201fde9a0SIlya Lipnitskiy 	if (cpu_has_loongson_ext2)
1531ad964aeSIlya Lipnitskiy 		seq_puts(m, " loongson-ext2");
1541ad964aeSIlya Lipnitskiy 	seq_puts(m, "\n");
155981ef0deSRalf Baechle 
156bce86083SSteven J. Hill 	if (cpu_has_mmips) {
157bce86083SSteven J. Hill 		seq_printf(m, "micromips kernel\t: %s\n",
158bce86083SSteven J. Hill 		      (read_c0_config3() & MIPS_CONF3_ISA_OE) ?  "yes" : "no");
159bce86083SSteven J. Hill 	}
160626bfa03SHauke Mehrtens 
161626bfa03SHauke Mehrtens 	seq_puts(m, "Options implemented\t:");
162626bfa03SHauke Mehrtens 	if (cpu_has_tlb)
163626bfa03SHauke Mehrtens 		seq_puts(m, " tlb");
164626bfa03SHauke Mehrtens 	if (cpu_has_ftlb)
165626bfa03SHauke Mehrtens 		seq_puts(m, " ftlb");
166626bfa03SHauke Mehrtens 	if (cpu_has_tlbinv)
167626bfa03SHauke Mehrtens 		seq_puts(m, " tlbinv");
168626bfa03SHauke Mehrtens 	if (cpu_has_segments)
169626bfa03SHauke Mehrtens 		seq_puts(m, " segments");
170626bfa03SHauke Mehrtens 	if (cpu_has_rixiex)
171626bfa03SHauke Mehrtens 		seq_puts(m, " rixiex");
172626bfa03SHauke Mehrtens 	if (cpu_has_ldpte)
173626bfa03SHauke Mehrtens 		seq_puts(m, " ldpte");
174626bfa03SHauke Mehrtens 	if (cpu_has_maar)
175626bfa03SHauke Mehrtens 		seq_puts(m, " maar");
176626bfa03SHauke Mehrtens 	if (cpu_has_rw_llb)
177626bfa03SHauke Mehrtens 		seq_puts(m, " rw_llb");
178626bfa03SHauke Mehrtens 	if (cpu_has_4kex)
179626bfa03SHauke Mehrtens 		seq_puts(m, " 4kex");
180626bfa03SHauke Mehrtens 	if (cpu_has_3k_cache)
181626bfa03SHauke Mehrtens 		seq_puts(m, " 3k_cache");
182626bfa03SHauke Mehrtens 	if (cpu_has_4k_cache)
183626bfa03SHauke Mehrtens 		seq_puts(m, " 4k_cache");
184626bfa03SHauke Mehrtens 	if (cpu_has_octeon_cache)
185626bfa03SHauke Mehrtens 		seq_puts(m, " octeon_cache");
1861cab5bd6STiezhu Yang 	if (raw_cpu_has_fpu)
187626bfa03SHauke Mehrtens 		seq_puts(m, " fpu");
188626bfa03SHauke Mehrtens 	if (cpu_has_32fpr)
189626bfa03SHauke Mehrtens 		seq_puts(m, " 32fpr");
190626bfa03SHauke Mehrtens 	if (cpu_has_cache_cdex_p)
191626bfa03SHauke Mehrtens 		seq_puts(m, " cache_cdex_p");
192626bfa03SHauke Mehrtens 	if (cpu_has_cache_cdex_s)
193626bfa03SHauke Mehrtens 		seq_puts(m, " cache_cdex_s");
194626bfa03SHauke Mehrtens 	if (cpu_has_prefetch)
195626bfa03SHauke Mehrtens 		seq_puts(m, " prefetch");
196626bfa03SHauke Mehrtens 	if (cpu_has_mcheck)
197626bfa03SHauke Mehrtens 		seq_puts(m, " mcheck");
198626bfa03SHauke Mehrtens 	if (cpu_has_ejtag)
199626bfa03SHauke Mehrtens 		seq_puts(m, " ejtag");
200626bfa03SHauke Mehrtens 	if (cpu_has_llsc)
201626bfa03SHauke Mehrtens 		seq_puts(m, " llsc");
202626bfa03SHauke Mehrtens 	if (cpu_has_guestctl0ext)
203626bfa03SHauke Mehrtens 		seq_puts(m, " guestctl0ext");
204626bfa03SHauke Mehrtens 	if (cpu_has_guestctl1)
205626bfa03SHauke Mehrtens 		seq_puts(m, " guestctl1");
206626bfa03SHauke Mehrtens 	if (cpu_has_guestctl2)
207626bfa03SHauke Mehrtens 		seq_puts(m, " guestctl2");
208626bfa03SHauke Mehrtens 	if (cpu_has_guestid)
209626bfa03SHauke Mehrtens 		seq_puts(m, " guestid");
210626bfa03SHauke Mehrtens 	if (cpu_has_drg)
211626bfa03SHauke Mehrtens 		seq_puts(m, " drg");
212626bfa03SHauke Mehrtens 	if (cpu_has_rixi)
213626bfa03SHauke Mehrtens 		seq_puts(m, " rixi");
214626bfa03SHauke Mehrtens 	if (cpu_has_lpa)
215626bfa03SHauke Mehrtens 		seq_puts(m, " lpa");
216626bfa03SHauke Mehrtens 	if (cpu_has_mvh)
217626bfa03SHauke Mehrtens 		seq_puts(m, " mvh");
218626bfa03SHauke Mehrtens 	if (cpu_has_vtag_icache)
219626bfa03SHauke Mehrtens 		seq_puts(m, " vtag_icache");
220626bfa03SHauke Mehrtens 	if (cpu_has_dc_aliases)
221626bfa03SHauke Mehrtens 		seq_puts(m, " dc_aliases");
222626bfa03SHauke Mehrtens 	if (cpu_has_ic_fills_f_dc)
223626bfa03SHauke Mehrtens 		seq_puts(m, " ic_fills_f_dc");
224626bfa03SHauke Mehrtens 	if (cpu_has_pindexed_dcache)
225626bfa03SHauke Mehrtens 		seq_puts(m, " pindexed_dcache");
226626bfa03SHauke Mehrtens 	if (cpu_has_userlocal)
227626bfa03SHauke Mehrtens 		seq_puts(m, " userlocal");
228626bfa03SHauke Mehrtens 	if (cpu_has_nofpuex)
229626bfa03SHauke Mehrtens 		seq_puts(m, " nofpuex");
230626bfa03SHauke Mehrtens 	if (cpu_has_vint)
231626bfa03SHauke Mehrtens 		seq_puts(m, " vint");
232626bfa03SHauke Mehrtens 	if (cpu_has_veic)
233626bfa03SHauke Mehrtens 		seq_puts(m, " veic");
234626bfa03SHauke Mehrtens 	if (cpu_has_inclusive_pcaches)
235626bfa03SHauke Mehrtens 		seq_puts(m, " inclusive_pcaches");
236626bfa03SHauke Mehrtens 	if (cpu_has_perf_cntr_intr_bit)
237626bfa03SHauke Mehrtens 		seq_puts(m, " perf_cntr_intr_bit");
238626bfa03SHauke Mehrtens 	if (cpu_has_ufr)
239626bfa03SHauke Mehrtens 		seq_puts(m, " ufr");
240626bfa03SHauke Mehrtens 	if (cpu_has_fre)
241626bfa03SHauke Mehrtens 		seq_puts(m, " fre");
242626bfa03SHauke Mehrtens 	if (cpu_has_cdmm)
243626bfa03SHauke Mehrtens 		seq_puts(m, " cdmm");
244626bfa03SHauke Mehrtens 	if (cpu_has_small_pages)
245626bfa03SHauke Mehrtens 		seq_puts(m, " small_pages");
246626bfa03SHauke Mehrtens 	if (cpu_has_nan_legacy)
247626bfa03SHauke Mehrtens 		seq_puts(m, " nan_legacy");
248626bfa03SHauke Mehrtens 	if (cpu_has_nan_2008)
249626bfa03SHauke Mehrtens 		seq_puts(m, " nan_2008");
250626bfa03SHauke Mehrtens 	if (cpu_has_ebase_wg)
251626bfa03SHauke Mehrtens 		seq_puts(m, " ebase_wg");
252626bfa03SHauke Mehrtens 	if (cpu_has_badinstr)
253626bfa03SHauke Mehrtens 		seq_puts(m, " badinstr");
254626bfa03SHauke Mehrtens 	if (cpu_has_badinstrp)
255626bfa03SHauke Mehrtens 		seq_puts(m, " badinstrp");
256626bfa03SHauke Mehrtens 	if (cpu_has_contextconfig)
257626bfa03SHauke Mehrtens 		seq_puts(m, " contextconfig");
258626bfa03SHauke Mehrtens 	if (cpu_has_perf)
259626bfa03SHauke Mehrtens 		seq_puts(m, " perf");
260626bfa03SHauke Mehrtens 	if (cpu_has_mac2008_only)
261626bfa03SHauke Mehrtens 		seq_puts(m, " mac2008_only");
262626bfa03SHauke Mehrtens 	if (cpu_has_ftlbparex)
263626bfa03SHauke Mehrtens 		seq_puts(m, " ftlbparex");
264626bfa03SHauke Mehrtens 	if (cpu_has_gsexcex)
265626bfa03SHauke Mehrtens 		seq_puts(m, " gsexcex");
266626bfa03SHauke Mehrtens 	if (cpu_has_shared_ftlb_ram)
267626bfa03SHauke Mehrtens 		seq_puts(m, " shared_ftlb_ram");
268626bfa03SHauke Mehrtens 	if (cpu_has_shared_ftlb_entries)
269626bfa03SHauke Mehrtens 		seq_puts(m, " shared_ftlb_entries");
270626bfa03SHauke Mehrtens 	if (cpu_has_mipsmt_pertccounters)
271626bfa03SHauke Mehrtens 		seq_puts(m, " mipsmt_pertccounters");
272626bfa03SHauke Mehrtens 	if (cpu_has_mmid)
273626bfa03SHauke Mehrtens 		seq_puts(m, " mmid");
274626bfa03SHauke Mehrtens 	if (cpu_has_mm_sysad)
275626bfa03SHauke Mehrtens 		seq_puts(m, " mm_sysad");
276626bfa03SHauke Mehrtens 	if (cpu_has_mm_full)
277626bfa03SHauke Mehrtens 		seq_puts(m, " mm_full");
278626bfa03SHauke Mehrtens 	seq_puts(m, "\n");
279626bfa03SHauke Mehrtens 
280f6771dbbSRalf Baechle 	seq_printf(m, "shadow register sets\t: %d\n",
281f6771dbbSRalf Baechle 		      cpu_data[n].srsets);
282e77c32feSDavid Daney 	seq_printf(m, "kscratch registers\t: %d\n",
283e77c32feSDavid Daney 		      hweight8(cpu_data[n].kscratch_mask));
284bda4584cSHuacai Chen 	seq_printf(m, "package\t\t\t: %d\n", cpu_data[n].package);
285f875a832SPaul Burton 	seq_printf(m, "core\t\t\t: %d\n", cpu_core(&cpu_data[n]));
2865508d456SRalf Baechle 
287765b0647SMatt Redfearn #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_CPU_MIPSR6)
288765b0647SMatt Redfearn 	if (cpu_has_mipsmt)
289f875a832SPaul Burton 		seq_printf(m, "VPE\t\t\t: %d\n", cpu_vpe_id(&cpu_data[n]));
290765b0647SMatt Redfearn 	else if (cpu_has_vp)
291f875a832SPaul Burton 		seq_printf(m, "VP\t\t\t: %d\n", cpu_vpe_id(&cpu_data[n]));
292765b0647SMatt Redfearn #endif
293765b0647SMatt Redfearn 
2941da177e4SLinus Torvalds 	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
2951da177e4SLinus Torvalds 		      cpu_has_vce ? "%u" : "not available");
2961da177e4SLinus Torvalds 	seq_printf(m, fmt, 'D', vced_count);
2971da177e4SLinus Torvalds 	seq_printf(m, fmt, 'I', vcei_count);
298d6d3c9afSRalf Baechle 
299d6d3c9afSRalf Baechle 	proc_cpuinfo_notifier_args.m = m;
300d6d3c9afSRalf Baechle 	proc_cpuinfo_notifier_args.n = n;
301d6d3c9afSRalf Baechle 
302d6d3c9afSRalf Baechle 	raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
303d6d3c9afSRalf Baechle 				&proc_cpuinfo_notifier_args);
304d6d3c9afSRalf Baechle 
3051ad964aeSIlya Lipnitskiy 	seq_puts(m, "\n");
3061da177e4SLinus Torvalds 
3071da177e4SLinus Torvalds 	return 0;
3081da177e4SLinus Torvalds }
3091da177e4SLinus Torvalds 
c_start(struct seq_file * m,loff_t * pos)3101da177e4SLinus Torvalds static void *c_start(struct seq_file *m, loff_t *pos)
3111da177e4SLinus Torvalds {
3121da177e4SLinus Torvalds 	unsigned long i = *pos;
3131da177e4SLinus Torvalds 
314*e1a534f5SHuacai Chen 	return i < nr_cpu_ids ? (void *) (i + 1) : NULL;
3151da177e4SLinus Torvalds }
3161da177e4SLinus Torvalds 
c_next(struct seq_file * m,void * v,loff_t * pos)3171da177e4SLinus Torvalds static void *c_next(struct seq_file *m, void *v, loff_t *pos)
3181da177e4SLinus Torvalds {
3191da177e4SLinus Torvalds 	++*pos;
3201da177e4SLinus Torvalds 	return c_start(m, pos);
3211da177e4SLinus Torvalds }
3221da177e4SLinus Torvalds 
c_stop(struct seq_file * m,void * v)3231da177e4SLinus Torvalds static void c_stop(struct seq_file *m, void *v)
3241da177e4SLinus Torvalds {
3251da177e4SLinus Torvalds }
3261da177e4SLinus Torvalds 
32712323cacSJan Engelhardt const struct seq_operations cpuinfo_op = {
3281da177e4SLinus Torvalds 	.start	= c_start,
3291da177e4SLinus Torvalds 	.next	= c_next,
3301da177e4SLinus Torvalds 	.stop	= c_stop,
3311da177e4SLinus Torvalds 	.show	= show_cpuinfo,
3321da177e4SLinus Torvalds };
333