All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: Display CPU byteorder in /proc/cpuinfo
@ 2015-01-21 11:31 Joshua Kinard
  2015-01-21 11:34 ` Markos Chandras
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Kinard @ 2015-01-21 11:31 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Linux MIPS List

From: Joshua Kinard <kumba@gentoo.org>

This is a small patch to display the CPU byteorder that the kernel was compiled
with in /proc/cpuinfo.

Signed-off-by: Joshua Kinard <kumba@gentoo.org>
---
 arch/mips/kernel/proc.c |    4 ++++
 1 file changed, 4 insertions(+)

This version of the patches replaces the #ifdefs with proper conditionals.

linux-mips-proc-cpuinfo-byteorder.patch
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 097fc8d..22ef4c9 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -65,6 +65,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
 		      cpu_data[n].udelay_val / (500000/HZ),
 		      (cpu_data[n].udelay_val / (5000/HZ)) % 100);
+	if (config_enabled(CONFIG_CPU_BIG_ENDIAN))
+		seq_printf(m, "byteorder\t\t: big endian\n");
+	else
+		seq_printf(m, "byteorder\t\t: little endian\n");
 	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
 	seq_printf(m, "microsecond timers\t: %s\n",
 		      cpu_has_counter ? "yes" : "no");

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-21 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-21 11:31 [PATCH v2] MIPS: Display CPU byteorder in /proc/cpuinfo Joshua Kinard
2015-01-21 11:34 ` Markos Chandras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.