28
28
#include <linux/elfcore.h>
29
29
#include <linux/pm.h>
30
30
#include <linux/tick.h>
31
+ #include <linux/utsname.h>
31
32
32
33
#include <asm/leds.h>
33
34
#include <asm/processor.h>
@@ -199,16 +200,19 @@ void machine_restart(char * __unused)
199
200
200
201
void __show_regs (struct pt_regs * regs )
201
202
{
202
- unsigned long flags = condition_codes (regs );
203
+ unsigned long flags ;
204
+ char buf [64 ];
203
205
204
- printk ("CPU: %d\n" , smp_processor_id ());
206
+ printk ("CPU: %d %s (%s %.*s)\n" ,
207
+ smp_processor_id (), print_tainted (), init_utsname ()-> release ,
208
+ (int )strcspn (init_utsname ()-> version , " " ),
209
+ init_utsname ()-> version );
205
210
print_symbol ("PC is at %s\n" , instruction_pointer (regs ));
206
211
print_symbol ("LR is at %s\n" , regs -> ARM_lr );
207
- printk ("pc : [<%08lx>] lr : [<%08lx>] %s \n"
212
+ printk ("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx \n"
208
213
"sp : %08lx ip : %08lx fp : %08lx\n" ,
209
- instruction_pointer (regs ),
210
- regs -> ARM_lr , print_tainted (), regs -> ARM_sp ,
211
- regs -> ARM_ip , regs -> ARM_fp );
214
+ regs -> ARM_pc , regs -> ARM_lr , regs -> ARM_cpsr ,
215
+ regs -> ARM_sp , regs -> ARM_ip , regs -> ARM_fp );
212
216
printk ("r10: %08lx r9 : %08lx r8 : %08lx\n" ,
213
217
regs -> ARM_r10 , regs -> ARM_r9 ,
214
218
regs -> ARM_r8 );
@@ -218,36 +222,39 @@ void __show_regs(struct pt_regs *regs)
218
222
printk ("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n" ,
219
223
regs -> ARM_r3 , regs -> ARM_r2 ,
220
224
regs -> ARM_r1 , regs -> ARM_r0 );
221
- printk ("Flags: %c%c%c%c" ,
222
- flags & PSR_N_BIT ? 'N' : 'n' ,
223
- flags & PSR_Z_BIT ? 'Z' : 'z' ,
224
- flags & PSR_C_BIT ? 'C' : 'c' ,
225
- flags & PSR_V_BIT ? 'V' : 'v' );
226
- printk (" IRQs o%s FIQs o%s Mode %s%s Segment %s\n" ,
227
- interrupts_enabled (regs ) ? "n" : "ff" ,
225
+
226
+ flags = regs -> ARM_cpsr ;
227
+ buf [0 ] = flags & PSR_N_BIT ? 'N' : 'n' ;
228
+ buf [1 ] = flags & PSR_Z_BIT ? 'Z' : 'z' ;
229
+ buf [2 ] = flags & PSR_C_BIT ? 'C' : 'c' ;
230
+ buf [3 ] = flags & PSR_V_BIT ? 'V' : 'v' ;
231
+ buf [4 ] = '\0' ;
232
+
233
+ printk ("Flags: %s IRQs o%s FIQs o%s Mode %s%s Segment %s\n" ,
234
+ buf , interrupts_enabled (regs ) ? "n" : "ff" ,
228
235
fast_interrupts_enabled (regs ) ? "n" : "ff" ,
229
236
processor_modes [processor_mode (regs )],
230
237
thumb_mode (regs ) ? " (T)" : "" ,
231
238
get_fs () == get_ds () ? "kernel" : "user" );
232
- #if CONFIG_CPU_CP15
239
+ #ifdef CONFIG_CPU_CP15
233
240
{
234
241
unsigned int ctrl ;
235
- __asm__ (
236
- " mrc p15, 0, %0, c1, c0\n"
237
- : "=r" (ctrl ));
238
- printk ("Control: %04X\n" , ctrl );
239
- }
242
+
243
+ buf [0 ] = '\0' ;
240
244
#ifdef CONFIG_CPU_CP15_MMU
241
- {
242
- unsigned int transbase , dac ;
243
- __asm__ (
244
- " mrc p15, 0, %0, c2, c0\n"
245
- " mrc p15, 0, %1, c3, c0\n"
246
- : "=r" (transbase ), "=r" (dac ));
247
- printk ("Table: %08X DAC: %08X\n" ,
248
- transbase , dac );
249
- }
245
+ {
246
+ unsigned int transbase , dac ;
247
+ asm("mrc p15, 0, %0, c2, c0\n\t"
248
+ "mrc p15, 0, %1, c3, c0\n"
249
+ : "=r" (transbase ), "=r" (dac ));
250
+ snprintf (buf , sizeof (buf ), " Table: %08x DAC: %08x" ,
251
+ transbase , dac );
252
+ }
250
253
#endif
254
+ asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl ));
255
+
256
+ printk ("Control: %08x%s\n" , ctrl , buf );
257
+ }
251
258
#endif
252
259
}
253
260
0 commit comments