[PATCH 3/5] x86_32: add power management line in /proc/cpuinfo

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Hiroshi Shimamoto
Date: Wednesday, February 20, 2008 - 11:47 am

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Change /proc/cpuinfo. It will look like x86_64's.
'power management' line is added and power management information
will be printed at the line.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/cpu/proc.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 9bc3b04..fd3823a 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -94,7 +94,13 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 		if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
 			seq_printf(m, " %s", x86_cap_flags[i]);
 
-	for (i = 0; i < 32; i++)
+	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
+		   c->loops_per_jiffy/(500000/HZ),
+		   (c->loops_per_jiffy/(5000/HZ)) % 100);
+	seq_printf(m, "clflush size\t: %u\n", c->x86_clflush_size);
+
+	seq_printf(m, "power management:");
+	for (i = 0; i < 32; i++) {
 		if (c->x86_power & (1 << i)) {
 			if (i < ARRAY_SIZE(x86_power_flags) &&
 			    x86_power_flags[i])
@@ -104,11 +110,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 			else
 				seq_printf(m, " [%d]", i);
 		}
+	}
 
-	seq_printf(m, "\nbogomips\t: %lu.%02lu\n",
-		   c->loops_per_jiffy/(500000/HZ),
-		   (c->loops_per_jiffy/(5000/HZ)) % 100);
-	seq_printf(m, "clflush size\t: %u\n\n", c->x86_clflush_size);
+	seq_printf(m, "\n\n");
 
 	return 0;
 }
-- 
1.5.3.8


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/5] x86_64: split cpuinfo from setup_64.c into cpu ..., Hiroshi Shimamoto, (Wed Feb 20, 11:41 am)
[PATCH 2/5] x86: make cpu/proc|_64.c similar, Hiroshi Shimamoto, (Wed Feb 20, 11:45 am)
[PATCH 3/5] x86_32: add power management line in /proc/cpuinfo, Hiroshi Shimamoto, (Wed Feb 20, 11:47 am)
[PATCH 4/5] x86: cosmetic unification cpu/proc|_64.c, Hiroshi Shimamoto, (Wed Feb 20, 11:48 am)
[PATCH 5/5] x86: unify cpu/proc|_64.c, Hiroshi Shimamoto, (Wed Feb 20, 11:48 am)
Re: [PATCH 5/5] x86: unify cpu/proc|_64.c, Ingo Molnar, (Wed Feb 20, 8:10 pm)