[PATCH]: Add byteorder/endianess to /proc/cpuinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
diff -u -p -u -r1.27.2.17 proc.c
--- arch/mips/kernel/proc.c	27 Apr 2003 23:34:46 -0000	1.27.2.17
+++ arch/mips/kernel/proc.c	21 Sep 2003 00:14:13 -0000
@@ -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");

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux