MIPS: Display CPU byteorder in /proc/cpuinfo
PATCH v2 1/1 MIPS: Display CPU byteorder in /proc/cpuinfo
From: Joshua Kinard <[email protected]>
This is a small patch to display the CPU byteorder that the kernel was compiled with in /proc/cpuinfo.
Signed-off-by Joshua Kinard <[email protected]>
--- 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
arch/mips/kernel/proc.c +4 -0
@@ -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" );
Quoted 20 lines · Joshua Kinard
From: Joshua Kinard <[email protected]>
This is a small patch to display the CPU byteorder that the kernel was compiled with in
/proc/cpuinfo.Signed-off-by Joshua Kinard <[email protected]>--- 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
arch/mips/kernel/proc.c +0
-0
arch/mips/kernel/proc.c static int show_cpuinfo(struct seq_file *m, void *v) · line 74
Quoted 10 lines
arch/mips/kernel/proc.c +4
-0@@ -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" );
fwiw that looks ok to me
Reviewed-by Markos Chandras <[email protected]>
Signature · 1 line
markos