[PATCH 1/2] arm: add /proc/cpuinfo extension core support

H Hartley Sweeten hartleys at visionengravers.com
Mon Oct 5 13:50:42 EDT 2009


Add the necessary core support to allow a platform specific
callback to /proc/cpuinfo.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>

---

V2 - Rebased to 2.6.32-rc3


diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index c59842d..ca8bd71 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -13,6 +13,7 @@
 struct tag;
 struct meminfo;
 struct sys_timer;
+struct seq_file;
 
 struct machine_desc {
 	/*
@@ -41,6 +42,7 @@ struct machine_desc {
 	void			(*init_irq)(void);
 	struct sys_timer	*timer;		/* system tick timer	*/
 	void			(*init_machine)(void);
+	void			(*arch_cpuinfo)(struct seq_file *m, void *v);
 };
 
 /*
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c6c57b6..5f2900b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -695,6 +695,8 @@ static int __init customize_machine(void)
 }
 arch_initcall(customize_machine);
 
+static int (*arch_cpuinfo)(struct seq_file *m, void *v);
+
 void __init setup_arch(char **cmdline_p)
 {
 	struct tag *tags = (struct tag *)&init_tags;
@@ -758,6 +760,7 @@ void __init setup_arch(char **cmdline_p)
 	init_arch_irq = mdesc->init_irq;
 	system_timer = mdesc->timer;
 	init_machine = mdesc->init_machine;
+	arch_cpuinfo = mdesc->arch_cpuinfo;
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
@@ -864,6 +867,12 @@ static int c_show(struct seq_file *m, void *v)
 	seq_printf(m, "Serial\t\t: %08x%08x\n",
 		   system_serial_high, system_serial_low);
 
+	/* dump out any architecture specific features */
+	if (arch_cpuinfo) {
+		seq_puts(m, "\n");
+		arch_cpuinfo(m, v);
+	}
+
 	return 0;
 }



More information about the linux-arm-kernel mailing list