@@ -843,58 +843,58 @@ static const char *hwcap_str[] = {
843843
844844static int c_show (struct seq_file * m , void * v )
845845{
846- int i ;
847-
848- seq_printf (m , "Processor\t: %s rev %d (%s)\n" ,
849- cpu_name , read_cpuid_id () & 15 , elf_platform );
846+ int i , j ;
847+ u32 cpuid ;
850848
851- #if defined(CONFIG_SMP )
852849 for_each_online_cpu (i ) {
853850 /*
854851 * glibc reads /proc/cpuinfo to determine the number of
855852 * online processors, looking for lines beginning with
856853 * "processor". Give glibc what it expects.
857854 */
858855 seq_printf (m , "processor\t: %d\n" , i );
859- seq_printf (m , "BogoMIPS\t: %lu.%02lu\n\n" ,
856+ cpuid = is_smp () ? per_cpu (cpu_data , i ).cpuid : read_cpuid_id ();
857+ seq_printf (m , "model name\t: %s rev %d (%s)\n" ,
858+ cpu_name , cpuid & 15 , elf_platform );
859+
860+ #if defined(CONFIG_SMP )
861+ seq_printf (m , "BogoMIPS\t: %lu.%02lu\n" ,
860862 per_cpu (cpu_data , i ).loops_per_jiffy / (500000UL /HZ ),
861863 (per_cpu (cpu_data , i ).loops_per_jiffy / (5000UL /HZ )) % 100 );
862- }
863- #else /* CONFIG_SMP */
864- seq_printf (m , "BogoMIPS\t: %lu.%02lu\n" ,
865- loops_per_jiffy / (500000 /HZ ),
866- (loops_per_jiffy / (5000 /HZ )) % 100 );
864+ #else
865+ seq_printf (m , "BogoMIPS\t: %lu.%02lu\n" ,
866+ loops_per_jiffy / (500000 /HZ ),
867+ (loops_per_jiffy / (5000 /HZ )) % 100 );
867868#endif
869+ /* dump out the processor features */
870+ seq_puts (m , "Features\t: " );
868871
869- /* dump out the processor features */
870- seq_puts (m , "Features\t: " );
871-
872- for (i = 0 ; hwcap_str [i ]; i ++ )
873- if (elf_hwcap & (1 << i ))
874- seq_printf (m , "%s " , hwcap_str [i ]);
872+ for (j = 0 ; hwcap_str [j ]; j ++ )
873+ if (elf_hwcap & (1 << j ))
874+ seq_printf (m , "%s " , hwcap_str [j ]);
875875
876- seq_printf (m , "\nCPU implementer\t: 0x%02x\n" , read_cpuid_id () >> 24 );
877- seq_printf (m , "CPU architecture: %s\n" , proc_arch [cpu_architecture ()]);
876+ seq_printf (m , "\nCPU implementer\t: 0x%02x\n" , cpuid >> 24 );
877+ seq_printf (m , "CPU architecture: %s\n" ,
878+ proc_arch [cpu_architecture ()]);
878879
879- if ((read_cpuid_id () & 0x0008f000 ) == 0x00000000 ) {
880- /* pre-ARM7 */
881- seq_printf (m , "CPU part\t: %07x\n" , read_cpuid_id () >> 4 );
882- } else {
883- if ((read_cpuid_id () & 0x0008f000 ) == 0x00007000 ) {
884- /* ARM7 */
885- seq_printf (m , "CPU variant\t: 0x%02x\n" ,
886- (read_cpuid_id () >> 16 ) & 127 );
880+ if ((cpuid & 0x0008f000 ) == 0x00000000 ) {
881+ /* pre-ARM7 */
882+ seq_printf (m , "CPU part\t: %07x\n" , cpuid >> 4 );
887883 } else {
888- /* post-ARM7 */
889- seq_printf (m , "CPU variant\t: 0x%x\n" ,
890- (read_cpuid_id () >> 20 ) & 15 );
884+ if ((cpuid & 0x0008f000 ) == 0x00007000 ) {
885+ /* ARM7 */
886+ seq_printf (m , "CPU variant\t: 0x%02x\n" ,
887+ (cpuid >> 16 ) & 127 );
888+ } else {
889+ /* post-ARM7 */
890+ seq_printf (m , "CPU variant\t: 0x%x\n" ,
891+ (cpuid >> 20 ) & 15 );
892+ }
893+ seq_printf (m , "CPU part\t: 0x%03x\n" ,
894+ (cpuid >> 4 ) & 0xfff );
891895 }
892- seq_printf (m , "CPU part\t: 0x%03x\n" ,
893- (read_cpuid_id () >> 4 ) & 0xfff );
896+ seq_printf (m , "CPU revision\t: %d\n\n" , cpuid & 15 );
894897 }
895- seq_printf (m , "CPU revision\t: %d\n" , read_cpuid_id () & 15 );
896-
897- seq_puts (m , "\n" );
898898
899899 seq_printf (m , "Hardware\t: %s\n" , machine_name );
900900 seq_printf (m , "Revision\t: %04x\n" , system_rev );
0 commit comments