On Wed, Jan 21, 2015 at 10:22:30AM +0000, Markos Chandras wrote: > >>> What would use this? Or in other words, why is this needed? > >> > >> It was a patch I started including years ago in Gentoo's mips-sources, and just > >> never thought much about. I know it was submitted several times in the past, > >> but I can't recall what, if any objection was ever made. No harm in sending it > >> in again... > > > > Clarification, submitted several times in the past by others. I think I sent > > it in once prior, but never got review or feedback. > > > I believe this patch is mostly useful for cores that can boot in both LE > and BE so being able to tell the byteorder from cpuinfo can be helpful > at times. Having readelf and other tools in your userland may not always > be the case, but you surely have "cat" :) > > So that patch looks good to me but i think the #ifdefs can be avoided. > Can we use > > if (config_enabled(CONFIG_CPU_BIG_ENDIAN) { > } else { > } > > stuff instead? Exactly the code Joshua is submitting is what has been there until commit 874124ebb630 (Merge with Linux 2.4.15.) in 2001. One reason to remove it was that I had a prototype of a kernel supporting the execution of application of native and the other byte order working and the field in /proc/cpuinfo was plain lying in that case. Not a terribly relevant reason in retrospective but I'm wondering if just in case we should rename the field to kernel_byteorder? Ralf