patch-2.4.15 linux/arch/ppc/kernel/chrp_setup.c

Next file: linux/arch/ppc/kernel/gemini_setup.c
Previous file: linux/arch/ppc/kernel/apus_setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.14/linux/arch/ppc/kernel/chrp_setup.c linux/arch/ppc/kernel/chrp_setup.c
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.chrp_setup.c 1.36 09/08/01 15:47:42 paulus
+ * BK Id: SCCS/s.chrp_setup.c 1.38 11/13/01 21:26:07 paulus
  */
 /*
  *  linux/arch/ppc/kernel/setup.c
@@ -38,6 +38,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
+#include <linux/seq_file.h>
 
 #include <asm/mmu.h>
 #include <asm/processor.h>
@@ -81,6 +82,7 @@
 extern void pckbd_init_hw(void);
 extern unsigned char pckbd_sysrq_xlate[128];
 extern void select_adb_keyboard(void);
+extern int of_show_percpuinfo(struct seq_file *, int);
 
 extern kdev_t boot_dev;
 
@@ -110,9 +112,9 @@
 };
 
 int __chrp
-chrp_get_cpuinfo(char *buffer)
+chrp_show_cpuinfo(struct seq_file *m)
 {
-	int i, len, sdramen;
+	int i, sdramen;
 	unsigned int t;
 	struct device_node *root;
 	const char *model = "";
@@ -120,11 +122,10 @@
 	root = find_path_device("/");
 	if (root)
 		model = get_property(root, "model", NULL);
-	len = sprintf(buffer,"machine\t\t: CHRP %s\n", model);
+	seq_printf(m, "machine\t\t: CHRP %s\n", model);
 
 	/* longtrail (goldengate) stuff */
-	if ( !strncmp( model, "IBM,LongTrail", 13 ) )
-	{
+	if (!strncmp(model, "IBM,LongTrail", 13)) {
 		/* VLSI VAS96011/12 `Golden Gate 2' */
 		/* Memory banks */
 		sdramen = (in_le32((unsigned *)(GG2_PCI_CONFIG_BASE+
@@ -159,17 +160,17 @@
 				model = "Reserved";
 				break;
 			}
-			len += sprintf(buffer+len, "memory bank %d\t: %s %s\n", i, model,
-				       gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]);
+			seq_printf(m, "memory bank %d\t: %s %s\n", i, model,
+				   gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]);
 		}
 		/* L2 cache */
 		t = in_le32((unsigned *)(GG2_PCI_CONFIG_BASE+GG2_PCI_CC_CTRL));
-		len += sprintf(buffer+len, "board l2\t: %s %s (%s)\n",
-			       gg2_cachesizes[(t>>7) & 3],
-			       gg2_cachetypes[(t>>2) & 3],
-			       gg2_cachemodes[t & 3]);
+		seq_printf(m, "board l2\t: %s %s (%s)\n",
+			   gg2_cachesizes[(t>>7) & 3],
+			   gg2_cachetypes[(t>>2) & 3],
+			   gg2_cachemodes[t & 3]);
 	}
-	return len;
+	return 0;
 }
 
 /*
@@ -341,13 +342,8 @@
 chrp_irq_cannonicalize(u_int irq)
 {
 	if (irq == 2)
-	{
 		return 9;
-	}
-	else
-	{
-		return irq;
-	}
+	return irq;
 }
 
 void __init chrp_init_IRQ(void)
@@ -513,8 +509,8 @@
 	isa_io_base = CHRP_ISA_IO_BASE;		/* default value */
 
 	ppc_md.setup_arch     = chrp_setup_arch;
-	ppc_md.setup_residual = NULL;
-	ppc_md.get_cpuinfo    = chrp_get_cpuinfo;
+	ppc_md.show_percpuinfo = of_show_percpuinfo;
+	ppc_md.show_cpuinfo   = chrp_show_cpuinfo;
 	ppc_md.irq_cannonicalize = chrp_irq_cannonicalize;
 #ifndef CONFIG_POWER4
 	ppc_md.init_IRQ       = chrp_init_IRQ;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)