From: James S. <jsi...@us...> - 2001-12-26 17:28:14
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel In directory usw-pr-cvs1:/tmp/cvs-serv5113/arch/sh/kernel Modified Files: setup.c Log Message: Synced to 2.5.0. Don't use. The default 2.5.0 has a nasty bug in it. Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel/setup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- setup.c 2001/10/06 16:11:13 1.4 +++ setup.c 2001/12/26 17:28:11 1.5 @@ -30,6 +30,7 @@ #endif #include <linux/bootmem.h> #include <linux/ctype.h> +#include <linux/seq_file.h> #include <asm/processor.h> #include <asm/page.h> #include <asm/pgtable.h> @@ -506,24 +507,22 @@ * Get CPU information for use by the procfs. */ #ifdef CONFIG_PROC_FS -int get_cpuinfo(char *buffer) +static int show_cpuinfo(struct seq_file *m, void *v) { - char *p = buffer; - #if defined(__sh3__) - p += sprintf(p,"cpu family\t: SH-3\n" - "cache size\t: 8K-byte\n"); + seq_printf(m, "cpu family\t: SH-3\n" + "cache size\t: 8K-byte\n"); #elif defined(__SH4__) - p += sprintf(p,"cpu family\t: SH-4\n" - "cache size\t: 8K-byte/16K-byte\n"); + seq_printf(m, "cpu family\t: SH-4\n" + "cache size\t: 8K-byte/16K-byte\n"); #endif - p += sprintf(p, "bogomips\t: %lu.%02lu\n\n", + seq_printf(m, "bogomips\t: %lu.%02lu\n\n", loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100); - p += sprintf(p, "Machine: %s\n", sh_mv.mv_name); + seq_printf(m, "Machine: %s\n", sh_mv.mv_name); #define PRINT_CLOCK(name, value) \ - p += sprintf(p, name " clock: %d.%02dMHz\n", \ + seq_printf(m, name " clock: %d.%02dMHz\n", \ ((value) / 1000000), ((value) % 1000000)/10000) PRINT_CLOCK("CPU", boot_cpu_data.cpu_clock); @@ -533,6 +532,24 @@ #endif PRINT_CLOCK("Peripheral module", boot_cpu_data.module_clock); - return p - buffer; + return 0; +} + +static void *c_start(struct seq_file *m, loff_t *pos) +{ + return (void*)(*pos == 0); +} +static void *c_next(struct seq_file *m, void *v, loff_t *pos) +{ + return NULL; } +static void c_stop(struct seq_file *m, void *v) +{ +} +struct seq_operations cpuinfo_op = { + start: c_start, + next: c_next, + stop: c_stop, + show: show_cpuinfo, +}; #endif |