Skip to contentSkip to conversation

: Add byteorder/endianess to /proc/cpuinfo

PATCH New Kumba 1 participant 1 message Jan 23, 2006 MIPS

lore
Share & tools
lore

Kumba

author
#0 lore raw

PATCH 1/1 : Add byteorder/endianess to /proc/cpuinfo

Attached is a patch we've been using for some time (originally posted to this list some time ago) which adds the byteorder output to /proc/cpuinfo.

i.e.:

byteorder : big endian

or

byteorder : little endian

--Kumba

--
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond

## 11_byteorder-proc.dpatch by ???
##
## All lines beginning with `## DP:' are a description of the patch. ## DP: Add byteorder info to /proc/cpuinfo

Index: arch/mips/kernel/proc.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/proc.c,v retrieving revision 1.27.2.17

mips/kernel/proc.c +5 -0
diff -u -p -u -r1.27.2.17 proc.c
@@ -100,6 +100,11 @@ static int show_cpuinfo(struct seq_file 
 	seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
 	              cpu_data[n].udelay_val / (500000/HZ),
 	              (cpu_data[n].udelay_val / (5000/HZ)) % 100);
+#ifdef __MIPSEB__
+	seq_printf(m, "byteorder\t\t: big endian\n");
+#else
+	seq_printf(m, "byteorder\t\t: little endian\n");
+#endif
 	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");